setRestartButtonDisplayProperties(restartAppButton.getSelectionButton(), ApplicationAction.RESTART);
setRestartButtonDisplayProperties(updateRestartAppButton.getSelectionButton(), ApplicationAction.UPDATE_RESTART);
}
protected void setRestartButtonDisplayProperties(Button restartButton, ApplicationAction restartButtonAction) {
ApplicationAction currentDeployedAction = getCurrentDeploymentStateApplicationAction();
// Set the UI for the restart buttons, including tooltip text, based on
// the currently deployed application action.
switch (currentDeployedAction) {
case START:
restartButton.setImage(CloudFoundryImages.getImage(CloudFoundryImages.RESTART));
restartButton
.setToolTipText(restartButtonAction == ApplicationAction.UPDATE_RESTART ? Messages.ApplicationDetailsPart_TEXT_UPDATE_RESTART_APP
: Messages.ApplicationDetailsPart_TEXT_RESTART_APP);
break;
case DEBUG:
restartButton.setToolTipText(restartButtonAction == ApplicationAction.UPDATE_RESTART ? NLS.bind(
Messages.ApplicationDetailsPart_TEXT_UPDATE_RESTART_IN_MODE, currentDeployedAction.getDisplayName()
.toLowerCase()) : NLS.bind(Messages.ApplicationDetailsPart_TEXT_RESTART_IN_MODE,
currentDeployedAction.getDisplayName().toLowerCase()));
restartButton.setImage(CloudFoundryImages.getImage(CloudFoundryImages.RESTART_DEBUG_MODE));
break;
}
}