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

The following examples show how to use org.eclipse.jface.action.Action#setHoverImageDescriptor() . 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;
}