Extension SDK 10.1.2

oracle.ide.editor
Class AbstractEditor

java.lang.Object
  extended byoracle.ide.addin.AbstractView
      extended byoracle.ide.editor.AbstractEditor
All Implemented Interfaces:
ControllerProvider, Editor, Helpable, LayoutSelector, Observer, View
Direct Known Subclasses:
AbstractFlatEditor

public abstract class AbstractEditor
extends AbstractView
implements Editor


Nested Class Summary
static class AbstractEditor.LayoutData
          Instances of this class keep the preferred layout URL and a flas indicating whether the layout has already been initialized.
 
Field Summary
protected  Context _context
           
protected  EditorFrame _editorFrame
           
protected static javax.swing.border.Border CUSTOM_BORDER
           
 
Fields inherited from class oracle.ide.addin.AbstractView
owner, SEPARATOR, viewListeners, viewSelectionListeners
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
AbstractEditor()
           
 
Method Summary
 void addPreferredLayoutListener(PreferredLayoutListener l)
          Add a PreferredLayoutListener.
 void close()
          Close the view
 void editorHidden()
          This method is called when an editor is hidden.
 void editorShown()
          This method is called when an editor is made visible.
 Context getContext()
          Gets the current view context.
 Context getContext(java.util.EventObject event)
          Get the current view context for the given EventObject.
 ContextMenu getContextMenu()
          Get the ContextMenu object, if any, managed by this View.
 Controller getController()
          Get the Controller associated with this view.
 java.awt.Component getDefaultFocusComponent()
          This method is used to know what component should get the focus by default.
 Document[] getDependentDocuments()
          Editors which access or manipulate more than one document must return these documents using this method.
 java.lang.String getDisplayName()
          Returns a visible name that describes the class implementing this interface.
protected  EditorFrame getEditorFrame()
          Deprecated. In flat editor mode, the meaning of the EditorFrame is quite different. Please contact me (cedric.dandoy@oracle.com) to see how to replace calls to this method.
 java.lang.String getPreferredLayoutBaseName()
          Returns the base name is used as the file name part when building the preferred layout URL.
static java.util.Map getPreferredLayoutMap()
          Returns a Map storing the preferred layout LayoutData.
 java.net.URL getPreferredLayoutURL()
          Implementations should override this method and return their preferred layout.
 java.lang.String getTabDescription()
          This method is called to get the tooltip to display in the tab hosting this editor.
 javax.swing.Icon getTabIcon()
          This method is called to get the icon to display in the tab hosting this editor.
 java.lang.String getTabLabel()
          This method is called to get the title to display in the tab hosting this editor.
 java.lang.String getTitleLabel()
          This method is called to get the title to display in the title bar of the EditorFrame hosting this editor.
 java.lang.String getType()
          Return a string that uniquely identifies this selector.
 void initializeActiveLayout()
          This method is called immediate after activating the selector's preferred layout.
 void initializeLayout(Layout layout)
          This method is called before to activate the selector's preferred layout.
 boolean isReady()
          This method is called before a preferred layout is activated.
protected  java.lang.String newId()
          Generates an unique view id.
protected  void onInitializeLayout(Layout layout)
           
protected  void onPreferredLayoutActivate()
          Classes that extend AbstractEditor override this method to initialize their preferred layout when that layour becomes the active layout.
 View owner()
          Get the owning View.
 void removePreferredLayoutListener(PreferredLayoutListener l)
          Remvoe a PreferredLayoutListener.
 void setContext(Context context)
          Sets the current editor context.
 void setOwner(EditorFrame frame)
          Sets the editor frame that owns this editor.
 void setPreferredLayoutBaseName(java.lang.String name)
          Set the base name is used as the file name part when building the preferred layout URL.
static void setPreferredLayoutMap(java.util.Map layoutMap)
          Sets a Map storing the preferred layout LayoutData.
 void setPreferredLayoutURL(java.net.URL layoutURL)
          This method is called from the activatePreferredLayout method to record a layout chosen by the user as their preferred layout.
 void setType(java.lang.String type)
          Set a string that uniquely identifies this selector.
 
Methods inherited from class oracle.ide.addin.AbstractView
activate, addViewListener, addViewSelectionListener, deactivate, fireViewActivated, fireViewClosed, fireViewDeactivated, fireViewSelectionChanged, getHelpInfo, getId, getSelection, getToolbar, isVisible, loadToolbar, loadToolbar, removeViewListener, removeViewSelectionListener, setId, setOwner, setToolbarVisible, show, updateTitle, updateToolbarActions, updateVisibleActions, updateVisibleActions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.editor.Editor
open
 
Methods inherited from interface oracle.ide.addin.Observer
update
 
Methods inherited from interface oracle.ide.addin.View
activate, addViewListener, addViewSelectionListener, deactivate, getGUI, getId, getSelection, getToolbar, isVisible, removeViewListener, removeViewSelectionListener, setToolbarVisible, show, updateTitle, updateVisibleActions
 
Methods inherited from interface oracle.ide.help.Helpable
getHelpInfo
 

Field Detail

CUSTOM_BORDER

protected static final javax.swing.border.Border CUSTOM_BORDER

_context

protected Context _context

_editorFrame

protected EditorFrame _editorFrame
Constructor Detail

AbstractEditor

public AbstractEditor()
Method Detail

getDefaultFocusComponent

public java.awt.Component getDefaultFocusComponent()
Description copied from interface: Editor
This method is used to know what component should get the focus by default. The returned component should be a child of the component returned by getGUI() or getGUI() itself and should be requestFocusable. By contract, getGUI() will always be called before getDefaultFocusComponent(). Note: This method has beem introduced because of the confusion about the View.activate() method. The activate() method tells the view that it became active but some classes used the method to actually request the focus. This resulted in the activate() method being called multiple times.

Specified by:
getDefaultFocusComponent in interface Editor
Returns:
the component that should take the focus

getController

public Controller getController()
Description copied from interface: ControllerProvider
Get the Controller associated with this view.

Specified by:
getController in interface ControllerProvider
Overrides:
getController in class AbstractView
Returns:
the Controller associated with this view.

owner

public View owner()
Description copied from interface: View
Get the owning View. In general, views should return the IdeMainWindow as their owner, but should return a different value if nested within another View.

Specified by:
owner in interface View
Overrides:
owner in class AbstractView
Returns:
the owner of this view.

getContext

public Context getContext()
Description copied from interface: View
Gets the current view context.

Specified by:
getContext in interface View
Overrides:
getContext in class AbstractView
Returns:
the current view context.

getContext

public Context getContext(java.util.EventObject event)
Description copied from interface: View
Get the current view context for the given EventObject.

Specified by:
getContext in interface View
Parameters:
event - event associated with the context;

getContextMenu

public ContextMenu getContextMenu()
Description copied from interface: View
Get the ContextMenu object, if any, managed by this View.

Specified by:
getContextMenu in interface View
Overrides:
getContextMenu in class AbstractView
Returns:
the ContextMenu, if any.

setOwner

public void setOwner(EditorFrame frame)
Sets the editor frame that owns this editor.

Specified by:
setOwner in interface Editor

getDependentDocuments

public Document[] getDependentDocuments()
Editors which access or manipulate more than one document must return these documents using this method. This allows the EditorManager to track document usage, so that it can close documents when they are no longer open in any editor.

Specified by:
getDependentDocuments in interface Editor

editorShown

public void editorShown()
Description copied from interface: Editor
This method is called when an editor is made visible. Then intent of this method is to let the editor know if it has to synchronize its content You should not do anything heavy in this method (like showing dockable windows) as the editorHidden()/editorShown could be called in sequence when the user creates a new tabgroup.

Specified by:
editorShown in interface Editor

editorHidden

public void editorHidden()
Description copied from interface: Editor
This method is called when an editor is hidden.

Specified by:
editorHidden in interface Editor
See Also:
Editor.editorShown()

setContext

public void setContext(Context context)
Description copied from interface: Editor
Sets the current editor context.

Specified by:
setContext in interface Editor

getTitleLabel

public java.lang.String getTitleLabel()
Description copied from interface: Editor
This method is called to get the title to display in the title bar of the EditorFrame hosting this editor.

Specified by:
getTitleLabel in interface Editor

getTabLabel

public java.lang.String getTabLabel()
Description copied from interface: Editor
This method is called to get the title to display in the tab hosting this editor.

Specified by:
getTabLabel in interface Editor

getTabIcon

public javax.swing.Icon getTabIcon()
Description copied from interface: Editor
This method is called to get the icon to display in the tab hosting this editor.

Specified by:
getTabIcon in interface Editor

getTabDescription

public java.lang.String getTabDescription()
Description copied from interface: Editor
This method is called to get the tooltip to display in the tab hosting this editor.

Specified by:
getTabDescription in interface Editor

close

public void close()
Description copied from interface: View
Close the view

Specified by:
close in interface View
Overrides:
close in class AbstractView

getPreferredLayoutMap

public static java.util.Map getPreferredLayoutMap()
Returns a Map storing the preferred layout LayoutData. These URLs are hashed using the String returned from calling the method getType().


setPreferredLayoutMap

public static void setPreferredLayoutMap(java.util.Map layoutMap)
Sets a Map storing the preferred layout LayoutData. These URLs are hashed using the String returned from calling the method getType().


getPreferredLayoutURL

public java.net.URL getPreferredLayoutURL()
Description copied from interface: LayoutSelector
Implementations should override this method and return their preferred layout. This method is called from the activatePreferredLayout method to determine if this selector has a preferred layout. Default implementation returns null indicating that the selector does not have a preferred layout.

Specified by:
getPreferredLayoutURL in interface LayoutSelector

setPreferredLayoutURL

public void setPreferredLayoutURL(java.net.URL layoutURL)
Description copied from interface: LayoutSelector
This method is called from the activatePreferredLayout method to record a layout chosen by the user as their preferred layout.

Specified by:
setPreferredLayoutURL in interface LayoutSelector

initializeLayout

public void initializeLayout(Layout layout)
Description copied from interface: LayoutSelector
This method is called before to activate the selector's preferred layout. This is the opportunity for the layout selector to set values that will distinct its layout from others.

Specified by:
initializeLayout in interface LayoutSelector

initializeActiveLayout

public void initializeActiveLayout()
Description copied from interface: LayoutSelector
This method is called immediate after activating the selector's preferred layout.

Specified by:
initializeActiveLayout in interface LayoutSelector

isReady

public boolean isReady()
Description copied from interface: LayoutSelector
This method is called before a preferred layout is activated. This method should return true only when the selector is visible and fully activated.

Specified by:
isReady in interface LayoutSelector

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: LayoutSelector
Returns a visible name that describes the class implementing this interface.

Specified by:
getDisplayName in interface LayoutSelector

getType

public java.lang.String getType()
Description copied from interface: LayoutSelector
Return a string that uniquely identifies this selector. Selectors of the same type use the same preferred layout.

Specified by:
getType in interface LayoutSelector

setType

public void setType(java.lang.String type)
Description copied from interface: LayoutSelector
Set a string that uniquely identifies this selector. Selectors of the same type use the same preferred layout.

Specified by:
setType in interface LayoutSelector

getPreferredLayoutBaseName

public java.lang.String getPreferredLayoutBaseName()
Description copied from interface: LayoutSelector
Returns the base name is used as the file name part when building the preferred layout URL.

Specified by:
getPreferredLayoutBaseName in interface LayoutSelector

setPreferredLayoutBaseName

public void setPreferredLayoutBaseName(java.lang.String name)
Description copied from interface: LayoutSelector
Set the base name is used as the file name part when building the preferred layout URL.

Specified by:
setPreferredLayoutBaseName in interface LayoutSelector

addPreferredLayoutListener

public void addPreferredLayoutListener(PreferredLayoutListener l)
Description copied from interface: LayoutSelector
Add a PreferredLayoutListener.

Specified by:
addPreferredLayoutListener in interface LayoutSelector

removePreferredLayoutListener

public void removePreferredLayoutListener(PreferredLayoutListener l)
Description copied from interface: LayoutSelector
Remvoe a PreferredLayoutListener.

Specified by:
removePreferredLayoutListener in interface LayoutSelector

onInitializeLayout

protected void onInitializeLayout(Layout layout)

onPreferredLayoutActivate

protected void onPreferredLayoutActivate()
Classes that extend AbstractEditor override this method to initialize their preferred layout when that layour becomes the active layout.


newId

protected java.lang.String newId()
Description copied from class: AbstractView
Generates an unique view id. The default view id is UnknownView. where is a unique integer value. Subclasses should override this method to return a more meaningful view id.

Overrides:
newId in class AbstractView

getEditorFrame

protected EditorFrame getEditorFrame()
Deprecated. In flat editor mode, the meaning of the EditorFrame is quite different. Please contact me (cedric.dandoy@oracle.com) to see how to replace calls to this method.


Extension SDK

 

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