public static void fillMenu(IMenuManager menu, CompilationUnitEditor editor, SurroundWithTryCatchAction surroundWithTryCatchAction) { IAction[] actions= getTemplateActions(editor); surroundWithTryCatchAction.update(editor.getSelectionProvider().getSelection()); if (actions == null && !surroundWithTryCatchAction.isEnabled()) { menu.add(NONE_APPLICABLE_ACTION); } else { menu.add(surroundWithTryCatchAction); menu.add(new Separator(TEMPLATE_GROUP)); if (actions == null) { menu.add(NONE_APPLICABLE_ACTION); } else { for (int i= 0; 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()); }
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()); }
IAction[] actions= getTemplateActions(editor);
IAction[] actions= getTemplateActions(editor);
IAction[] actions= getTemplateActions(editor);