Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


javax.ide.editor
Class Editor

java.lang.Object
  extended by javax.ide.view.DefaultViewable
      extended by javax.ide.view.View
          extended by javax.ide.editor.Editor

All Implemented Interfaces:
Identifiable, Viewable
Direct Known Subclasses:
TextEditor

public abstract class Editor
extends View

The Editor interface defines the methods to open and close editors, along with methods to save and restore editor specific settings.

Extensions that introduce new editor types need to implement this interface. A new editor is introduced by declaring it in the extension deployment descriptor (EDD) file. There, the editor implementation class is associated with a unique string identifying the editor type.


Field Summary

 

Fields inherited from interface javax.ide.view.Viewable
PROP_ICON_PATH, PROP_LABEL, PROP_VISIBLE

 

Constructor Summary
Editor()
           

 

Method Summary
abstract  void close()
          This method is called when the editor is closed by the user.
 Context getContext()
          Get the context for this editor.
 java.lang.String getLabel()
          Get a short descriptive label that can be shown to the user.
 void open(Context context)
          This method is called to open the editor.
abstract  void restore(java.util.prefs.Preferences preference)
          Restore the last known state of the editor.
abstract  void save(java.util.prefs.Preferences preference)
          Save the current state of the editor so that it can be restored when the editor is re-opened on the same document.

 

Methods inherited from class javax.ide.view.View
activate, deactivate, getController, getGUI, isVisible, parent, setVisible

 

Methods inherited from class javax.ide.view.DefaultViewable
addPropertyChangeListener, firePropertyChange, getIcon, getToolTip, removePropertyChangeListener, toString

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface javax.ide.Identifiable
getID

 

Constructor Detail

Editor

public Editor()

Method Detail

open

public void open(Context context)
This method is called to open the editor. This method is reponsible for creating the editor, intializing it with the Document specified by the context.

This method should only be called by the EditorManager. The editor manager needs to keep track of all editors opened.

This implementation stores the context for later retrieval via getContext().

Parameters:
context - The current context. The editor will be opened on the document specified in the context.

close

public abstract void close()
This method is called when the editor is closed by the user. This method is responsible for closing the editor.

This method should only be called by the EditorManager. The editor manager needs to keep track of all editors opened.


restore

public abstract void restore(java.util.prefs.Preferences preference)
Restore the last known state of the editor. This method is called by the EditorManager just before the editor is opened.

This method should only be called by the EditorManager.

Parameters:
preference - Preferences saved when this editor was last closed. These preferences are used for restoring the last know state of the editor. Extensions are responsible for identifying the preference sub-node associated with this editor.

save

public abstract void save(java.util.prefs.Preferences preference)
Save the current state of the editor so that it can be restored when the editor is re-opened on the same document. This method is called by the EditorManager when an editor is about to be closed, or when the EditorManager is shutting down.

This method should only be called by the EditorManager.

Parameters:
preference - Preferences saved when this editor was last closed. These preferences are used for restoring the last know state of the editor. Extensions are responsible for identifying the preference sub-node associated with this editor.

getLabel

public java.lang.String getLabel()
Description copied from class: DefaultViewable
Get a short descriptive label that can be shown to the user.
Specified by:
getLabel in interface Viewable
Overrides:
getLabel in class DefaultViewable
Returns:
A short descriptive label.

getContext

public Context getContext()
Get the context for this editor. This implementation returns the context passed to the open() method.
Specified by:
getContext in class View
Returns:
the current context.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


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