Extension SDK

oracle.ide
Class Ide

java.lang.Object
  extended byoracle.ide.Ide
All Implemented Interfaces:
ActiveViewListener, Controller, java.util.EventListener, IdeConstants, ViewSelectionListener

public final class Ide
extends java.lang.Object
implements Controller, IdeConstants, ActiveViewListener, ViewSelectionListener

Each View has an associated Controller. Controllers receive requests to handle the commands associated with user actions.

The Ide controller is associated with the MainWindow. This controller handles system commands such as exit, save, new, etc..

The controller's handleEvent method gets called with the appropriate Command specified. If the Controller does not handle the requested command it delegates the Command to a supervising Controller.

Controllers are also responsible for determining the availability of a specific command. The update method is called to do just that.

See Also:
Command, IdeAction, MainWindow

Field Summary
static java.lang.String IDE_PROPERTIES_FILE
          ide properties file: ide.properties.
static java.lang.String INSTALL_PATH
          Ide property for the path of the running installation.
 
Fields inherited from interface oracle.ide.IdeConstants
ACTIVE_PROJECT_CHANGED, BROWSE_SYMBOL_CMD, BROWSE_SYMBOL_CMD_ID, CLOSE_ALL_CMD, CLOSE_ALL_CMD_ID, CLOSE_EDITOR_CMD, CLOSE_EDITOR_CMD_ID, CLOSE_NODE_CMD, CLOSE_NODE_CMD_ID, COLLAPSE_ALL_CMD_ID, CONTEXT_MENU_CMD, CONTEXT_MENU_CMD_ID, COPY_CMD, COPY_CMD_ID, CUT_CMD, CUT_CMD_ID, DEFAULT_PROJECT_SETTINGS_CMD, DEFAULT_PROJECT_SETTINGS_CMD_ID, DELETE_CMD_ID, EXIT_CMD, EXIT_CMD_ID, EXPAND_ALL_CMD_ID, EXPLORER_CMD, EXPLORER_CMD_ID, FIND_CMD, FIND_CMD_ID, GOTO_LINE_NUMBER_CMD, GOTO_LINE_NUMBER_CMD_ID, IDE_SETTINGS_CMD, IDE_SETTINGS_CMD_ID, IDE_VERSION, INCREMENTAL_SEARCH_BACKWARD_CMD, INCREMENTAL_SEARCH_BACKWARD_CMD_ID, INCREMENTAL_SEARCH_FORWARD_CMD, INCREMENTAL_SEARCH_FORWARD_CMD_ID, INSPECTOR_CMD, INSPECTOR_CMD_ID, LAST_PREDEFINED_CMD, LOG_WINDOW_CMD, LOG_WINDOW_CMD_ID, NAVIGATE_CMD, NAVIGATE_CMD_ID, NEW_CLASS_CMD, NEW_CLASS_CMD_ID, NEW_EMPTY_PROJECT_CMD, NEW_EMPTY_PROJECT_CMD_ID, NEW_NAVIGATOR_CMD, NEW_NAVIGATOR_CMD_ID, NEW_PROJECT_CMD, NEW_PROJECT_CMD_ID, NEW_WORKSPACE_CMD, NEW_WORKSPACE_CMD_ID, NEXT_EDITOR_CMD, NEXT_EDITOR_CMD_ID, NEXT_EDITORFRAME_CMD, NEXT_EDITORFRAME_CMD_ID, NEXTMSG_CMD, NEXTMSG_CMD_ID, OPEN_CMD, OPEN_CMD_ID, PASTE_CMD, PASTE_CMD_ID, PREV_EDITOR_CMD, PREV_EDITOR_CMD_ID, PREV_EDITORFRAME_CMD, PREV_EDITORFRAME_CMD_ID, PREVMSG_CMD, PREVMSG_CMD_ID, PRINT_CMD, PRINT_CMD_ID, PRINTER_SETUP_CMD, PRINTER_SETUP_CMD_ID, PROJECT_SETTINGS_CMD, PROJECT_SETTINGS_CMD_ID, PROPERTIES_CMD_ID, PROPERTY_SET_CMD_ID, REDO_CMD, REDO_CMD_ID, REFRESH_CMD_ID, REMOVE_FILE_CMD, REMOVE_FILE_CMD_ID, REMOVE_FROM_DISK_CMD, REMOVE_FROM_DISK_CMD_ID, RENAME_CMD, RENAME_CMD_ID, REOPEN_CMD, REOPEN_CMD_ID, REPLACE_CMD, REPLACE_CMD_ID, REVERT_CMD, REVERT_CMD_ID, SAVE_ALL_CMD, SAVE_ALL_CMD_ID, SAVE_AS_CMD, SAVE_AS_CMD_ID, SAVE_CMD, SAVE_CMD_ID, SEARCH_AGAIN_CMD, SEARCH_AGAIN_CMD_ID, SEARCH_BACKWARD_CMD, SEARCH_BACKWARD_CMD_ID, SEARCH_SOURCE_PATH_CMD, SEARCH_SOURCE_PATH_CMD_ID, SELECT_ALL_CMD, SELECT_ALL_CMD_ID, STRUCTURE_CHANGE_CMD_ID, SYSTEM_CMD, SYSTEM_CMD_ID, TOOLBAR_CMD, TOOLBAR_CMD_ID, UNDO_CMD, UNDO_CMD_ID, WINDOW_CASCADE_CMD, WINDOW_CASCADE_CMD_ID, WINDOW_TILE_HORZ_CMD, WINDOW_TILE_HORZ_CMD_ID, WINDOW_TILE_VERT_CMD, WINDOW_TILE_VERT_CMD_ID, WINDOWS_DOT_DOT_DOT_CMD, WINDOWS_DOT_DOT_DOT_CMD_ID
 
Method Summary
static void activateProjectInWorkspace(Project project, Workspace wsp, Observer origin)
           
 void activeViewChanged(ActiveViewEvent e)
          This method is called every time a view becomes the active view.
static void addContextSensitiveAction(IdeAction action)
          Adding a context sensitive action allows the Ide to update the sensitivity of actions that are that have a controller associated with them.
static void addIdeListener(IdeListener l)
          Adds a listener to the IDE.
static void addRootController(Controller controller)
           
static boolean addToMiscellaneousFolder(Element element)
          Adds an Element object to the MiscellaneousFolder.
 void checkCommands(Context context, Controller activeController)
          checkCommands() should be called on the controller associated with the active view whenever the Context changes.
static java.lang.String cmdName(int cmdId)
          Find the command name associated with the specified id.
static void fireActiveProjectChanged(Project project, Workspace workspace, Observer origin)
           
static IdeLayout getActiveLayout()
           
static Project getActiveProject()
          Returns the currently active Project.
static Workspace getActiveWorkspace()
          Returns the currently active Workspace.
static AddinManager getAddinManager()
          Gets the AddinManager instance.
static java.lang.String getBinDirectory()
          Retrieve the directory the IDE was started from.
static oracle.ide.webbrowser.BrowserRunner getBrowserRunner()
          Gets the WebBrowser Runner
static ClassSelectionDialog getClassSelectionDialog()
           
static int getCmdID(java.lang.String commandName)
           
static CommandProcessor getCommandProcessor()
          Gets the CommandProcessor.
static Compiler getCompiler()
          Gets the compiler instance.
static Debugger getDebugger()
          Gets the debugger instance.
static Project getDefaultProject()
          Gets the default project node
static Workspace getDefaultWorkspace()
           
static DockStation getDockStation()
          Gets the docking DockStation.
static DTCache getDTCache()
           
static EditorManager getEditorManager()
          Gets the EditorManager instance.
static EnvironOptions getEnvironOptions()
           
static ExplorerManager getExplorerManager()
          Gets the ExplorerManager instance.
static FeatureManager getFeatures()
           
static FileOpenHistory getFileOpenHistory()
          Gets the opened file history tracker
static oracle.ide.gallery.GalleryManager getGalleryManager()
          Gets the gallery manager
static HelpSystem getHelpSystem()
          Gets the HelpSystem instance.
static java.lang.String getHomeDirectory()
          Retrieve the IDE install directory.
static javax.swing.ActionMap getIdeActionMap()
          Returns an ActionMap for the IDE's accelerator keys.
static javax.swing.InputMap getIdeInputMap()
          Returns an InputMap for the IDE's accelerator keys.
static IdeProperties getIdeProperties()
           
static java.lang.String getIdePropertiesFilename()
           
static InspectorManager getInspectorManager()
          Gets the InspectorManager instance.
static Ide getInstance()
          The Ide controller is a singleton class.
static KeyStrokeContextRegistry getKeyStrokeContextRegistry()
           
static Layouts getLayouts()
           
static java.lang.String getLibDirectory()
          Retrieve the IDE lib directory.
static LogManager getLogManager()
          Gets the LogManager instance.
static LogWindow getLogWindow()
          Gets the LogWindow instance.
static java.util.Map getMacros()
          Gets the default Map of the macros in use by the IDE.
static MainWindow getMainWindow()
          Gets the MainWindow instance.
static Menubar getMenubar()
          Gets the menubar.
static oracle.ide.migration.MigrationManager getMigrationManager()
          Gets the MigrationMananger instance.
static MiscellaneousFolder getMiscellaneousFolder()
          Gets the miscellaneous files folder.
static NavigatorManager getNavigatorManager()
          Gets the NavigatorManager instance.
static java.lang.String getOracleHomeDirectory()
          Returns the Oracle products install directory.
static PaletteManager getPaletteManager()
          Gets the PaletteManager instance.
static Preferences getPreferences()
          Gets the user's preferences.
static PrintManager getPrintManager()
          Gets the PrintManager instance.
static java.lang.String getProductVersion()
          Gets the current product version number.
static java.lang.String getProgramName()
          Return JDeveloper's full program name.
static java.lang.String getProperty(java.lang.String key)
          Gets the IDE property indicated by the specified key.
static java.lang.String getProperty(java.lang.String key, java.lang.String def)
          Gets the IDE property indicated by the specified key.
static java.util.Iterator getRootControllers()
          Controllers that are not subordinate to the ide controller should be registered as root controllers.
static Runner getRunner()
          Gets the runner instance.
static java.lang.SecurityManager getSecurityManager()
          Gets the SecurityManager
static IdeSettings getSettings()
           
static StatusBar getStatusBar()
          Gets the StatusBar instance.
static IdeSystem getSystem()
          Gets the user's system.
static java.lang.String getSystemDirectory()
           
static Toolbar getToolbar()
          Gets the Toolbar.
static java.lang.String getTrueUserHomeDirectory()
          Get the user's actual home directory, represented by the "user.home" system property.
static java.lang.String getUserHomeDirectory()
          Get the directory where the user specific files will reside.
static float getVersion()
          Gets the current ide version number.
static ComponentVersionManager getVersionInfo()
           
static oracle.ide.versionsystem.VersionSystem getVersionSystem()
          Gets the IDE's version system implementation.
static WaitCursor getWaitCursor()
           
static oracle.ide.window.WindowManager getWindowManager()
          Gets the WindowManager instance.
static WizardManager getWizardManager()
          Returns the reference to the WizardManager instance.
static java.lang.String getWorkDirectory()
           
static Workspaces getWorkspaces()
          Gets the workspaces.
 boolean handleEvent(IdeAction action, Context context)
          Called to handle the specified command.
static boolean isQuitting()
          Returns true when JDeveloper is quitting.
static boolean isStarting()
          Returns true when JDeveloper is starting up Returns false all other times.
static HistoryList loadHistoryList(java.lang.String name)
           
static int newCmd(java.lang.String commandName)
           
static int newSysCmd(java.lang.String commandName)
           
static void preTerminate()
          Called when closing the MainWindow.
static int quit(IdeAction action, Context context)
           
static void removeIdeListener(IdeListener l)
          Removes a listener to the IDE.
static void removeRootController(Controller controller)
           
static java.lang.Integer searchCmdID(java.lang.String commandName)
           
static void setActiveProject(Project project)
           
static void setActiveWorkspace(Workspace workspace)
           
static void setBrowserRunner(oracle.ide.webbrowser.BrowserRunner browserRunner)
           
static void setCompiler(Compiler compiler)
           
static void setDebugger(Debugger debugger)
           
static void setFeatures(FeatureManager features)
           
static void setHelpSystem(HelpSystem helpSys)
           
static java.lang.String setProperty(java.lang.String key, java.lang.String value)
          Sets the IDE property indicated by the specified key.
static void setRunner(Runner runner)
           
static void setVersionSystem(oracle.ide.versionsystem.VersionSystem system)
          Sets the IDE's version system implementation.
static void startup(IdeArgs args)
           
 Controller supervisor()
          Gets the supervising controller.
static void terminate()
          Called when the MainWindow is closed.
 boolean update(IdeAction action, Context context)
          This method updates the enabled status of the specified action within the specified context.
 void viewSelectionChanged(ViewSelectionEvent e)
          This method is called every time the selection changes in a view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTALL_PATH

public static final java.lang.String INSTALL_PATH
Ide property for the path of the running installation.

See Also:
Constant Field Values

IDE_PROPERTIES_FILE

public static final java.lang.String IDE_PROPERTIES_FILE
ide properties file: ide.properties.

See Also:
Constant Field Values
Method Detail

getFeatures

public static final FeatureManager getFeatures()

setFeatures

public static final void setFeatures(FeatureManager features)

getInstance

public static final Ide getInstance()
The Ide controller is a singleton class. This method gets this controller's single instance.

Returns:
the Ide controller single instance.

getVersion

public static final float getVersion()
Gets the current ide version number.


getProductVersion

public static final java.lang.String getProductVersion()
Gets the current product version number.


getBinDirectory

public static final java.lang.String getBinDirectory()
Retrieve the directory the IDE was started from.

Returns:
the directory the IDE was started from (for example, C:\Oracle\JDeveloper50\bin\).

getHomeDirectory

public static final java.lang.String getHomeDirectory()
Retrieve the IDE install directory. The directory path will include a trailing path separator.

Returns:
the full pathname of the root directory where JDeveloper is installed. (for example, C:\Oracle\JDeveloper50\, or /opt/JDeveloper50/)

getOracleHomeDirectory

public static final java.lang.String getOracleHomeDirectory()
Returns the Oracle products install directory. This is the parent directory of JDeveloper's home directory.


getLibDirectory

public static final java.lang.String getLibDirectory()
Retrieve the IDE lib directory. The directory path will include a trailing path separator.

Returns:
the full pathname of the root directory where JDeveloper is installed. (for example, C:\Oracle\JDeveloper50\lib\, or /opt/JDeveloper50/lib/)

getUserHomeDirectory

public static final java.lang.String getUserHomeDirectory()
Get the directory where the user specific files will reside. This is mainly the system, and mywork directories.

Returns:
The full pathname to the user specific jdeveloper home.

getTrueUserHomeDirectory

public static final java.lang.String getTrueUserHomeDirectory()
Get the user's actual home directory, represented by the "user.home" system property. If the user.home property is not set, then this method returns the same value as getUserHomeDirectory().

Returns:
The full pathname to the user's home directory.

getSystemDirectory

public static final java.lang.String getSystemDirectory()
Returns:
the full pathname of the 'System' directory which is the root directory for all system property files.

getWorkDirectory

public static final java.lang.String getWorkDirectory()
Returns:
the full pathname of the 'MyWork' directory which is the root directory for all source files built by user projects.

getProgramName

public static final java.lang.String getProgramName()
Return JDeveloper's full program name.


getProperty

public static final java.lang.String getProperty(java.lang.String key)
Gets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
Returns:
the string value of the IDE property, or null if there is no property with that key.
See Also:
setProperty(java.lang.String, java.lang.String)

getProperty

public static final java.lang.String getProperty(java.lang.String key,
                                                 java.lang.String def)
Gets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
def - a default value.
Returns:
the string value of the IDE property, or the default value if there is no property with that key.
See Also:
setProperty(java.lang.String, java.lang.String)

setProperty

public static final java.lang.String setProperty(java.lang.String key,
                                                 java.lang.String value)
Sets the IDE property indicated by the specified key.

Parameters:
key - the name of the IDE property.
value - the value of the IDE property.
Returns:
the previous value of the IDE property, or null if it did not have one.
See Also:
getProperty(java.lang.String)

getIdePropertiesFilename

public static final java.lang.String getIdePropertiesFilename()

getMenubar

public static final Menubar getMenubar()
Gets the menubar. The menubar is a singleton object used to add menus to the ide main window.

Returns:
the menu bar.

getWaitCursor

public static final WaitCursor getWaitCursor()

getIdeProperties

public static final IdeProperties getIdeProperties()

loadHistoryList

public static final HistoryList loadHistoryList(java.lang.String name)

getLayouts

public static final Layouts getLayouts()

getActiveLayout

public static final IdeLayout getActiveLayout()

getToolbar

public static final Toolbar getToolbar()
Gets the Toolbar. The toolbar is a singleton object used to add tools to the ide main window toolbar.

Returns:
the toolbar.

getStatusBar

public static final StatusBar getStatusBar()
Gets the StatusBar instance.


getMainWindow

public static final MainWindow getMainWindow()
Gets the MainWindow instance.


getLogWindow

public static final LogWindow getLogWindow()
Gets the LogWindow instance.

Returns:
the log window.

getRunner

public static final Runner getRunner()
Gets the runner instance.

Returns:
the runner.

setRunner

public static final void setRunner(Runner runner)

getDebugger

public static final Debugger getDebugger()
Gets the debugger instance.

Returns:
the debugger.

setDebugger

public static final void setDebugger(Debugger debugger)

getBrowserRunner

public static final oracle.ide.webbrowser.BrowserRunner getBrowserRunner()
Gets the WebBrowser Runner

Returns:
the WebBrowser Runner.

setBrowserRunner

public static final void setBrowserRunner(oracle.ide.webbrowser.BrowserRunner browserRunner)

getCompiler

public static final Compiler getCompiler()
Gets the compiler instance.

Returns:
the compiler.

setCompiler

public static final void setCompiler(Compiler compiler)

getHelpSystem

public static final HelpSystem getHelpSystem()
Gets the HelpSystem instance.

Returns:
the HelpSystem.

setHelpSystem

public static final void setHelpSystem(HelpSystem helpSys)

getVersionInfo

public static final ComponentVersionManager getVersionInfo()

getKeyStrokeContextRegistry

public static final KeyStrokeContextRegistry getKeyStrokeContextRegistry()

getSettings

public static final IdeSettings getSettings()

getEnvironOptions

public static final EnvironOptions getEnvironOptions()

getDTCache

public static final DTCache getDTCache()

getCommandProcessor

public static final CommandProcessor getCommandProcessor()
Gets the CommandProcessor. Controllers use the command processor to execute commands.

Returns:
the command processor.

getSystem

public static final IdeSystem getSystem()
Gets the user's system. The workspace contains all the users work, settings,giving him access to the database and repositories.

Returns:
the user's system.

getPreferences

public static final Preferences getPreferences()
Gets the user's preferences. The preferences contains the ide preference settings.

Returns:
the user's preferences.

getWorkspaces

public static final Workspaces getWorkspaces()
Gets the workspaces.

Returns:
the user's workspaces.

getActiveWorkspace

public static final Workspace getActiveWorkspace()
Returns the currently active Workspace. If there is no currently active Workspace, this method will return null.


setActiveWorkspace

public static final void setActiveWorkspace(Workspace workspace)

getActiveProject

public static final Project getActiveProject()
Returns the currently active Project. If there is no currently active Project, this method will return null.


setActiveProject

public static final void setActiveProject(Project project)

getDefaultProject

public static final Project getDefaultProject()
Gets the default project node

Returns:
the default project node

getDefaultWorkspace

public static final Workspace getDefaultWorkspace()

getMiscellaneousFolder

public static final MiscellaneousFolder getMiscellaneousFolder()
Gets the miscellaneous files folder. Creates it if folder is not yet available.

Returns:
the miscellaneous files folder

addToMiscellaneousFolder

public static final boolean addToMiscellaneousFolder(Element element)
Adds an Element object to the MiscellaneousFolder. Does the bookkeeping necessary to determine whether the miscellaneous folder needs to be displayed and fires the required update notifications.


getFileOpenHistory

public static final FileOpenHistory getFileOpenHistory()
Gets the opened file history tracker


getWizardManager

public static final WizardManager getWizardManager()
Returns the reference to the WizardManager instance. The WizardManager is in charge of registering and handling all Wizard's in the Oracle IDE.

Returns:
the IDE's WizardManager.

See Also:
Wizard

getAddinManager

public static final AddinManager getAddinManager()
Gets the AddinManager instance.


getMigrationManager

public static final oracle.ide.migration.MigrationManager getMigrationManager()
Gets the MigrationMananger instance. The lifespan of the MigrationManager is limited to the startup process. The MigrationManager instance is disposed of immediately after the IdeEvent.IDE_ADDINS_LOADED event is sent.


getRootControllers

public static final java.util.Iterator getRootControllers()
Controllers that are not subordinate to the ide controller should be registered as root controllers. The ide will delegate commands it does not understand to these controllers. Never add an ide subordinate controller here because it will probably cause an infinite recursive loop.


addRootController

public static final void addRootController(Controller controller)

removeRootController

public static final void removeRootController(Controller controller)

addIdeListener

public static final void addIdeListener(IdeListener l)
Adds a listener to the IDE.

See Also:
IdeListener

removeIdeListener

public static final void removeIdeListener(IdeListener l)
Removes a listener to the IDE.

See Also:
IdeListener

setVersionSystem

public static final void setVersionSystem(oracle.ide.versionsystem.VersionSystem system)
Sets the IDE's version system implementation.

Parameters:
system - the version system, interface to the version manager.

getVersionSystem

public static final oracle.ide.versionsystem.VersionSystem getVersionSystem()
Gets the IDE's version system implementation.

Returns:
the version system, interface to the version manager.

getEditorManager

public static final EditorManager getEditorManager()
Gets the EditorManager instance.


getPaletteManager

public static final PaletteManager getPaletteManager()
Gets the PaletteManager instance.


getWindowManager

public static final oracle.ide.window.WindowManager getWindowManager()
Gets the WindowManager instance.


getExplorerManager

public static final ExplorerManager getExplorerManager()
Gets the ExplorerManager instance.


getInspectorManager

public static final InspectorManager getInspectorManager()
Gets the InspectorManager instance.


getNavigatorManager

public static final NavigatorManager getNavigatorManager()
Gets the NavigatorManager instance.


getLogManager

public static final LogManager getLogManager()
Gets the LogManager instance.


getPrintManager

public static final PrintManager getPrintManager()
Gets the PrintManager instance.

Returns:
the printmanager.

getDockStation

public static final DockStation getDockStation()
Gets the docking DockStation.


getGalleryManager

public static final oracle.ide.gallery.GalleryManager getGalleryManager()
Gets the gallery manager


getSecurityManager

public static final java.lang.SecurityManager getSecurityManager()
Gets the SecurityManager


getIdeInputMap

public static final javax.swing.InputMap getIdeInputMap()
Returns an InputMap for the IDE's accelerator keys. If this method is called before the main window is created it throws an exception.


getIdeActionMap

public static final javax.swing.ActionMap getIdeActionMap()
Returns an ActionMap for the IDE's accelerator keys. If this method is called before the main window is created it returns any action map.


isQuitting

public static final boolean isQuitting()
Returns true when JDeveloper is quitting.


isStarting

public static final boolean isStarting()
Returns true when JDeveloper is starting up Returns false all other times.


getClassSelectionDialog

public static final ClassSelectionDialog getClassSelectionDialog()
Returns:
the Class Selection Dialog.

addContextSensitiveAction

public static final void addContextSensitiveAction(IdeAction action)
Adding a context sensitive action allows the Ide to update the sensitivity of actions that are that have a controller associated with them.


searchCmdID

public static final java.lang.Integer searchCmdID(java.lang.String commandName)

newCmd

public static final int newCmd(java.lang.String commandName)

newSysCmd

public static final int newSysCmd(java.lang.String commandName)
Returns:
a command id used to identify a system command. System commands are recorded in a hashtable because they can be overriden by specifying a different command class in the addins.properties file.

cmdName

public static final java.lang.String cmdName(int cmdId)
Find the command name associated with the specified id.


getCmdID

public static final int getCmdID(java.lang.String commandName)

getMacros

public static final java.util.Map getMacros()
Gets the default Map of the macros in use by the IDE.

Returns:
Map of IDE macros

startup

public static final void startup(IdeArgs args)

activateProjectInWorkspace

public static final void activateProjectInWorkspace(Project project,
                                                    Workspace wsp,
                                                    Observer origin)

fireActiveProjectChanged

public static final void fireActiveProjectChanged(Project project,
                                                  Workspace workspace,
                                                  Observer origin)

quit

public static final int quit(IdeAction action,
                             Context context)

preTerminate

public static final void preTerminate()
Called when closing the MainWindow.


terminate

public static final void terminate()
Called when the MainWindow is closed.


supervisor

public final Controller supervisor()
Gets the supervising controller. Since the IDE controller is the top most supervising controller this method returns null.

Specified by:
supervisor in interface Controller
Returns:
the supervising controller.

update

public boolean update(IdeAction action,
                      Context context)
This method updates the enabled status of the specified action within the specified context. It should generally be called on the controller associated with the active view to allow that controller to take the first crack at determining its enabled status. If that controller wants to update its enabled status, it does so and returns true to indicate that further controllers do not need to be consulted. If the controller does not deal with setting the enabled status of an action, it delegates the request to its supervising controller, all the way up to the Ide. The Ide has a special implementation of update(xx) that further delegates the request to root controllers, until one of them returns true indicating the request was handled by the controller.

Note that checkCommands() uses a non-overlapping upwards delegation model to update the enabled status of all actions, whereas update() provides a 'virtual-like' mechanism for allowing the most-specific controllers to determine the enabled status of each action being checked.

Specified by:
update in interface Controller
Parameters:
action - action whose command is to be executed.
context - the current context

Returns:
true if the controller handles the specified command.

handleEvent

public final boolean handleEvent(IdeAction action,
                                 Context context)
Called to handle the specified command. Only actions handled by this controller are dealt with. This is indicated by returning true from this method. If the controller's does not recognize the action, it must forward the call to a supervising controller if one exists, or return false.

Controllers must use the CommandProcessor to execute all commands. Doing so takes care of the Undo/Redo functionality.

Specified by:
handleEvent in interface Controller
Parameters:
action - action whose command is to be executed.

Returns:
true if this controller handled the action.

checkCommands

public void checkCommands(Context context,
                          Controller activeController)
checkCommands() should be called on the controller associated with the active view whenever the Context changes. The method gives the controller a chance to assign the enabled/disabled status of each of the context-sensitive Actions it owns. Calling this method on the active controller should cause all context-sensitive Actions owned by this controller and its supervisor's to be updated. No two controllers should attempt to update the status of the same action or else we would have redundant checking, which we want to avoid. checkCommands() should end by calling supervisor().checkCommands() to make sure actions dealt with by higher-level controllers get updated as well. This method is implemented by BaseController to call checkCommands() on the Ide itself.

Note that the only context-sensitive Actions should be updated inside a checkCommands() method.

Updating the enabled/disabled state of an action is handled by the update() command.

Specified by:
checkCommands in interface Controller
Parameters:
context - the current context. Null values are acceptable.
activeController - the controller associated with the active view. Null values are acceptable.

activeViewChanged

public void activeViewChanged(ActiveViewEvent e)
Description copied from interface: ActiveViewListener
This method is called every time a view becomes the active view. The ActiveViewEvent will have information about the view that is becoming active and the view that became inactive.

Specified by:
activeViewChanged in interface ActiveViewListener

viewSelectionChanged

public void viewSelectionChanged(ViewSelectionEvent e)
Description copied from interface: ViewSelectionListener
This method is called every time the selection changes in a view. The ViewSelectionEvent object has detailed information of the objects selected in the view.

Specified by:
viewSelectionChanged in interface ViewSelectionListener

Extension SDK

 

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