private static SurroundWithTryCatchAction createSurroundWithTryCatchAction(CompilationUnitEditor editor) { SurroundWithTryCatchAction result= new SurroundWithTryCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryCatchActionName); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_CATCH); editor.setAction("SurroundWithTryCatch", result); //$NON-NLS-1$ return result; }
setAction("Uncomment", action); //$NON-NLS-1$ markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.UNCOMMENT_ACTION); setAction("ToggleComment", action); //$NON-NLS-1$ markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION); setAction("Format", action); //$NON-NLS-1$ markAsStateDependentAction("Format", true); //$NON-NLS-1$ markAsSelectionDependentAction("Format", true); //$NON-NLS-1$ setAction("AddBlockComment", action); //$NON-NLS-1$ markAsStateDependentAction("AddBlockComment", true); //$NON-NLS-1$ markAsSelectionDependentAction("AddBlockComment", true); //$NON-NLS-1$ setAction("RemoveBlockComment", action); //$NON-NLS-1$ markAsStateDependentAction("RemoveBlockComment", true); //$NON-NLS-1$ markAsSelectionDependentAction("RemoveBlockComment", true); //$NON-NLS-1$ setAction("Indent", action); //$NON-NLS-1$ markAsStateDependentAction("Indent", true); //$NON-NLS-1$ markAsSelectionDependentAction("Indent", true); //$NON-NLS-1$ setAction("IndentOnTab", action); //$NON-NLS-1$ markAsStateDependentAction("IndentOnTab", true); //$NON-NLS-1$ markAsSelectionDependentAction("IndentOnTab", true); //$NON-NLS-1$ rAction.setHelpContextId(IAbstractTextEditorHelpContextIds.MOVE_LINES_ACTION);
private static SurroundWithTryCatchAction createSurroundWithTryCatchAction(CompilationUnitEditor editor) { SurroundWithTryCatchAction result= new SurroundWithTryCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryCatchActionName); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_CATCH); editor.setAction("SurroundWithTryCatch", result); //$NON-NLS-1$ return result; } }
setAction("Uncomment", action); //$NON-NLS-1$ markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.UNCOMMENT_ACTION); setAction("ToggleComment", action); //$NON-NLS-1$ markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION); setAction("Format", action); //$NON-NLS-1$ markAsStateDependentAction("Format", true); //$NON-NLS-1$ markAsSelectionDependentAction("Format", true); //$NON-NLS-1$ setAction("AddBlockComment", action); //$NON-NLS-1$ markAsStateDependentAction("AddBlockComment", true); //$NON-NLS-1$ markAsSelectionDependentAction("AddBlockComment", true); //$NON-NLS-1$ setAction("RemoveBlockComment", action); //$NON-NLS-1$ markAsStateDependentAction("RemoveBlockComment", true); //$NON-NLS-1$ markAsSelectionDependentAction("RemoveBlockComment", true); //$NON-NLS-1$ setAction("Indent", action); //$NON-NLS-1$ markAsStateDependentAction("Indent", true); //$NON-NLS-1$ markAsSelectionDependentAction("Indent", true); //$NON-NLS-1$ setAction("IndentOnTab", action); //$NON-NLS-1$ markAsStateDependentAction("IndentOnTab", true); //$NON-NLS-1$ markAsSelectionDependentAction("IndentOnTab", true); //$NON-NLS-1$ rAction.setHelpContextId(IAbstractTextEditorHelpContextIds.MOVE_LINES_ACTION);
fAddImport.setActionDefinitionId(IJavaEditorActionDefinitionIds.ADD_IMPORT); fAddImport.update(); editor.setAction("AddImport", fAddImport); //$NON-NLS-1$ editor.setAction("OrganizeImports", fOrganizeImports); //$NON-NLS-1$ editor.setAction("SortMembers", fSortMembers); //$NON-NLS-1$ editor.setAction("OverrideMethods", fOverrideMethods); //$NON-NLS-1$ editor.setAction("AddGetterSetter", fAddGetterSetter); //$NON-NLS-1$ editor.setAction("AddDelegateMethods", fAddDelegateMethods); //$NON-NLS-1$ editor.setAction("AddUnimplementedConstructors", fAddUnimplementedConstructors); //$NON-NLS-1$ editor.setAction("GenerateConstructorUsingFields", fGenerateConstructorUsingFields); //$NON-NLS-1$ editor.setAction("GenerateHashCodeEquals", fHashCodeEquals); //$NON-NLS-1$ editor.setAction("GenerateToString", fToString); //$NON-NLS-1$ editor.setAction("AddJavadocComment", fAddJavaDocStub); //$NON-NLS-1$ editor.setAction("CleanUp", fCleanUp); //$NON-NLS-1$ editor.setAction("ExternalizeStrings", fExternalizeStrings); //$NON-NLS-1$
setAction("ContentAssistProposal", action); //$NON-NLS-1$ markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.CONTENT_ASSIST_ACTION); setAction("ContentAssistContextInformation", action); //$NON-NLS-1$ markAsStateDependentAction("ContentAssistContextInformation", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.PARAMETER_HINTS_ACTION); setAction("Comment", action); //$NON-NLS-1$ markAsStateDependentAction("Comment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.COMMENT_ACTION); setAction("Uncomment", action); //$NON-NLS-1$ markAsStateDependentAction("Uncomment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.UNCOMMENT_ACTION); setAction("ToggleComment", action); //$NON-NLS-1$ markAsStateDependentAction("ToggleComment", true); //$NON-NLS-1$ PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION); setAction("Format", action); //$NON-NLS-1$ markAsStateDependentAction("Format", true); //$NON-NLS-1$ markAsSelectionDependentAction("Format", true); //$NON-NLS-1$ setAction("AddBlockComment", action); //$NON-NLS-1$ markAsStateDependentAction("AddBlockComment", true); //$NON-NLS-1$ markAsSelectionDependentAction("AddBlockComment", true); //$NON-NLS-1$ setAction("RemoveBlockComment", action); //$NON-NLS-1$
fAddImport.setActionDefinitionId(IJavaEditorActionDefinitionIds.ADD_IMPORT); fAddImport.update(); editor.setAction("AddImport", fAddImport); //$NON-NLS-1$ editor.setAction("OrganizeImports", fOrganizeImports); //$NON-NLS-1$ editor.setAction("SortMembers", fSortMembers); //$NON-NLS-1$ editor.setAction("OverrideMethods", fOverrideMethods); //$NON-NLS-1$ editor.setAction("AddGetterSetter", fAddGetterSetter); //$NON-NLS-1$ editor.setAction("AddDelegateMethods", fAddDelegateMethods); //$NON-NLS-1$ editor.setAction("AddUnimplementedConstructors", fAddUnimplementedConstructors); //$NON-NLS-1$ editor.setAction("GenerateConstructorUsingFields", fGenerateConstructorUsingFields); //$NON-NLS-1$ editor.setAction("GenerateHashCodeEquals", fHashCodeEquals); //$NON-NLS-1$ editor.setAction("AddJavadocComment", fAddJavaDocStub); //$NON-NLS-1$ editor.setAction("CleanUp", fCleanUp); //$NON-NLS-1$ editor.setAction("ExternalizeStrings", fExternalizeStrings); //$NON-NLS-1$
fAddImport.setActionDefinitionId(IJavaEditorActionDefinitionIds.ADD_IMPORT); fAddImport.update(); editor.setAction("AddImport", fAddImport); //$NON-NLS-1$ editor.setAction("OrganizeImports", fOrganizeImports); //$NON-NLS-1$ editor.setAction("SortMembers", fSortMembers); //$NON-NLS-1$ editor.setAction("OverrideMethods", fOverrideMethods); //$NON-NLS-1$ editor.setAction("AddGetterSetter", fAddGetterSetter); //$NON-NLS-1$ editor.setAction("AddDelegateMethods", fAddDelegateMethods); //$NON-NLS-1$ editor.setAction("AddUnimplementedConstructors", fAddUnimplementedConstructors); //$NON-NLS-1$ editor.setAction("GenerateConstructorUsingFields", fGenerateConstructorUsingFields); //$NON-NLS-1$ editor.setAction("GenerateHashCodeEquals", fHashCodeEquals); //$NON-NLS-1$ editor.setAction("GenerateToString", fToString); //$NON-NLS-1$ editor.setAction("AddJavadocComment", fAddJavaDocStub); //$NON-NLS-1$ editor.setAction("CleanUp", fCleanUp); //$NON-NLS-1$ editor.setAction("ExternalizeStrings", fExternalizeStrings); //$NON-NLS-1$
static SurroundWithTryMultiCatchAction createSurroundWithTryMultiCatchAction(CompilationUnitEditor editor) { SurroundWithTryMultiCatchAction result= new SurroundWithTryMultiCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryMultiCatchActionName); result.setImageDescriptor(JavaPluginImages.getDescriptor(JavaPluginImages.IMG_CORRECTION_CHANGE)); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_MULTI_CATCH); editor.setAction("SurroundWithTryMultiCatch", result); //$NON-NLS-1$ return result; } }
static SurroundWithTryCatchAction createSurroundWithTryCatchAction(CompilationUnitEditor editor) { SurroundWithTryCatchAction result= new SurroundWithTryCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryCatchActionName); result.setImageDescriptor(JavaPluginImages.getDescriptor(JavaPluginImages.IMG_CORRECTION_CHANGE)); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_CATCH); editor.setAction("SurroundWithTryCatch", result); //$NON-NLS-1$ return result; }
static SurroundWithTryMultiCatchAction createSurroundWithTryMultiCatchAction(CompilationUnitEditor editor) { SurroundWithTryMultiCatchAction result= new SurroundWithTryMultiCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryMultiCatchActionName); result.setImageDescriptor(JavaPluginImages.getDescriptor(JavaPluginImages.IMG_CORRECTION_CHANGE)); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_MULTI_CATCH); editor.setAction("SurroundWithTryMultiCatch", result); //$NON-NLS-1$ return result; } }
static SurroundWithTryCatchAction createSurroundWithTryCatchAction(CompilationUnitEditor editor) { SurroundWithTryCatchAction result= new SurroundWithTryCatchAction(editor); result.setText(ActionMessages.SurroundWithTemplateMenuAction_SurroundWithTryCatchActionName); result.setImageDescriptor(JavaPluginImages.getDescriptor(JavaPluginImages.IMG_CORRECTION_CHANGE)); result.setActionDefinitionId(IJavaEditorActionDefinitionIds.SURROUND_WITH_TRY_CATCH); editor.setAction("SurroundWithTryCatch", result); //$NON-NLS-1$ return result; }
protected void createNavigationActions() { super.createNavigationActions(); final StyledText textWidget= getSourceViewer().getTextWidget(); IAction action= new DeletePreviousSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.BS, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, true); action= new DeleteNextSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.DEL, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, true); }
@Override protected void createNavigationActions() { super.createNavigationActions(); final StyledText textWidget= getSourceViewer().getTextWidget(); IAction action= new DeletePreviousSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.BS, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, true); action= new DeleteNextSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.DEL, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, true); }
@Override protected void createNavigationActions() { super.createNavigationActions(); final StyledText textWidget= getSourceViewer().getTextWidget(); IAction action= new DeletePreviousSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.BS, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS_WORD, true); action= new DeleteNextSubWordAction(); action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD); setAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, action); textWidget.setKeyBinding(SWT.CTRL | SWT.DEL, SWT.NULL); markAsStateDependentAction(ITextEditorActionDefinitionIds.DELETE_NEXT_WORD, true); }