Extension SDK

oracle.ide.editor
Interface EditorManager

All Superinterfaces:
Controller

public interface EditorManager
extends Controller

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

See Also:
oracle.ide.Controller, Node, oracle.ide.addin.Editor

Method Summary
 void activateCurrentEditorFrame()
          Activates the top-most editor frame and editor within it.
 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. Replace with addAutoSyncOption(String, String, Icon, boolean)
 void addAutoSyncOption(java.lang.String editorClass, java.lang.String editorName, ArrayResourceBundle bundle, int key, boolean defaultValue)
          Calling this method adds an entry to the Editors panel in the IDE Settings dialog.
 void addAutoSyncOption(java.lang.String editorClass, java.lang.String editorName, javax.swing.Icon icon, boolean defaultValue)
          Calling this method adds an entry to the Editors panel in the IDE Settings dialog.
 void addEditorListener(EditorListener listener)
          Adds a registered listener as an EditorListener.
 void addLayoutListener(java.lang.String editorId, BaseLayoutListener listener)
          Add a LayoutListener for one of our child Editor instances
 void closeEditors(java.util.List listEditors)
          Close the editors contained in the list.
 void disable(Editor editor)
          Call this method to disable the specified editor.
 void extend(EditorAddin addin, java.lang.Class[] types)
          Associate the Element types supported given with the given EditorAddin.
 java.util.List findEditors(Context context)
           
 java.util.List getAllEditors()
          Returns a list of all open Editors.
 javax.swing.JInternalFrame[] getAllFrames()
          Returns an array of JInternalFrames.
 ContextMenu getContextMenu()
          Get the ContextMenu to be shared by all Editors.
 Editor getCurrentEditor()
          Returns the currently active editor.
 EditorFrame getCurrentEditorFrame()
          Returns the topmost editor frame.
 EditorAddin getDefaultAddin(Element element)
          Gets the default registered EditorAddin for the element.
 javax.swing.JDesktopPane getDesktopPane()
           
 EditorFrame getEditorFrame(Editor editor)
          Returns the frame containing the editor
 java.util.List getEditorsInfo()
           
 javax.swing.JMenu getMainSubmenu()
          Get the menu item for the "Open Viewer As" sub menu.
 javax.swing.JScrollPane getScrollPane()
           
 void initialize()
           
 boolean isAutoSyncOn(Editor editor)
          Returns the user setting indicating whether the specified editor should keep updating as data is modified by other editors.
 boolean isEditorRegistered(java.lang.Class cls)
          Determine whether an Editor implementation has been registered.
 boolean maySyncEditor(Editor editor)
          Returns whether or not the given editor must synchronize its display with the current state of the data it's presenting to the user.
 Editor openDefaultEditorInFrame(Context context)
          Opens the specified file (context) using the default registered editor class for this node type.
 Editor openDefaultEditorInFrame(Element element)
          Open the specified element using the default editor.
 Editor openDefaultEditorInFrame(Node node)
          Open the specified node using the default editor.
 Editor openDefaultEditorInFrame(java.net.URL url)
          Open the specified URL using the default editor.
 Editor openDefaultEditorInFrameExternal(java.net.URL url)
          Open the item at the specified URL in its default Editor, and add that item to the top-level 'Miscellaneous Files' folder.
 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.
 void register(EditorAddin addin, java.lang.Class[] types)
          Registers a EditorAddin for inclusion in a main menu bar group and the ContextMenu of the NavigatorWindow.
 void registerPreferredLayoutListener(java.lang.Class docClass, java.lang.Class editorClass, java.lang.String preferredLayoutBaseName, PreferredLayoutListener listener)
          Register a PreferredLayoutListener for the specified docClass.
 void removeEditorListener(EditorListener listener)
          Removes a registered listener as an EditorListener.
 void removeLayoutListener(java.lang.String editorId)
          Remove the LayoutListener for one of our child Editor instances
 void replaceEditors(Context oldContext, Context newContext)
           
 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.
 void setExplicit(Editor editor, boolean bExplicit)
          Set the editor as explicit or implicit.
 
Methods inherited from interface oracle.ide.addin.Controller
checkCommands, handleEvent, supervisor, update
 

Method Detail

register

public void register(EditorAddin addin,
                     java.lang.Class[] types)
Registers a EditorAddin for inclusion in a main menu bar group and the ContextMenu of the NavigatorWindow. Register a new EditorAddin as handling 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

extend

public 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 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 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 void addEditorListener(EditorListener listener)
Adds a registered listener as an EditorListener.

Parameters:
listener - the listener to register

removeEditorListener

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

Parameters:
listener - the listener to de-register

activateCurrentEditorFrame

public 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 Editor openDefaultEditorInFrameExternal(java.net.URL 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 Editor openDefaultEditorInFrame(Element element)
Open the specified element using the default editor.

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

openDefaultEditorInFrame

public Editor openDefaultEditorInFrame(Node node)
Open the specified node using the default editor.

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

openDefaultEditorInFrame

public Editor openDefaultEditorInFrame(Context context)
Opens the specified file (context) using the default registered editor class for this node type.

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

openEditorInFrame

public 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.

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 void replaceEditors(Context oldContext,
                           Context newContext)

findEditors

public java.util.List findEditors(Context context)

getAllEditors

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


getAllFrames

public javax.swing.JInternalFrame[] getAllFrames()
Returns an array of JInternalFrames.


getCurrentEditorFrame

public EditorFrame getCurrentEditorFrame()
Returns the topmost editor frame.


getCurrentEditor

public Editor getCurrentEditor()
Returns the currently active editor.


getEditorFrame

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


saveWelcomeEditor

public 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 void initialize()

addLayoutListener

public 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 void removeLayoutListener(java.lang.String editorId)
Remove the LayoutListener for one of our child Editor instances

Parameters:
editorId - the id of the editor

getScrollPane

public javax.swing.JScrollPane getScrollPane()

getDesktopPane

public javax.swing.JDesktopPane getDesktopPane()

getContextMenu

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


getMainSubmenu

public javax.swing.JMenu getMainSubmenu()
Get the menu item for the "Open Viewer As" sub menu.

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

closeEditors

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

Parameters:
listEditors - a List of EditorInfo

getEditorsInfo

public java.util.List getEditorsInfo()

activateEditor

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


setExplicit

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


registerPreferredLayoutListener

public 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 boolean isAutoSyncOn(Editor editor)
Returns the user setting indicating whether the specified editor should keep updating as data is modified by other editors.


maySyncEditor

public boolean maySyncEditor(Editor editor)
Returns whether or not the given editor must synchronize its display with the current state of the data it's presenting to the user. If the value returned is false, editors should tell the EditorManager to disable the editor thereby preventing user interaction with the editor until it has had a chance to respond to the updates.


addAutoSyncOption

public void addAutoSyncOption(java.lang.String editorClass,
                              java.lang.String editorName,
                              javax.swing.Icon icon,
                              boolean defaultValue)
Calling this method adds an entry to the Editors panel in the IDE Settings dialog.


addAutoSyncOption

public void addAutoSyncOption(java.lang.String editorClass,
                              java.lang.String editorName,
                              ArrayResourceBundle bundle,
                              int key,
                              boolean defaultValue)
Calling this method adds an entry to the Editors panel in the IDE Settings dialog.


addAutoSyncOption

public void addAutoSyncOption(java.lang.Class editorClass,
                              java.lang.String editorName,
                              javax.swing.Icon icon,
                              boolean defaultValue)
Deprecated. Replace with addAutoSyncOption(String, String, Icon, boolean)


disable

public void disable(Editor editor)
Call this method to disable the specified editor. When an editor allows user to turn off the "Auto Sync" option, that editor is also responsible for calling this method when it does not have the input focus. This method calls the isAutoSync method to determine if it should disable the given editor. The method returns true if it disabled the editor.


Extension SDK

 

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