public static void fillMenu(IMenuManager menu, CompilationUnitEditor editor, SurroundWithTryCatchAction surroundWithTryCatchAction, SurroundWithTryMultiCatchAction surroundWithTryMultiCatchAction) { IAction[] actions= getTemplateActions(editor); surroundWithTryCatchAction.update(editor.getSelectionProvider().getSelection()); boolean addSurroundWithTryCatchAction= surroundWithTryCatchAction.isEnabled() && !isInJavadoc(editor); boolean addSurroundWithTryMultiCatchAction= surroundWithTryMultiCatchAction.isEnabled() && !isInJavadoc(editor); if ((actions == null || actions.length == 0) && (!addSurroundWithTryCatchAction && !addSurroundWithTryMultiCatchAction)) { menu.add(NONE_APPLICABLE_ACTION); } else { if (addSurroundWithTryCatchAction) menu.add(surroundWithTryCatchAction); if (addSurroundWithTryMultiCatchAction) menu.add(surroundWithTryMultiCatchAction); menu.add(new Separator(TEMPLATE_GROUP)); for (int i= 0; actions != null && i < actions.length; i++) menu.add(actions[i]); } menu.add(new Separator(CONFIG_GROUP)); menu.add(new ConfigureTemplatesAction()); }
public static void fillMenu(IMenuManager menu, CompilationUnitEditor editor, SurroundWithTryCatchAction surroundWithTryCatchAction, SurroundWithTryMultiCatchAction surroundWithTryMultiCatchAction) { IAction[] actions= getTemplateActions(editor); surroundWithTryCatchAction.update(editor.getSelectionProvider().getSelection()); boolean addSurroundWithTryCatchAction= surroundWithTryCatchAction.isEnabled() && !isInJavadoc(editor); boolean addSurroundWithTryMultiCatchAction= surroundWithTryMultiCatchAction.isEnabled() && !isInJavadoc(editor); if ((actions == null || actions.length == 0) && (!addSurroundWithTryCatchAction && !addSurroundWithTryMultiCatchAction)) { menu.add(NONE_APPLICABLE_ACTION); } else { if (addSurroundWithTryCatchAction) menu.add(surroundWithTryCatchAction); if (addSurroundWithTryMultiCatchAction) menu.add(surroundWithTryMultiCatchAction); menu.add(new Separator(TEMPLATE_GROUP)); for (int i= 0; actions != null && i < actions.length; i++) menu.add(actions[i]); } menu.add(new Separator(CONFIG_GROUP)); menu.add(new ConfigureTemplatesAction()); }
boolean addSurroundWith= !isInJavadoc(editor); if (addSurroundWith) { SurroundWithTryCatchAction surroundWithTryCatch= SurroundWithActionGroup.createSurroundWithTryCatchAction(editor);
boolean addSurroundWith= !isInJavadoc(editor); if (addSurroundWith) { SurroundWithTryCatchAction surroundWithTryCatch= SurroundWithActionGroup.createSurroundWithTryCatchAction(editor);