Extension SDK 10.1.2

oracle.ide.addin
Class AbstractView

java.lang.Object
  extended byoracle.ide.addin.AbstractView
All Implemented Interfaces:
ControllerProvider, Helpable, 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()
          Determine whether the View 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 setToolbarVisible(boolean visible)
          Set the visibility of any toolbar associated with this view.
 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.
static void updateToolbarActions(Toolbar toolbar)
           
 void updateVisibleActions()
           
 void updateVisibleActions(UpdateInfo updateInfo)
          Called when the IDE or an extension requests that the View update the enabled state of any actions that are visible on screen.
 
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, 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 View
Returns:
the owner of this view.

getController

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

Specified by:
getController in interface ControllerProvider
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 View

isVisible

public boolean isVisible()
Description copied from interface: View
Determine whether the View is visible.

Specified by:
isVisible in interface View

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

updateVisibleActions

public final void updateVisibleActions()

updateVisibleActions

public void updateVisibleActions(UpdateInfo updateInfo)
Description copied from interface: View
Called when the IDE or an extension requests that the View update the enabled state of any actions that are visible on screen. Typically this will involve updating actions that are in visible toolbars. If a View contains or manages other nested instances of View, the outer call to updateVisibleActions should propagate inward to call the updateVisibleActions of all visible, nested Views.

Specified by:
updateVisibleActions in interface View
Parameters:
updateInfo - This parameter provides information on what is triggering the update. Implementations may make use of this information to decide whether or not an update is necessary, since updating the enabled state of a toolbar button may be a lengthy operation. For example, buttons that control a remote debugger would involve network I/O and evaluating their updated state could be avoided if the updateInfo indicates that the source of the update is not relevant to the debugger.

updateToolbarActions

public static void updateToolbarActions(Toolbar toolbar)

close

public void close()
Closes the view

Specified by:
close in interface View

getContext

public Context getContext()
Gets the current view context.

Specified by:
getContext in interface View
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

setToolbarVisible

public void setToolbarVisible(boolean visible)
Set the visibility of any toolbar associated with this view.

Specified by:
setToolbarVisible in interface View
Parameters:
visible - true to display the Toolbar, false to hide the Toolbar

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 View
Returns:
the ContextMenu, if any.

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, 2004, Oracle. All rights reserved.