Java Code Examples for org.eclipse.ui.menus.UIElement#setText()

The following examples show how to use org.eclipse.ui.menus.UIElement#setText() . 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: GoogleLoginCommandHandler.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@Override
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
  IGoogleLoginService loginService =
      element.getServiceLocator().getService(IGoogleLoginService.class);
  boolean loggedIn = loginService.hasAccounts();

  element.setText(loggedIn ? Messages.getString("LOGIN_MENU_LOGGED_IN")
      : Messages.getString("LOGIN_MENU_LOGGED_OUT"));
}
 
Example 2
Source File: ShowGcpStatusHandler.java    From google-cloud-eclipse with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
void updateElement(
    UIElement element,
    @SuppressWarnings("rawtypes") Map parameters,
    GcpStatusMonitoringService service) {
  GcpStatus status = service.getCurrentStatus();
  element.setText("Status: " + status.summary);
  switch (status.severity) {
    case OK:
      element.setIcon(IMG_OK);
      element.setTooltip(status.summary);
      break;
    case LOW:
      element.setIcon(IMG_LOW);
      element.setTooltip(summarizeIncidents(status.active));
      break;
    case MEDIUM:
      element.setIcon(IMG_MEDIUM);
      element.setTooltip(summarizeIncidents(status.active));
      break;
    case HIGH:
      element.setIcon(IMG_HIGH);
      element.setTooltip(summarizeIncidents(status.active));
      break;
    case ERROR:
    default:
      element.setIcon(IMG_ERROR);
      element.setTooltip(status.summary); // show error text
      break;
  }
}
 
Example 3
Source File: PlayPauseSimulationHandler.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setTooltip("Runs or pauses the current experiment (" + GamaKeyBindings.PLAY_STRING + ")");
	if (GAMA.isPaused())
		element.setText("Run Experiment (" + GamaKeyBindings.PLAY_STRING + ")");
	else
		element.setText("Pause Experiment (" + GamaKeyBindings.PLAY_STRING + ")");

}
 
Example 4
Source File: ReloadSimulationHandler.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setTooltip("Reloads the current experiment (" + GamaKeyBindings.RELOAD_STRING + ")");
	element.setText("Reload Experiment (" + GamaKeyBindings.RELOAD_STRING + ")");
}
 
Example 5
Source File: StepByStepHandler.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setTooltip("Runs the experiment one step at a time (" + GamaKeyBindings.STEP_STRING + ")");
	element.setText("Step Experiment (" + GamaKeyBindings.STEP_STRING + ")");
}
 
Example 6
Source File: CancelRun.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setTooltip("Closes the current experiment (" + GamaKeyBindings.QUIT_STRING + ")");
	element.setText("Close Experiment (" + GamaKeyBindings.QUIT_STRING + ")");
}