public abstract class EditorManager extends java.lang.Object implements Controller, Addin
| Modifier and Type | Field and Description | 
|---|---|
static int | 
SHOW_DROPDOWN_CMD_ID
The show dropdown command. 
 | 
UPDATE_FROM_ACTION_PERFORMED, UPDATE_FROM_ACTIVE_VIEW_CHANGED, UPDATE_FROM_UNDO, UPDATE_FROM_USER_EXTENSION, UPDATE_FROM_VIEW_SELECTION_CHANGED| Constructor and Description | 
|---|
EditorManager()  | 
| Modifier and Type | Method and Description | 
|---|---|
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. 
 | 
boolean | 
activateEditorHasComponent(java.awt.Component comp)
Activates an editor which contains given component. 
 | 
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 | 
cancelRequestAttention(Editor editor)
Cause the editor's (document's) tab to stop flashing if it was flashing. 
 | 
abstract void | 
closeEditors(java.util.List listEditors)
Close the editors contained in the list. 
 | 
abstract void | 
extend(EditorAddin addin, java.lang.Class[] types)
Associate the Element types supported given with the given EditorAddin. 
 | 
abstract Editor | 
findEditor(EditorPath path)
Returns editor for given EditorPath  
Editor. | 
abstract java.util.List<Editor> | 
findEditors(Context context)  | 
abstract java.util.List<Editor> | 
getAllEditors()
Returns a list of all open  
Editor. | 
abstract EditorAddin | 
getBestEditorAddin(Context context)  | 
abstract EditorAddin | 
getBestEditorAddin(Node node)
Retrieves the best EditorAddin based on the default editor preference for the Node, or by querying the editor addin registry. 
 | 
abstract ContextMenu | 
getContextMenu()
Get the ContextMenu to be shared by all Editors. 
 | 
abstract Editor | 
getCurrentEditor()
Returns the currently active editor. 
 | 
abstract EditorAddin | 
getDefaultAddin(Context context)  | 
abstract EditorAddin | 
getDefaultAddin(Element element)
Gets the default registered EditorAddin for the element. 
 | 
abstract javax.swing.JComponent | 
getDesktopComponent()  | 
abstract EditorAddin | 
getEditorAddin(java.lang.Class cls)
Get the EditorAddin instance which represents the Editor type provided. 
 | 
static EditorManager | 
getEditorManager()
Returns the EditorManager instance that is active in the IDE. 
 | 
abstract java.util.List<EditorInfo> | 
getEditorsInfo()  | 
abstract EditorAddin[] | 
getStaticAddins(java.lang.Class elementClass)
Deprecated. 
 
replaced by  
getStaticAddins(String). | 
abstract EditorAddin[] | 
getStaticAddins(java.lang.String elementClassName)
Gets all the statically registered EditorAddins which are associated with the given Element class. 
 | 
abstract java.lang.String[] | 
getStaticElementClassNames()
Gets all the Element types which are associated with statically registered EditorAddins, excluding inherited EditorAddin associations. 
 | 
abstract java.lang.Class[] | 
getStaticElementTypes()
Deprecated. 
 
replaced by  
getStaticElementClassNames(). | 
boolean | 
hasEditors(Context context)
Returns true if there are any registered editors for the specified context. 
 | 
boolean | 
hasEditors(Element element)
Deprecated.  
 | 
abstract void | 
initialize()
Invoked by the  
AddinManager after the instance of the Addin is instantiated. | 
abstract boolean | 
isEditorRegistered(java.lang.Class cls)
Determine whether an Editor implementation has been registered. 
 | 
abstract void | 
makeBusy(Editor editor, boolean busy)
Notify the user that some (possibly lengthy) process is being run in this editor. 
 | 
abstract Editor | 
openDefaultEditorInFrame(Context context)
The new  
openEditor(oracle.ide.editor.OpenEditorOptions) is now the preferred way to open an editor. | 
Editor | 
openDefaultEditorInFrame(java.net.URL url)
Open the specified  
URL using the default editor. | 
abstract Editor | 
openEditor(OpenEditorOptions openEditorOptions)
Opens an editor. 
 | 
abstract Editor | 
openEditorInFrame(java.lang.Class editorClass, Context context)
The new  
openEditor(oracle.ide.editor.OpenEditorOptions) is now the preferred way to open an editor. | 
abstract void | 
register(EditorAddin addin, java.lang.Class[] types)
Registers a  
EditorAddin for inclusion the editor tabs for the given Node types. | 
abstract void | 
registerDynamic(EditorAddin editorAddin)
Registers a  
EditorAddin for possible inclusion the editor tabs. | 
abstract void | 
registerPreferredLayoutListener(java.lang.Class nodeClass, java.lang.Class editorClass, java.lang.String preferredLayoutBaseName, PreferredLayoutListener listener)
Register a  
PreferredLayoutListener for the specified nodeClass. | 
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 | 
requestAttention(Editor editor, boolean brief)
Cause the Editor's (document's) tab to flash or otherwise draw attention to itself. 
 | 
abstract EditorPath | 
searchEditor(Node node)  | 
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. 
 | 
abstract void | 
unregisterDynamic(EditorAddin editorAddin)
Removes the specificed editor addin from the list of dynamically registered addins. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleEvent, updatepublic static final int SHOW_DROPDOWN_CMD_ID
public static EditorManager getEditorManager()
public static void setEditorManager(EditorManager editorManager)
public abstract void register(EditorAddin addin, java.lang.Class[] types)
EditorAddin for inclusion the editor tabs for the given Node types. The types array should contain the Class objects for each known Node type supported by the Editor represented by the EditorAddin being registered. If multiple Node 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 Node's inheritance path until a match can be found or the search fails.addin - the EditorAddin to registertypes - the Node classes supported by the addin being registeredpublic abstract void unregister(EditorAddin editorAddin)
editorAddin -public abstract void registerDynamic(EditorAddin editorAddin)
EditorAddin for possible inclusion the editor tabs. When a FlatEditorAddin is registered with this method, every time a Node is open, EditorAddin.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 Node type.
editorAddin - the EditorAddin to registerpublic abstract void unregisterDynamic(EditorAddin editorAddin)
editorAddin -public abstract void extend(EditorAddin addin, java.lang.Class[] types)
addin - The EditorAddin to which the extension has been associated.types - The Element types being associated with addin.public abstract boolean isEditorRegistered(java.lang.Class cls)
cls - The Editor class upon which the query is being applied.public abstract EditorAddin getEditorAddin(java.lang.Class cls)
cls - the Editor class for which an EditorAddin is desired.public abstract EditorAddin getBestEditorAddin(Node node)
node - the current Nodepublic abstract EditorAddin getBestEditorAddin(Context context)
public abstract EditorAddin getDefaultAddin(Element element)
element - the element for which a default is desired.public abstract EditorAddin getDefaultAddin(Context context)
@Deprecated public abstract EditorAddin[] getStaticAddins(java.lang.Class elementClass)
getStaticAddins(String).elementClass - the class of the Element.public abstract EditorAddin[] getStaticAddins(java.lang.String elementClassName)
elementClassName - the classname of the Element. Note that the given classname is used to identify the element type and will never be used to load or instantiate this class.@Deprecated public abstract java.lang.Class[] getStaticElementTypes()
getStaticElementClassNames().public abstract java.lang.String[] getStaticElementClassNames()
public abstract void addEditorListener(EditorListener listener)
listener - the listener to registerpublic abstract void removeEditorListener(EditorListener listener)
listener - the listener to de-registerpublic abstract void activateCurrentEditorFrame()
public Editor openDefaultEditorInFrame(java.net.URL url)
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.url - the URL of the file to openEditor instance that was openedpublic abstract Editor openDefaultEditorInFrame(Context context)
openEditor(oracle.ide.editor.OpenEditorOptions) is now the preferred way to open an editor. Replace
Editor editor = editorManager.openDefaultEditorInFrame(ctx);with
Editor editor = editorManager.openEditor(new OpenEditorOptions(ctx));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.
context - the context describing the node to openopenEditorInFrame( Class, Context )public abstract Editor openEditorInFrame(java.lang.Class editorClass, Context context)
openEditor(oracle.ide.editor.OpenEditorOptions) is now the preferred way to open an editor. Replace
Editor editor = editorManager.openEditorInFrame(cls, ctx);with
Editor editor = editorManager.openEditor(new OpenEditorOptions(ctx, cls));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.
editorClass - the editor class to use for opening the nodecontext - the context describing the node to oenpublic abstract Editor openEditor(OpenEditorOptions openEditorOptions)
openDefaultEditorInFrame(java.net.URL) and #openEditorInFrame(java.lang.Class, oracle.ide.addin.Context) variants which will eventually be deprecatedopenEditorOptions -public abstract Editor findEditor(EditorPath path)
Editor.path -public abstract java.util.List<Editor> getAllEditors()
Editor.public abstract javax.swing.JComponent getDesktopComponent()
public abstract Editor getCurrentEditor()
public abstract void requestAttention(Editor editor, boolean brief)
It will remain flashing until either cancelRequestAttention is called, the component becomes selected or its activated state changes, unless the brief argument is true, in which case it will stop after a few second. It is NOT safe to call this method off the EDT.
editor -brief - True if the tab should blink a few times and stoppublic abstract void cancelRequestAttention(Editor editor)
editor -public abstract void makeBusy(Editor editor, boolean busy)
editor -busy - 'true' - to start 'busy' notification, 'false' to stop it.public abstract void initialize()
AddinAddinManager after the instance of the Addin is instantiated. When invoked, The Addin should register and menu items, and actions required for use during this classes lifecycle. Addin authors should take care to ensure that any extraneous initialization is not preformed on this method, and any startup code that can be delayed until a later time is delayed, as the Addin's are synchronously initialized during the startup of the IDE, and each Addin has the potential to negatively impact the startup time of the product.initialize in interface AddinAddinManager
public abstract void addLayoutListener(java.lang.String editorId,
                     BaseLayoutListener listener)
LayoutListener for one of our child Editor instanceseditorId - the id of the editorlistener - the LayoutListener instancepublic abstract void removeLayoutListener(java.lang.String editorId)
LayoutListener for one of our child Editor instanceseditorId - the id of the editorpublic abstract ContextMenu getContextMenu()
public abstract void closeEditors(java.util.List listEditors)
listEditors - a List of Editor or EditorInfo.public abstract java.util.List<EditorInfo> getEditorsInfo()
EditorInfo.public abstract void activateEditor(EditorInfo editorInfo)
public abstract void setExplicit(Editor editor, boolean bExplicit)
Note that the explicit/implicit behavior changed. The user now explicitely assigns accelerators to a Node and the "Close Implicit" command changed to only close the files that have no accelerator. This method will probably be deprecated soon.
public abstract void registerPreferredLayoutListener(java.lang.Class nodeClass,
                                   java.lang.Class editorClass,
                                   java.lang.String preferredLayoutBaseName,
                                   PreferredLayoutListener listener)
PreferredLayoutListener for the specified nodeClass. When an editor belonging to a given editorClass opens a Node of type nodeClass 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.public abstract EditorPath searchEditor(Node node)
@Deprecated public boolean hasEditors(Element element)
element - an element. Must not be null.public boolean hasEditors(Context context)
context - Must not be null.public boolean activateEditorHasComponent(java.awt.Component comp)
comp - component