public class CodeEditorController extends java.lang.Object implements Controller, CodeMenuConstants, ContextMenuListener
CodeEditorController is the controller for the CodeEditor Addin. It takes care of managing commands that this CodeEditor supports (i.e., Cut, Copy, or Paste.)| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CATEGORY_SOURCE_MENU
Deprecated.
use CodeEditorConstants
|
static int |
EDIT_SELECTED_ONLY_CMD_ID
Deprecated.
use CodeEditorConstants
|
static int |
FORMAT_CMD_ID
Deprecated.
use CodeEditorConstants
|
static int |
UNDO_WRAPPER_MSG
Deprecated.
use CodeEditorConstants
|
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGEDCATEGORY_CODE_MENU, SECTION_SOURCE_CODING, SECTION_SOURCE_COMMENTS, SECTION_SOURCE_CTXT_MENU, SECTION_SOURCE_CTXT_MENU_NON_EDITOR, SECTION_SOURCE_GOTO, SECTION_SOURCE_GUTTER_BOOKMARK, SECTION_SOURCE_GUTTER_BREAKPOINT, SECTION_SOURCE_GUTTER_GOTO, SECTION_SOURCE_GUTTER_LINE_NUMBER, SECTION_SOURCE_GUTTER_PROFILER, SECTION_SOURCE_GUTTER_TODO, SECTION_SOURCE_IMPORT, SECTION_SOURCE_INSIGHT, SECTION_SOURCE_REFACTOR, SECTION_SOURCE_REFORMAT, WEIGHT_ADD_JAVADOC_COMMENT, WEIGHT_ASSISTANCE_INSIGHT, WEIGHT_BLOCK_INDENT, WEIGHT_BLOCK_OUTDENT, WEIGHT_BREAKPOINT, WEIGHT_CODE_ASSIST, WEIGHT_COMPLETE_STATEMENT, WEIGHT_COMPLETION_INSIGHT, WEIGHT_EXPAND_SELECTION, WEIGHT_EXPAND_TEMPLATE, WEIGHT_EXTRACT_METHOD, WEIGHT_GENERATE_ACCESSORS, WEIGHT_GENERATE_CONSTRUCTOR, WEIGHT_GOTO, WEIGHT_GOTO_NEXT_METHOD, WEIGHT_GOTO_PREV_METHOD, WEIGHT_IMPLEMENT_INTERFACE, WEIGHT_INTRODUCE_VARIABLE, WEIGHT_LINE_GUTTER_ADD_TODO, WEIGHT_LINE_GUTTER_EDIT_BREAKPOINT, WEIGHT_LINE_GUTTER_EDIT_TODO, WEIGHT_LINE_GUTTER_ENABLE_BREAKPOINT, WEIGHT_LINE_GUTTER_PREFERENCES, WEIGHT_LINE_GUTTER_TOGGLE_BOOKMARK, WEIGHT_LINE_GUTTER_TOGGLE_BREAKPOINT, WEIGHT_LINE_GUTTER_TOGGLE_LINE_NUMBERS, WEIGHT_MOVE_ELEMENT, WEIGHT_NARROW_IMPORTS, WEIGHT_NEW_METHOD_TEST, WEIGHT_ORGANIZE_IMPORTS, WEIGHT_OVERRIDE_METHODS, WEIGHT_PARAMETER_INSIGHT, WEIGHT_QUICK_DOC, WEIGHT_REFORMAT, WEIGHT_REFRESH_TEST_SUITE, WEIGHT_REMOVE_UNUSED_IMPORTS, WEIGHT_RENAME_ELEMENT, WEIGHT_SEPARATOR1, WEIGHT_SEPARATOR2, WEIGHT_SEPARATOR3, WEIGHT_SEPARATOR4, WEIGHT_SEPARATOR5, WEIGHT_SEPARATOR6, WEIGHT_SEPARATOR7, WEIGHT_SEPARATOR8, WEIGHT_SMART_COMPLETION_INSIGHT, WEIGHT_SORT_IMPORTS, WEIGHT_SOURCE_EDITS_MENU, WEIGHT_SURROUND_WITH, WEIGHT_TOGGLE_BLOCK_COLORING, WEIGHT_TOGGLE_BREADCRUMBS, WEIGHT_TOGGLE_COMMENTS, WEIGHT_TOGGLE_SHOW_WHITESPACE, WEIGHT_UNSURROUND, WEIGHT_WIDEN_IMPORTS| Modifier and Type | Method and Description |
|---|---|
void |
checkCommandsAfterNavigation(Context context)
Utility routine which is used to verify command sensitivity after a change in the caret position of the editor.
|
static CodeEditor |
getCodeEditorFromContext(Context context)
Utility routine to fetch the CodeEditor instance from the context.
|
static CodeEditorController |
getDefaultController()
Get the default singleton controller.
|
static BasicEditorPane |
getEditorPaneFromContext(Context context)
Utility routine to fetch the BasicEditorPane instance from the context.
|
boolean |
handleDefaultAction(Context context)
Called when the user double clicks on an item that has a popup menu.
|
boolean |
handleEvent(IdeAction action, Context context)
This method is called when a user interaction with a
View triggers the execution of a command. |
void |
menuWillHide(ContextMenu popup)
This method is called just before a showing context menu is dismissed.
|
void |
menuWillShow(ContextMenu popup)
Called just before the context menu is popping up.
|
boolean |
update(IdeAction action, Context context)
This method is called when the availability of a specific command needs to be determined.
|
@Deprecated public static final int EDIT_SELECTED_ONLY_CMD_ID
@Deprecated public static final int FORMAT_CMD_ID
@Deprecated public static final java.lang.String CATEGORY_SOURCE_MENU
@Deprecated public static final int UNDO_WRAPPER_MSG
public static CodeEditorController getDefaultController()
public void checkCommandsAfterNavigation(Context context)
context - the current contextpublic static final CodeEditor getCodeEditorFromContext(Context context)
context - the current contextpublic static final BasicEditorPane getEditorPaneFromContext(Context context)
context - the current contextpublic boolean update(IdeAction action, Context context)
update in interface Controlleraction - the action associated with this commandcontext - the current contextpublic boolean handleEvent(IdeAction action, Context context)
View triggers the execution of a command.handleEvent in interface Controlleraction - action whose command is to be executed.public void menuWillShow(ContextMenu popup)
menuWillShow in interface ContextMenuListenerpopup - the current view context menupublic void menuWillHide(ContextMenu popup)
ContextMenuListenerContextMenuListener.menuWillShow(oracle.ide.controller.ContextMenu), since the IDE takes care of that automatically.menuWillHide in interface ContextMenuListenerpopup - the context menu being hiddenpublic boolean handleDefaultAction(Context context)
handleDefaultAction in interface ContextMenuListenercontext - the current context