Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


oracle.ide.ceditor
Class CodeEditorController

java.lang.Object
  extended by oracle.ide.ceditor.CodeEditorController

All Implemented Interfaces:
CodeMenuConstants, ContextMenuListener, Controller

public class CodeEditorController
extends java.lang.Object
implements Controller, CodeMenuConstants, ContextMenuListener

The CodeEditorController is the controller for the CodeEditor Addin. It takes care of managing commands that this CodeEditor supports (i.e., Cut, Copy, or Paste.)


Field Summary
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

 

Fields inherited from interface oracle.ide.controller.Controller
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGED

 

Fields inherited from interface oracle.ide.ceditor.CodeMenuConstants
CATEGORY_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

 

Method Summary
 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.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

EDIT_SELECTED_ONLY_CMD_ID

@Deprecated
public static final int EDIT_SELECTED_ONLY_CMD_ID
Deprecated. use CodeEditorConstants
The command id for the edit selected only action.

FORMAT_CMD_ID

@Deprecated
public static final int FORMAT_CMD_ID
Deprecated. use CodeEditorConstants
The command id for the format/reformat action.

CATEGORY_SOURCE_MENU

@Deprecated
public static final java.lang.String CATEGORY_SOURCE_MENU
Deprecated. use CodeEditorConstants
The category to which to add commands which appear in the Code/Source menu.

UNDO_WRAPPER_MSG

@Deprecated
public static final int UNDO_WRAPPER_MSG
Deprecated. use CodeEditorConstants
This is the message that the user had new typed input

Method Detail

getDefaultController

public static CodeEditorController getDefaultController()
Get the default singleton controller.
Returns:
the default controller

checkCommandsAfterNavigation

public void checkCommandsAfterNavigation(Context context)
Utility routine which is used to verify command sensitivity after a change in the caret position of the editor.
Parameters:
context - the current context

getCodeEditorFromContext

public static final CodeEditor getCodeEditorFromContext(Context context)
Utility routine to fetch the CodeEditor instance from the context. If a code editor (or gutter) is not the active view, then this will return null.
Parameters:
context - the current context
Returns:
the code editor instance, if any

getEditorPaneFromContext

public static final BasicEditorPane getEditorPaneFromContext(Context context)
Utility routine to fetch the BasicEditorPane instance from the context. If a code editor (or gutter) is not the active view, then this will return null.
Parameters:
context - the current context
Returns:
the editor pane, if any

update

public boolean update(IdeAction action,
                      Context context)
This method is called when the availability of a specific command needs to be determined. For example, it may be called when the user clicks on a menu, or perhaps to update the "enabled" state of toolbar actions. Call the action's setEnabled() method to set the appropriate command sensitivity.
Specified by:
update in interface Controller
Parameters:
action - the action associated with this command
context - the current context
Returns:
true if the controller handles the specified command.

handleEvent

public boolean handleEvent(IdeAction action,
                           Context context)
This method is called when a user interaction with a View triggers the execution of a command.
Specified by:
handleEvent in interface Controller
Parameters:
action - action whose command is to be executed.
Returns:
true if the controller handles the specified command.

menuWillShow

public void menuWillShow(ContextMenu popup)
Called just before the context menu is popping up.
Specified by:
menuWillShow in interface ContextMenuListener
Parameters:
popup - the current view context menu

menuWillHide

public void menuWillHide(ContextMenu popup)
Description copied from interface: ContextMenuListener
This method is called just before a showing context menu is dismissed. Most implementations should not do anything in this method. In particular, it is not necessary to clean out menu items or submenus that were added during ContextMenuListener.menuWillShow(oracle.ide.controller.ContextMenu), since the IDE takes care of that automatically.
Specified by:
menuWillHide in interface ContextMenuListener
Parameters:
popup - the context menu being hidden

handleDefaultAction

public boolean handleDefaultAction(Context context)
Called when the user double clicks on an item that has a popup menu. Only one listener should return true from this menu.
Specified by:
handleDefaultAction in interface ContextMenuListener
Parameters:
context - the current context

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.3.0)

E17493-04


Copyright © 1997, 2012, Oracle. All rights reserved.