Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.ide.ceditor
Class CodeEditorController

java.lang.Object
  extended by oracle.ide.ceditor.CodeEditorController
All Implemented Interfaces:
java.util.EventListener, CodeMenuConstants, ContextMenuListener, Controller, DynamicMenuListener

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

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
          The category to which to add commands which appear in the Code/Source menu.
static int EDIT_SELECTED_ONLY_CMD_ID
          The command id for the edit selected only action.
static int FORMAT_CMD_ID
          The command id for the format/reformat action.
static int UNDO_WRAPPER_CMD_ID
          Command ID for UndoWrapperCommand
static int UNDO_WRAPPER_MSG
          This is the message that the user had new typed input
 
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_WIDEN_IMPORTS
 
Method Summary
protected  void checkCommandsAfterNavigation(Context context)
          Utility routine which is used to verify command sensitivity after a change in the caret position of the editor.
 javax.swing.JComponent[] gatherDynamicActions(Context context)
          Called just before the dynamic menu is added to the main menu bar.
 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

UNDO_WRAPPER_CMD_ID

public static final int UNDO_WRAPPER_CMD_ID
Command ID for UndoWrapperCommand


EDIT_SELECTED_ONLY_CMD_ID

public static final int EDIT_SELECTED_ONLY_CMD_ID
The command id for the edit selected only action.


FORMAT_CMD_ID

public static final int FORMAT_CMD_ID
The command id for the format/reformat action.


CATEGORY_SOURCE_MENU

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


UNDO_WRAPPER_MSG

public static final int UNDO_WRAPPER_MSG
This is the message that the user had new typed input

Method Detail

checkCommandsAfterNavigation

protected 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

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

gatherDynamicActions

public javax.swing.JComponent[] gatherDynamicActions(Context context)
Called just before the dynamic menu is added to the main menu bar. Implementors should use the Context to determine whether or not to add commands to the menu. Implementors should add JMenuItem, JSeparator, or JMenu objects.

Specified by:
gatherDynamicActions in interface DynamicMenuListener
Parameters:
context - the current view context.
Returns:
a list of menu items to add to the dynamic menu. Should return an empty list if no commands should be active in the context.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

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