Example usage for org.eclipse.jface.action Action setImageDescriptor

List of usage examples for org.eclipse.jface.action Action setImageDescriptor

Introduction

In this page you can find the example usage for org.eclipse.jface.action Action setImageDescriptor.

Prototype

@Override
    public void setImageDescriptor(ImageDescriptor newImage) 

Source Link

Usage

From source file:edu.harvard.i2b2.eclipse.plugins.ontology.views.edit.EditView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        @Override//w w  w  . ja v a2s  .c o  m
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.ontology/html/i2b2_edit_terms_index.htm");
        }
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(EditView.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);

}

From source file:edu.harvard.i2b2.eclipse.plugins.ontology.views.edit.EditView.java

License:Open Source License

private void addSyncButtonToToolBar() {
    final Display theDisplay = Display.getCurrent();
    Action syncAction = new Action() {
        @Override//from w  w  w . j a v  a 2s .  c  om
        public void run() {
            if (!(Roles.getInstance().isRoleValid())) {
                MessageBox mBox = new MessageBox(Display.getCurrent().getActiveShell(),
                        SWT.ICON_WARNING | SWT.OK);
                mBox.setText("Update Ontology Warning");
                mBox.setMessage(Messages.getString("EditView.MinRoleNeeded2"));

                int result = mBox.open();
                return;
            }

            // first get dirty state status
            getDirtyState(theDisplay);
            UpdateOntologyDialog dlg = new UpdateOntologyDialog(Display.getCurrent().getActiveShell());
            dlg.open();
        }
    };
    MetadataRecord.getInstance().setSyncAction(syncAction);
    getDirtyState(theDisplay);
    if (ProcessStatus.getInstance().getDirtyState() == DirtyValueType.NONE) {
        syncAction.setImageDescriptor(
                ImageDescriptor.createFromFile(EditView.class, "/icons/database_refresh.png"));
    } else {
        syncAction.setImageDescriptor(
                ImageDescriptor.createFromFile(EditView.class, "/icons/red_database_refresh.png"));
    }
    getViewSite().getActionBars().getToolBarManager().add(syncAction);

}

From source file:edu.harvard.i2b2.eclipse.plugins.ontology.views.find.FindView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        @Override//from  www . j  a va 2 s .  c  o m
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.ontology/html/i2b2_find_terms_index.htm");
        }
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(FindView.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.ontology.views.OntologyView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        @Override/* w  ww  . j  a va 2 s .c  o m*/
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.ontology/html/i2b2_navigate_terms_index.htm");
        }
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(OntologyView.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.patientMapping.views.PatientMappingView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.patientMapping/html/i2b2_pm_index.html");
        }/*from  w ww . j a  v a  2  s. c  o m*/
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(PatientMappingView.class, "/icons/help.png"));

    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.patientSet.views.PatientSetView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.patientSet/html/i2b2_ps_index.html");
        }/*w ww .j  a v a2 s  . c  o m*/
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(PatientSetView.class, "/icons/help.png"));

    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.previousquery.views.PreviousQueryView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.previousQuery/html/i2b2_pq_index.htm");
        }//from w  w  w . j a  v a 2  s  .c  o  m
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(PreviousQueryView.class, "/icons/help.png"));

    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.query.views.QueryView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        public void run() {
            helpSystem.displayHelpResource("/edu.harvard.i2b2.eclipse.plugins.query/html/i2b2_qt_index.htm");
        }/*from   w  w  w  .j  ava  2 s. c  o  m*/
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(QueryView.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.querytool.views.QueryToolView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        public void run() {
            helpSystem.displayHelpResource("/edu.harvard.i2b2.eclipse.plugins.querytool/html/qtt_index.html");
        }/*  w w  w.  j  a  v a 2 s  . c o m*/
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(QueryToolMainUI.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}

From source file:edu.harvard.i2b2.eclipse.plugins.workplace.views.find.FindView.java

License:Open Source License

private void addHelpButtonToToolBar() {
    final IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem();
    Action helpAction = new Action() {
        @Override/* w  w w . j a va  2 s  . com*/
        public void run() {
            helpSystem.displayHelpResource(
                    "/edu.harvard.i2b2.eclipse.plugins.workplace/html/i2b2_wpf_index.html");
        }
    };
    helpAction.setImageDescriptor(ImageDescriptor.createFromFile(FindView.class, "/icons/help.png"));
    getViewSite().getActionBars().getToolBarManager().add(helpAction);
}