Extension SDK 10.1.2

oracle.ide.editor
Class EditorManager

java.lang.Object
  extended byoracle.ide.editor.EditorManager
All Implemented Interfaces:
Controller, Module

public abstract class EditorManager
extends java.lang.Object
implements Controller, Module

The EditorManager serves as the registry for Editors that want to register themselves with specific Node types.

See Also:
Controller, Node, Editor

Constructor Summary
EditorManager()
           
 
Method Summary
abstract  void activateCurrentEditorFrame()
          Activates the top-most editor frame and editor within it.
abstract  void activateEditor(EditorInfo editorInfo)
          Activates the editor corresponding to the editorInfo.
 void addAutoSyncOption(java.lang.Class editorClass, java.lang.String editorName, javax.swing.Icon icon, boolean defaultValue)
          Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)
 void addAutoSyncOption(java.lang.String editorClass, java.lang.String editorName, ArrayResourceBundle bundle, int key, boolean defaultValue)
          Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)
 void addAutoSyncOption(java.lang.String editorClass, java.lang.String editorName, javax.swing.Icon icon, boolean defaultValue)
          Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)
abstract  void addEditorListener(EditorListener listener)
          Adds a registered listener as an EditorListener.
abstract  void addLayoutListener(java.lang.String editorId, BaseLayoutListener listener)
          Add a LayoutListener for one of our child Editor instances
abstract  void closeEditors(java.util.List listEditors)
          Close the editors contained in the list.
 void disable(Editor editor)
          Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)
abstract  void extend(EditorAddin addin, java.lang.Class[] types)
          Associate the Element types supported given with the given EditorAddin.
abstract  java.util.List findEditors(Context context)
           
abstract  java.util.List getAllEditors()
          Returns a list of all open Editor.
 javax.swing.JInternalFrame[] getAllFrames()
          Deprecated. Editor windowing is no longer based on Swing
abstract  ContextMenu getContextMenu()
          Get the ContextMenu to be shared by all Editors.
abstract  Editor getCurrentEditor()
          Returns the currently active editor.
abstract  EditorFrame getCurrentEditorFrame()
          Returns the topmost editor frame.
abstract  EditorAddin getDefaultAddin(Element element)
          Gets the default registered EditorAddin for the element.
abstract  javax.swing.JComponent getDesktopComponent()
           
 javax.swing.JDesktopPane getDesktopPane()
          Deprecated. Editor windowing is no longer based on Swing.
abstract  EditorFrame getEditorFrame(Editor editor)
          Returns the frame containing the editor
static EditorManager getEditorManager()
          Returns the EditorManager instance that is active in the IDE.
abstract  java.util.List getEditorsInfo()
           
 javax.swing.JMenu getMainSubmenu()
          Deprecated. This menu no longer exists because the editors are now available in tabs
 javax.swing.JScrollPane getScrollPane()
          Deprecated. Editor windowing is no longer based on Swing
abstract  void initialize()
          When the application starts up, each module is given the opportunity to perform initialization tasks.
 boolean isAutoSyncOn(Editor editor)
          Deprecated. autoSync no longer needs to be configurable by the user. Editor must implement editorHidden and editorShown to know if they need to refresh the UI.
abstract  boolean isEditorRegistered(java.lang.Class cls)
          Determine whether an Editor implementation has been registered.
abstract  boolean isFlatEditor()
          This temporary method returns true if we are running with the new editor manager mode
 boolean maySyncEditor(Editor editor)
          Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)
abstract  Editor openDefaultEditorInFrame(Context context)
          Opens the specified file (context) using the default registered editor class for this node type.
 Editor openDefaultEditorInFrame(Element element)
          Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(Element)
 Editor openDefaultEditorInFrame(Node node)
          Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(Node)
 Editor openDefaultEditorInFrame(java.net.URL url)
          Open the specified URL using the default editor.
 Editor openDefaultEditorInFrameExternal(java.net.URL url)
          Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(URL)
abstract  Editor openEditorInFrame(java.lang.Class editorClass, Context context)
          Opens the specified file (context) using the specified editor class (editorClass.) The new editor frame will be opened in the active editor tabbed frame (if one exists.) If there is no active editor desktop, or editor tabbed frame, one will be created automatically.
abstract  void register(EditorAddin addin, java.lang.Class[] types)
          Registers a EditorAddin for inclusion the editor tabs for the given Document types.
abstract  void registerDynamic(FlatEditorAddin flatEditorAddin)
          Registers a FlatEditorAddin for possible inclusion the editor tabs.
abstract  void registerPreferredLayoutListener(java.lang.Class docClass, java.lang.Class editorClass, java.lang.String preferredLayoutBaseName, PreferredLayoutListener listener)
          Register a PreferredLayoutListener for the specified docClass.
abstract  void removeEditorListener(EditorListener listener)
          Removes a registered listener as an EditorListener.
abstract  void removeLayoutListener(java.lang.String editorId)
          Remove the LayoutListener for one of our child Editor instances
abstract  void replaceEditors(Context oldContext, Context newContext)
           
abstract  void saveWelcomeEditor(java.net.URL url, java.lang.String editorClass, Layout layout)
          This method is called when JDeveloper is starting up to determine if a welcome editor should be displayed the first time JDeveloper is run after installation.
static void setEditorManager(EditorManager editorManager)
          Publishes the specified EditorManager as the active instance in the IDE.
abstract  void setExplicit(Editor editor, boolean bExplicit)
          Set the editor as explicit or implicit.
abstract  void unregister(EditorAddin editorAddin)
          Removes the specified editorAddin from the list on known EditorAddins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.addin.Controller
handleEvent, update
 

Constructor Detail

EditorManager

public EditorManager()
Method Detail

getEditorManager

public static EditorManager getEditorManager()
Returns the EditorManager instance that is active in the IDE.


setEditorManager

public static void setEditorManager(EditorManager editorManager)
Publishes the specified EditorManager as the active instance in the IDE.


register

public abstract void register(EditorAddin addin,
                              java.lang.Class[] types)
Registers a EditorAddin for inclusion the editor tabs for the given Document types. The types array should contain the Class objects for each known Document type supported by the Editor represented by the EditorAddin being registered. If multiple Document types all extend a common class, only the Class object for that common class need be included in the Class array as retrievals will be attempted all the way up a given Document's inheritance path until a match can be found or the search fails.

Parameters:
addin - the EditorAddin to register
types - the Document classes supported by the addin being registered

registerDynamic

public abstract void registerDynamic(FlatEditorAddin flatEditorAddin)
Registers a FlatEditorAddin for possible inclusion the editor tabs. When a FlatEditorAddin is registered with this method, every time a Document is open, FlatEditorAddin.getEditorWeight(oracle.ide.model.Element) is called to determine if and where the editor tab must be placed.

An addin can be registered both statically and dynamically. In that case, the dynamic addins will be queried only if they were not registered for the document type.

Parameters:
flatEditorAddin - the FlatEditorAddin to register

unregister

public abstract void unregister(EditorAddin editorAddin)
Removes the specified editorAddin from the list on known EditorAddins. Removing an addin does not affect the already open editors.

Parameters:
editorAddin -

extend

public abstract void extend(EditorAddin addin,
                            java.lang.Class[] types)
Associate the Element types supported given with the given EditorAddin.

Parameters:
addin - The EditorAddin to which the extension has been associated.
types - The Element types being associated with addin.

isEditorRegistered

public abstract boolean isEditorRegistered(java.lang.Class cls)
Determine whether an Editor implementation has been registered.

Parameters:
cls - The Editor class upon which the query is being applied.

getDefaultAddin

public abstract EditorAddin getDefaultAddin(Element element)
Gets the default registered EditorAddin for the element. In general, the default is the last one registered as being default, else the first one registered for that Element type.

Parameters:
element - the element for which a default is desired.
Returns:
the default EditorAddin for the given Element.

addEditorListener

public abstract void addEditorListener(EditorListener listener)
Adds a registered listener as an EditorListener.

Parameters:
listener - the listener to register

removeEditorListener

public abstract void removeEditorListener(EditorListener listener)
Removes a registered listener as an EditorListener.

Parameters:
listener - the listener to de-register

activateCurrentEditorFrame

public abstract void activateCurrentEditorFrame()
Activates the top-most editor frame and editor within it. It is up to the editor to do what it needs to in order to request focus - for example, the code editor calls requestFocus() on activate().


openDefaultEditorInFrameExternal

public final Editor openDefaultEditorInFrameExternal(java.net.URL url)
Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(URL)

Open the item at the specified URL in its default Editor, and add that item to the top-level 'Miscellaneous Files' folder.

This method is primarily used by the editor frame and desktop drag-and-drop code to handle files dropped from the O/S into the editor desktop area.

Parameters:
url - the URL of the item to open.
Returns:
the Editor instance that was opened, or null if the operation failed.

openDefaultEditorInFrame

public Editor openDefaultEditorInFrame(java.net.URL url)
Open the specified URL using the default editor. This will create a node for the file, and from that node, we can figure out what kind of editor we can open. This lets the NodeFactory take care of recognizing the file type.

Parameters:
url - the URL of the file to open
Returns:
the Editor instance that was opened

openDefaultEditorInFrame

public final Editor openDefaultEditorInFrame(Element element)
Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(Element)

Open the specified element using the default editor.

Parameters:
element - the Element to open
Returns:
the Editor instance that was opened

openDefaultEditorInFrame

public final Editor openDefaultEditorInFrame(Node node)
Deprecated. replaced by EditorUtil.openDefaultEditorInFrame(Node)

Open the specified node using the default editor.

Parameters:
node - the node to open
Returns:
the Editor instance that was opened

openDefaultEditorInFrame

public abstract Editor openDefaultEditorInFrame(Context context)
Opens the specified file (context) using the default registered editor class for this node type. If the file is already open in another editor, this will just activate the current editor.

Parameters:
context - the context describing the node to open
Returns:
the opened Editor instance
See Also:
openEditorInFrame( Class, Context )

openEditorInFrame

public abstract Editor openEditorInFrame(java.lang.Class editorClass,
                                         Context context)
Opens the specified file (context) using the specified editor class (editorClass.) The new editor frame will be opened in the active editor tabbed frame (if one exists.) If there is no active editor desktop, or editor tabbed frame, one will be created automatically. If the editorClass does not correspond to any of the editorAddins declared for that context, the default editor will be used.

Parameters:
editorClass - the editor class to use for opening the node
context - the context describing the node to oen
Returns:
the Editor that was opened

replaceEditors

public abstract void replaceEditors(Context oldContext,
                                    Context newContext)

findEditors

public abstract java.util.List findEditors(Context context)

getAllEditors

public abstract java.util.List getAllEditors()
Returns a list of all open Editor.


getAllFrames

public final javax.swing.JInternalFrame[] getAllFrames()
Deprecated. Editor windowing is no longer based on Swing

Returns an array of JInternalFrames.


getScrollPane

public final javax.swing.JScrollPane getScrollPane()
Deprecated. Editor windowing is no longer based on Swing


getDesktopPane

public final javax.swing.JDesktopPane getDesktopPane()
Deprecated. Editor windowing is no longer based on Swing.

See Also:
getDesktopComponent()

getDesktopComponent

public abstract javax.swing.JComponent getDesktopComponent()
Returns:
the top level JComponent that makes the editor windowing desktop

getCurrentEditorFrame

public abstract EditorFrame getCurrentEditorFrame()
Returns the topmost editor frame.


getCurrentEditor

public abstract Editor getCurrentEditor()
Returns the currently active editor.


getEditorFrame

public abstract EditorFrame getEditorFrame(Editor editor)
Returns the frame containing the editor


saveWelcomeEditor

public abstract void saveWelcomeEditor(java.net.URL url,
                                       java.lang.String editorClass,
                                       Layout layout)
This method is called when JDeveloper is starting up to determine if a welcome editor should be displayed the first time JDeveloper is run after installation. It determines if a the specified url and specified editorClass information should be saved in the given layout. When the information is saved, the document pointed by the url will be opened in the specified type of editor when the layout is activated.


initialize

public abstract void initialize()
Description copied from interface: Module
When the application starts up, each module is given the opportunity to perform initialization tasks.

Specified by:
initialize in interface Module

addLayoutListener

public abstract void addLayoutListener(java.lang.String editorId,
                                       BaseLayoutListener listener)
Add a LayoutListener for one of our child Editor instances

Parameters:
editorId - the id of the editor
listener - the LayoutListener instance

removeLayoutListener

public abstract void removeLayoutListener(java.lang.String editorId)
Remove the LayoutListener for one of our child Editor instances

Parameters:
editorId - the id of the editor

getContextMenu

public abstract ContextMenu getContextMenu()
Get the ContextMenu to be shared by all Editors.


getMainSubmenu

public final javax.swing.JMenu getMainSubmenu()
Deprecated. This menu no longer exists because the editors are now available in tabs

Get the menu item for the "Open Viewer As" sub menu.

Returns:
the "Open Viewer As..." menu item for the main menus

closeEditors

public abstract void closeEditors(java.util.List listEditors)
Close the editors contained in the list.

Parameters:
listEditors - a List of EditorInfo

getEditorsInfo

public abstract java.util.List getEditorsInfo()
Returns:
a List of EditorInfo.

activateEditor

public abstract void activateEditor(EditorInfo editorInfo)
Activates the editor corresponding to the editorInfo.


setExplicit

public abstract void setExplicit(Editor editor,
                                 boolean bExplicit)
Set the editor as explicit or implicit.

Note that the explicit/implicit behavior changed. The user now explicitely assigns accelerators to a document and the "Close Implicit" command changed to only close the files that have no accelerator. This method will probably be deprecated soon.


registerPreferredLayoutListener

public abstract void registerPreferredLayoutListener(java.lang.Class docClass,
                                                     java.lang.Class editorClass,
                                                     java.lang.String preferredLayoutBaseName,
                                                     PreferredLayoutListener listener)
Register a PreferredLayoutListener for the specified docClass. When an editor belonging to a given editorClass opens a document of type docClass the listener will be called. The listener is responsible for initializing the preferred layout. The preferredLayoutBaseName will be used as the name of the layout.


isAutoSyncOn

public final boolean isAutoSyncOn(Editor editor)
Deprecated. autoSync no longer needs to be configurable by the user. Editor must implement editorHidden and editorShown to know if they need to refresh the UI.


maySyncEditor

public final boolean maySyncEditor(Editor editor)
Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)


addAutoSyncOption

public final void addAutoSyncOption(java.lang.String editorClass,
                                    java.lang.String editorName,
                                    javax.swing.Icon icon,
                                    boolean defaultValue)
Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)


addAutoSyncOption

public final void addAutoSyncOption(java.lang.String editorClass,
                                    java.lang.String editorName,
                                    ArrayResourceBundle bundle,
                                    int key,
                                    boolean defaultValue)
Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)


addAutoSyncOption

public final void addAutoSyncOption(java.lang.Class editorClass,
                                    java.lang.String editorName,
                                    javax.swing.Icon icon,
                                    boolean defaultValue)
Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)


disable

public final void disable(Editor editor)
Deprecated. see isAutoSyncOn(oracle.ide.editor.Editor)


isFlatEditor

public abstract boolean isFlatEditor()
This temporary method returns true if we are running with the new editor manager mode


Extension SDK

 

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