spacerData.maxWidth = 0;
spacerData.indent = LABEL_MARGIN;
spacer.setLayoutData(spacerData);
added++;
AbstractExecutable subExecutable = null;
if(sub.getPerformWhen() != null) {
sub.getPerformWhen().setSelectedExecutable(viewer.getManager());
subExecutable = sub.getPerformWhen().getSelectedExecutable();
} else {
subExecutable = sub.getExecutable();
}
/*
* Actions are disabled while inside dialogs.
*/
final int fi = index;
ImageHyperlink startButton = null;
boolean isActionShown = false;
if (subExecutable != null && !isInDialogMode()) {
added++;
isActionShown = true;
startButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_START), this, itemColor, Messages.PERFORM_TASK_TOOLTIP);
final ImageHyperlink finalStartButton = startButton;
startButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
viewer.runSubItemPerformExecutable(finalStartButton, fi);
}
});
holder.setStartButton(startButton);
}
if (!isActionShown || subExecutable.isConfirm() || !subExecutable.isRequired()) {
added++;
final ImageHyperlink completeButton = createButton(buttonComposite, CheatSheetPlugin.getPlugin().getImage(ICheatSheetResource.CHEATSHEET_ITEM_BUTTON_COMPLETE), this, itemColor, Messages.COMPLETE_TASK_TOOLTIP);
completeButton.addHyperlinkListener(new HyperlinkAdapter() {
public void linkActivated(HyperlinkEvent e) {
viewer.advanceSubItem(completeButton, true, fi);