Java Code Examples for org.eclipse.jface.action.Action#setDisabledImageDescriptor()

The following examples show how to use org.eclipse.jface.action.Action#setDisabledImageDescriptor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeployConsolePageParticipant.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
private Action createTerminateAction() {
  Action terminate = new Action(Messages.getString("action.stop")) {
    @Override
    public void run() {
      DeployJob job = console.getJob();
      if (job != null) {
        job.cancel();
        update();
      }
    }
  };
  terminate.setToolTipText(Messages.getString("action.stop"));
  terminate.setImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP));
  terminate.setHoverImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP));
  terminate.setDisabledImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_STOP_DISABLED));
  return terminate;
}
 
Example 2
Source File: LocalAppEngineConsolePageParticipant.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
private void configureToolBar(IToolBarManager toolbarManager) {
  terminateAction = new Action(Messages.actionStop) {
    @Override
    public void run() {
      //code to execute when button is pressed
      LocalAppEngineServerBehaviour serverBehaviour = console.getServerBehaviourDelegate();
      if (serverBehaviour != null) {
        // try to initiate a nice shutdown
        boolean force = serverBehaviour.getServer().getServerState() == IServer.STATE_STOPPING;
        serverBehaviour.stop(force);
      }
      update();
    }
  };
  terminateAction.setToolTipText(Messages.actionStopToolTip);
  terminateAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
  terminateAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
  terminateAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));

  toolbarManager.appendToGroup(IConsoleConstants.LAUNCH_GROUP, terminateAction);
}
 
Example 3
Source File: DeployConsolePageParticipant.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
private Action createCloseAction() {
  Action close = new Action(Messages.getString("action.remove")) {
    @Override
    public void run() {
      ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] { console });
    }
  };
  close.setToolTipText(Messages.getString("action.remove"));
  close.setImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_REMOVE));
  close.setHoverImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_REMOVE));
  close.setDisabledImageDescriptor(getSharedImage(ISharedImages.IMG_ELCL_REMOVE_DISABLED));
  return close;
}
 
Example 4
Source File: FilterTerminalRulesContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText(Messages.FilterTerminalRulesContribution_title);
	action.setDescription(Messages.FilterTerminalRulesContribution_description);
	action.setToolTipText(Messages.FilterTerminalRulesContribution_tooltip);
	action.setImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));  
	action.setDisabledImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
}
 
Example 5
Source File: HideReturnTypesContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText(Messages.HideReturnTypesAction_title);
	action.setToolTipText(Messages.HideReturnTypesAction_tooltip);
	action.setDescription(Messages.HideReturnTypesAction_description);
	action.setImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif")); 
	action.setDisabledImageDescriptor(Activator.getImageDescriptor("icons/filter_rule.gif"));
}
 
Example 6
Source File: SortOutlineContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText(XtextUIMessages.LexicalSortingAction_label);
	action.setToolTipText(XtextUIMessages.LexicalSortingAction_tooltip);
	action.setDescription(XtextUIMessages.LexicalSortingAction_description);
	action.setImageDescriptor(XtextPluginImages.DESC_ALPHAB_SORT_CO);
	action.setDisabledImageDescriptor(XtextPluginImages.DESC_ALPHAB_SORT_CO_DISABLED);
}
 
Example 7
Source File: LinkWithEditorOutlineContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText(XtextUIMessages.ToggleLinkWithEditorAction_label);
	action.setToolTipText(XtextUIMessages.ToggleLinkWithEditorAction_toolTip);
	action.setDescription(XtextUIMessages.ToggleLinkWithEditorAction_description);
	action.setImageDescriptor(XtextPluginImages.DESC_LINK_WITH_EDITOR);
	action.setDisabledImageDescriptor(XtextPluginImages.DESC_LINK_WITH_EDITOR_DISABLED);
}
 
Example 8
Source File: MarkOccurrenceActionContributor.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText(Messages.MarkOccurrenceActionContributor_text);
	action.setDescription(Messages.MarkOccurrenceActionContributor_description);
	action.setToolTipText(Messages.MarkOccurrenceActionContributor_toolTipText);
	action.setImageDescriptor(XtextPluginImages.DESC_MARK_OCCURRENCES);
	action.setDisabledImageDescriptor(XtextPluginImages.DESC_MARK_OCCURRENCES_DISABLED);
	addPropertyChangeListener();
}
 
Example 9
Source File: SwitchOutlineModeContribution.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureAction(Action action) {
	action.setText("Jvm View");
	action.setToolTipText("Jvm Model View");
	action.setDescription("Switch between Source and Jvm model perspectives.");
	action.setImageDescriptor(imageHelper.getImageDescriptor("jvm_mode.gif"));
	action.setDisabledImageDescriptor(imageHelper.getImageDescriptor("jvm_mode.gif"));
}
 
Example 10
Source File: HeaderPageWithSash.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the tool bar actions.
 *
 * @param managedForm the managed form
 */
protected void createToolBarActions(IManagedForm managedForm) {
  final ScrolledForm form = managedForm.getForm();

  haction = new Action("hor", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
    @Override
    public void run() {
      sashForm.setOrientation(SWT.HORIZONTAL);
      form.reflow(true);
    }
  };
  haction.setChecked(true);
  haction.setToolTipText("Horizontal Orientation");
  TAEConfiguratorPlugin instance = TAEConfiguratorPlugin.getDefault();
  haction.setImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
  haction.setDisabledImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));

  vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
    @Override
    public void run() {
      sashForm.setOrientation(SWT.VERTICAL);
      form.reflow(true);
    }
  };
  vaction.setChecked(false);
  vaction.setToolTipText("Vertical Orientation");
  vaction.setImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
  vaction.setDisabledImageDescriptor(instance
          .getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
  form.getToolBarManager().add(haction);
  form.getToolBarManager().add(vaction);
  form.updateToolBar();
  maybeInitialize(managedForm);
}