List of usage examples for org.eclipse.jface.action IAction setDisabledImageDescriptor
void setDisabledImageDescriptor(ImageDescriptor newImage);
From source file:ca.usask.cs.srlab.simclipse.SimClipsePluginImages.java
License:Open Source License
public static void setImageDescriptors(IAction action, String type, String relPath) { relPath = relPath.substring(NAME_PREFIX_LENGTH); action.setDisabledImageDescriptor(create("d" + type, relPath, false)); //$NON-NLS-1$ ImageDescriptor desc = create("e" + type, relPath, true); //$NON-NLS-1$ action.setHoverImageDescriptor(desc); action.setImageDescriptor(desc);/*w ww . j a v a 2 s .c om*/ }
From source file:cc.frz.ecl.filterpackageexplorer.FilterPackageExplorer.java
License:Open Source License
/** * Create the button that clears the text. * /*from www. j av a 2 s .com*/ * @param parent * parent <code>Composite</code> of toolbar button */ private void createClearText(Composite parent) { filterToolBar = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL); ToolBar control = filterToolBar.createControl(parent); control.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); IAction clearTextAction = new Action("", IAction.AS_PUSH_BUTTON) {//$NON-NLS-1$ /* * (non-Javadoc) * * @see org.eclipse.jface.action.Action#run() */ public void run() { filtertext.setText(""); updateTree(); } }; clearTextAction.setToolTipText(WorkbenchMessages.FilteredTree_ClearToolTip); clearTextAction.setImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(CLEAR_ICON)); clearTextAction.setDisabledImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(DCLEAR_ICON)); filterToolBar.add(clearTextAction); filterToolBar.update(false); }
From source file:cideplus.ui.astview.ASTViewImages.java
License:Open Source License
public static void setImageDescriptors(IAction action, String type) { ImageDescriptor id = create("d", type); //$NON-NLS-1$ if (id != null) action.setDisabledImageDescriptor(id); id = create("c", type); //$NON-NLS-1$ if (id != null) { action.setHoverImageDescriptor(id); action.setImageDescriptor(id);/*from w w w .ja v a 2s. c o m*/ } else { action.setImageDescriptor(ImageDescriptor.getMissingImageDescriptor()); } }
From source file:com.amalto.workbench.widgets.FilteredCheckboxTree.java
License:Open Source License
/** * Create the button that clears the text. * //from w w w . j a va 2s.co m * @param parent parent <code>Composite</code> of toolbar button */ private void createClearText(Composite parent) { // only create the button if the text widget doesn't support one natively if ((filterText.getStyle() & SWT.CANCEL) == 0) { filterToolBar = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL); filterToolBar.createControl(parent); IAction clearTextAction = new Action("", IAction.AS_PUSH_BUTTON) {//$NON-NLS-1$ /* * (non-Javadoc) * * @see org.eclipse.jface.action.Action#run() */ @Override public void run() { clearText(); } }; clearTextAction.setToolTipText(""); clearTextAction.setImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(CLEAR_ICON)); clearTextAction .setDisabledImageDescriptor(JFaceResources.getImageRegistry().getDescriptor(DCLEAR_ICON)); filterToolBar.add(clearTextAction); } }
From source file:com.aptana.editor.php.internal.ui.PHPPluginImages.java
License:Open Source License
private static void setImageDescriptors(IAction action, String type, String relPath) { ImageDescriptor id = create("d" + type, relPath, false); //$NON-NLS-1$ if (id != null) action.setDisabledImageDescriptor(id); /*// w w w .j av a 2 s . c om * id= create("c" + type, relPath, false); //$NON-NLS-1$ if (id != null) action.setHoverImageDescriptor(id); */ ImageDescriptor descriptor = create("e" + type, relPath); //$NON-NLS-1$ action.setHoverImageDescriptor(descriptor); action.setImageDescriptor(descriptor); }
From source file:com.centurylink.mdw.plugin.designer.views.AutomatedTestActionGroup.java
License:Apache License
private IAction createRerunAction() { IAction action = new Action() { public void run() { view.handleRerun();//from w ww.j a va 2s. com } }; action.setId(MdwMenuManager.MDW_MENU_PREFIX + "rerun.tests"); action.setText("Rerun Test(s)"); ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/rerun.gif"); action.setImageDescriptor(imageDesc); ImageDescriptor disabledImageDesc = MdwPlugin.getImageDescriptor("icons/rerun_disabled.gif"); action.setDisabledImageDescriptor(disabledImageDesc); return action; }
From source file:com.centurylink.mdw.plugin.designer.views.AutomatedTestActionGroup.java
License:Apache License
private IAction createStopAction() { IAction action = new Action() { public void run() { view.handleStop();/*from w ww. ja va 2s .c om*/ } }; action.setId(MdwMenuManager.MDW_MENU_PREFIX + "stop.tests"); action.setText("Stop Test(s)"); ImageDescriptor imageDesc = MdwPlugin.getImageDescriptor("icons/stop.gif"); action.setImageDescriptor(imageDesc); ImageDescriptor disabledImageDesc = MdwPlugin.getImageDescriptor("icons/stop_disabled.gif"); action.setDisabledImageDescriptor(disabledImageDesc); return action; }
From source file:com.centurylink.mdw.plugin.designer.views.ToolboxViewActionGroup.java
License:Apache License
private IAction createSaveAction() { IAction saveAction = new Action() { public void run() { view.handleSave();//from w ww . j a v a2 s . c o m } }; saveAction.setText("Save"); ImageDescriptor saveImageDesc = MdwPlugin.getImageDescriptor("icons/save.gif"); saveAction.setImageDescriptor(saveImageDesc); ImageDescriptor saveDisabledImageDesc = MdwPlugin.getImageDescriptor("icons/save_disabled.gif"); saveAction.setDisabledImageDescriptor(saveDisabledImageDesc); return saveAction; }
From source file:com.coretek.spte.common.UIPluginImages.java
License:Open Source License
/** * Sets all available image descriptors for the given action. *//*from w w w .ja v a2 s. com*/ public static void setImageDescriptors(IAction action, String type, String relPath) { if (relPath.startsWith(NAME_PREFIX)) relPath = relPath.substring(NAME_PREFIX_LENGTH); action.setDisabledImageDescriptor(create("d" + type, relPath)); action.setImageDescriptor(create("e" + type, relPath)); }
From source file:com.google.dart.tools.ui.DartPluginImages.java
License:Open Source License
private static void setImageDescriptors(IAction action, String type, String relPath) { ImageDescriptor id = create("d" + type, relPath, false); //$NON-NLS-1$ if (id != null) { action.setDisabledImageDescriptor(id); }// ww w .j a v a 2 s .c o m /* * id= create("c" + type, relPath, false); //$NON-NLS-1$ if (id != null) * action.setHoverImageDescriptor(id); */ ImageDescriptor descriptor = create("e" + type, relPath, true); //$NON-NLS-1$ action.setHoverImageDescriptor(descriptor); action.setImageDescriptor(descriptor); }