Extension SDK

oracle.ide.addin
Class AbstractView

java.lang.Object
  extended byoracle.ide.addin.AbstractView
All Implemented Interfaces:
Helpable, Subview, View
Direct Known Subclasses:
AbstractEditor, AbstractExplorer, AbstractLogPage, DockableWindow

public abstract class AbstractView
extends java.lang.Object
implements View

AbstractView provides a default implementation for most methods defined in the View interface.

See Also:
View

Field Summary
protected  View owner
           
static java.lang.String SEPARATOR
           
protected  java.util.Vector viewListeners
           
protected  java.util.Vector viewSelectionListeners
           
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
protected AbstractView()
           
protected AbstractView(java.lang.String viewId)
           
protected AbstractView(java.lang.String viewId, View owner)
           
 
Method Summary
 void activate()
          This method is responsible for responding to the fact that this View is now the active view (e.g.
 void addViewListener(ViewListener l)
          Add a ViewListener.
 void addViewSelectionListener(ViewSelectionListener l)
          Add a ViewSelectionListener.
 void close()
          Closes the view
 void deactivate()
          This method is responsible for cleaning up after this view stops being the active view.
protected  void fireViewActivated(ViewEvent e)
           
protected  void fireViewClosed(ViewEvent e)
           
protected  void fireViewDeactivated(ViewEvent e)
           
protected  void fireViewSelectionChanged(ViewSelectionEvent e)
           
 Context getContext()
          Gets the current view context.
 ContextMenu getContextMenu()
          Gets the ContextMenu object, if any, managed by this instance.
 Controller getController()
          Gets the Controller associated with this view.
 HelpInfo getHelpInfo()
           
 java.lang.String getId()
          Unique id identifying this view.
 Element[] getSelection()
          Gets the selection context.
 Toolbar getToolbar()
          Returns the toolbar associated with this view.
 boolean isVisible()
          Returns true if the subview is visible.
static void loadToolbar(PropertyAccess properties, Toolbar toolbar, java.lang.String tbCountProp, java.lang.String tbItemProp, View view)
          Creates toolbar buttons for the specified toolbar.
static void loadToolbar(Toolbar toolbar, java.lang.String tbCountProp, java.lang.String tbItemProp, View view)
          Creates toolbar buttons for the specified toolbar.
protected  java.lang.String newId()
          Generates an unique view id.
 View owner()
          Views can be nested.
 void removeViewListener(ViewListener l)
          Remove a ViewListener.
 void removeViewSelectionListener(ViewSelectionListener l)
          Remmove a ViewSelectionListener.
protected  void setId(java.lang.String id)
           
protected  void setOwner(View owner)
           
 void show()
          Shows the view if hidden.
 void updateTitle(java.lang.Object object)
          Called when the view needs to update its title based on the specified object.
 
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.View
getContext
 
Methods inherited from interface oracle.ide.addin.Subview
getGUI
 

Field Detail

SEPARATOR

public static final java.lang.String SEPARATOR
See Also:
Constant Field Values

owner

protected View owner

viewListeners

protected transient java.util.Vector viewListeners

viewSelectionListeners

protected transient java.util.Vector viewSelectionListeners
Constructor Detail

AbstractView

protected AbstractView(java.lang.String viewId,
                       View owner)

AbstractView

protected AbstractView(java.lang.String viewId)

AbstractView

protected AbstractView()
Method Detail

owner

public View owner()
Views can be nested. In general, views should return the IdeMainWindow as their owner.

Specified by:
owner in interface Subview
Returns:
the owner of this view.

getController

public Controller getController()
Gets the Controller associated with this view.

Specified by:
getController in interface Subview
Returns:
the Controller associated with this view.

show

public void show()
Shows the view if hidden. Raises the view to the top if covered by other windows.

Specified by:
show in interface Subview

isVisible

public boolean isVisible()
Description copied from interface: Subview
Returns true if the subview is visible.

Specified by:
isVisible in interface Subview

activate

public void activate()
This method is responsible for responding to the fact that this View is now the active view (e.g. adding/removing toolbars etc.).

Specified by:
activate in interface View

deactivate

public void deactivate()
This method is responsible for cleaning up after this view stops being the active view.

Specified by:
deactivate in interface View

close

public void close()
Closes the view

Specified by:
close in interface Subview

getContext

public Context getContext()
Gets the current view context.

Specified by:
getContext in interface Subview
Returns:
the current view context.

getSelection

public Element[] getSelection()
Gets the selection context. Within a view multiple objects can be selected. This method returns a list of selected objects.

Specified by:
getSelection in interface View
Returns:
list of selected items in the view.

getId

public java.lang.String getId()
Unique id identifying this view. In general, the id is made up of the name of the view and the element name loaded in the view. For example, a navigator window may have the following id: NavigatorWindow.Project1 where Project1 is the name component of the project node. Subclasses should override this method. This implementation returns null.

Specified by:
getId in interface View

setId

protected void setId(java.lang.String id)

newId

protected java.lang.String newId()
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.


updateTitle

public void updateTitle(java.lang.Object object)
Called when the view needs to update its title based on the specified object.

Specified by:
updateTitle in interface View

getToolbar

public Toolbar getToolbar()
Returns the toolbar associated with this view.

Specified by:
getToolbar in interface View

addViewListener

public void addViewListener(ViewListener l)
Add a ViewListener.

Specified by:
addViewListener in interface View
Parameters:
l - the ViewListener to add.

removeViewListener

public void removeViewListener(ViewListener l)
Remove a ViewListener.

Specified by:
removeViewListener in interface View
Parameters:
l - the ViewListener to remove.

addViewSelectionListener

public void addViewSelectionListener(ViewSelectionListener l)
Add a ViewSelectionListener.

Specified by:
addViewSelectionListener in interface View
Parameters:
l - the ViewSelectionListener to add.

removeViewSelectionListener

public void removeViewSelectionListener(ViewSelectionListener l)
Remmove a ViewSelectionListener.

Specified by:
removeViewSelectionListener in interface View
Parameters:
l - the ViewSelectionListener to remove.

getContextMenu

public ContextMenu getContextMenu()
Gets the ContextMenu object, if any, managed by this instance.

Specified by:
getContextMenu in interface Subview

loadToolbar

public static void loadToolbar(PropertyAccess properties,
                               Toolbar toolbar,
                               java.lang.String tbCountProp,
                               java.lang.String tbItemProp,
                               View view)
Creates toolbar buttons for the specified toolbar. The properties parameter specifies the properties file where the toolbar is defined. The tbCountProp specifies the property name identifying the number of buttons in the toolbar. The tbItemProp specifies the property name listing the command associated with a button. If the view is specified, this indicates that the toolbar is owned by that view and that all actions created should only work with that view's context.


loadToolbar

public static void loadToolbar(Toolbar toolbar,
                               java.lang.String tbCountProp,
                               java.lang.String tbItemProp,
                               View view)
Creates toolbar buttons for the specified toolbar. The tbCountProp specifies the property name identifying the number of buttons in the toolbar. The tbItemProp specifies the property name listing the command associated with a button. If the view is specified, this indicates that the toolbar is owned by that view and that all actions created should only work with that view's context.


getHelpInfo

public HelpInfo getHelpInfo()
Specified by:
getHelpInfo in interface Helpable

setOwner

protected void setOwner(View owner)

fireViewSelectionChanged

protected void fireViewSelectionChanged(ViewSelectionEvent e)

fireViewActivated

protected void fireViewActivated(ViewEvent e)

fireViewDeactivated

protected void fireViewDeactivated(ViewEvent e)

fireViewClosed

protected void fireViewClosed(ViewEvent e)

Extension SDK

 

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