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

E13403-05

oracle.ide.view
Class View

java.lang.Object
  extended by oracle.ide.view.View
All Implemented Interfaces:
ControllerProvider, Helpable
Direct Known Subclasses:
AbstractLogPage, CodeEditorGutter.GutterView, Editor, Explorer, ViewDecorator

public abstract class View
extends java.lang.Object
implements ControllerProvider, Helpable

View components display information to the user. A view obtains the data from the model. There can be multiple views of the model.

Each View has an associated Controller. Controllers receive requests to handle the commands associated with user interaction with the view.

A view can own other views. For example, all views are owned by the IdeMainWindow view.

See Also:
IdeMainWindow

Field Summary
static Element[] EMPTY_SELECTION
           
static java.lang.String PROJECT_PROP
           
static java.lang.String VISIBLE_PROP
           
static java.lang.String WORKSPACE_PROP
           
 
Constructor Summary
protected View()
           
protected View(java.lang.String viewId)
           
 
Method Summary
 void activate()
           
 void addViewListener(ViewListener l)
           
 void addViewSelectionListener(ViewSelectionListener l)
           
 void addViewStateListener(ViewStateListener l)
          Registers the specified ViewStateListener with this View instance to be called back when a ViewStateEvent occurs.
 void close()
           
 void deactivate()
          Cleans up after this view stops being the active view.
 void fireViewCollapsed()
          Fires the ViewStateEvent.viewCollapsed(..) event.
 void fireViewExpanded()
          Fires the ViewStateEvent.viewExpanded(..) event.
protected  void fireViewSelectionChanged(ViewSelectionEvent e)
           
 Context getContext()
           
 Context getContext(java.util.EventObject event)
           
 ContextMenu getContextMenu()
           
 Controller getController()
          Get the Controller associated with this view.
abstract  java.awt.Component getGUI()
           
 HelpInfo getHelpInfo()
           
 java.lang.String getId()
          Unique id identifying this view.
 Element[] getSelection()
           
protected  Element[] getSelectionFromUI()
          This method retrieve's the selection in this View directly from the UI.
 java.lang.String getTabName()
           
 Toolbar getToolbar()
          Get the toolbar associated with this view.
 View getViewWithoutDecoration()
          Returns the View without any decorators.
 boolean isVisible()
           
 void loadLayout(PropertyAccess p)
           
static void loadManifestToolbar(java.lang.String toolbarId, Toolbar toolbar)
          Installs toolbar buttons for the specified Toolbar.
static void loadManifestToolbar(java.lang.String toolbarId, Toolbar toolbar, View view)
          Installs toolbar buttons for the specified Toolbar.
protected  java.lang.String newId()
          Generates a unique view ID.
 View owner()
          Get the owning View.
 void removeViewListener(ViewListener l)
           
 void removeViewSelectionListener(ViewSelectionListener l)
           
 void removeViewStateListener(ViewStateListener l)
          Unregisters the specified ViewStateListener from this View instance.
 void saveLayout(PropertyAccess p)
           
 void scheduleUpdateSelection()
           A variation of updateSelection() that delays the firing of the ViewSelectionEvent using a timer delay.
protected  void setId(java.lang.String id)
           
protected  void setOwner(View owner)
           
 void setToolbarVisible(boolean visible)
           
 void show()
          Shows the view if hidden.
 java.lang.String toString()
           
 void updateSelection()
           Subclasses should call this method to update the selection returned from getSelection() and to fire the ViewSelectionEvent.
protected  void updateSelectionImpl(boolean doNotifyOnInvokeLater)
           
 void updateTitle(java.lang.Object obj)
          Called when the view needs to update its title based on the specified object.
static void updateToolbarActions(Toolbar toolbar)
          Utility method for updating the actions contained in a toolbar.
 void updateVisibleActions()
          Method for updating the visible actions associated with this view.
 void updateVisibleActions(UpdateMessage updateMessage)
          Called when the IDE or an extension requests that the View updates 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, wait, wait, wait
 

Field Detail

VISIBLE_PROP

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

PROJECT_PROP

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

WORKSPACE_PROP

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

EMPTY_SELECTION

public static final Element[] EMPTY_SELECTION
Constructor Detail

View

protected View()

View

protected View(java.lang.String viewId)
Method Detail

getViewWithoutDecoration

public View getViewWithoutDecoration()
Returns the View without any decorators.


saveLayout

public void saveLayout(PropertyAccess p)

loadLayout

public void loadLayout(PropertyAccess p)

getController

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

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

getHelpInfo

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

owner

public final View owner()
Get the owning View. Views can be nested. In general, Views should return the IdeMainWindow as their owner, unless they are nested within another View.

Returns:
the owner of this View.

close

public void close()

show

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


isVisible

public boolean isVisible()

getGUI

public abstract java.awt.Component getGUI()
Returns:
the root graphical user interface component.

getContext

public final Context getContext()
Returns:
the current view context.

getContext

public Context getContext(java.util.EventObject event)
Parameters:
event - event associated with the context.
Returns:
the current view context for the given event.

getContextMenu

public ContextMenu getContextMenu()
Returns:
the ContextMenu, if any.

activate

public void activate()

deactivate

public void deactivate()
Cleans up after this view stops being the active view.


getSelection

public final Element[] getSelection()
Returns:
list of selected items in the view.

getId

public final 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.


updateTitle

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

Parameters:
obj - the specified object.

updateVisibleActions

public void updateVisibleActions(UpdateMessage updateMessage)
Called when the IDE or an extension requests that the View updates 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.

Parameters:
updateMessage - 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 updateMessage indicates that the source of the update is not relevant to the debugger.

getToolbar

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


setToolbarVisible

public void setToolbarVisible(boolean visible)

addViewListener

public void addViewListener(ViewListener l)

removeViewListener

public void removeViewListener(ViewListener l)

addViewSelectionListener

public void addViewSelectionListener(ViewSelectionListener l)

removeViewSelectionListener

public void removeViewSelectionListener(ViewSelectionListener l)

addViewStateListener

public final void addViewStateListener(ViewStateListener l)
Registers the specified ViewStateListener with this View instance to be called back when a ViewStateEvent occurs.

Parameters:
l - The listener to register.

removeViewStateListener

public final void removeViewStateListener(ViewStateListener l)
Unregisters the specified ViewStateListener from this View instance.

Parameters:
l - The listener to unregister.

updateSelection

public final void updateSelection()

Subclasses should call this method to update the selection returned from getSelection() and to fire the ViewSelectionEvent. The event is fired synchronously, so this method will block until all listeners have been notified.

See scheduleUpdateSelection() for a variation that delays selection change notification using a timer delay.

This method must be called on the Swing/AWT event dispatch thread.


scheduleUpdateSelection

public final void scheduleUpdateSelection()

A variation of updateSelection() that delays the firing of the ViewSelectionEvent using a timer delay. This method is useful when multiple selection changes could possibly occur in rapid sucession. When using this method, notification is not sent until a minimum interval (around 250 ms) passes without another call to scheduleUpdateSelection() ocurring.

Despite the notification delay, this method must still be called on the Swing/AWT event dispatch thread. The View's current selection is retrieved from the UI via getSelectionFromUI().


updateVisibleActions

public final void updateVisibleActions()
Method for updating the visible actions associated with this view. This is called by the IDE whenever the user takes an action that requires all visible actions, such as toolbar buttons, to be updated.


updateToolbarActions

public static final void updateToolbarActions(Toolbar toolbar)
Utility method for updating the actions contained in a toolbar.

Parameters:
toolbar - The toolbar whose actions should be updated.

loadManifestToolbar

public static final void loadManifestToolbar(java.lang.String toolbarId,
                                             Toolbar toolbar,
                                             View view)
Installs toolbar buttons for the specified Toolbar.

Parameters:
toolbarId - the id of the toolbar to load.
toolbar - the toolbar to install items into.
view - the (optional) view to use. If specified, the toolbar is owned by a view and all actions will only work with that view's context.

loadManifestToolbar

public static final void loadManifestToolbar(java.lang.String toolbarId,
                                             Toolbar toolbar)
Installs toolbar buttons for the specified Toolbar.

Parameters:
toolbarId - the id of the toolbar to load.
toolbar - the toolbar to install items into.

getSelectionFromUI

protected Element[] getSelectionFromUI()
This method retrieve's the selection in this View directly from the UI. Callers must invoke this method on the Swing/AWT event dispatch thread, and implementations can assume that calls are on the Swing/AWT event dispatch thread.

Returns:
the selection from the UI.

updateSelectionImpl

protected final void updateSelectionImpl(boolean doNotifyOnInvokeLater)

setId

protected final void setId(java.lang.String id)

newId

protected java.lang.String newId()
Generates a unique view ID. The default view ID is UnknownView{N}, where {N} is a unique integer value. Subclasses should override this method to return a more meaningful view ID.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setOwner

protected void setOwner(View owner)

fireViewSelectionChanged

protected final void fireViewSelectionChanged(ViewSelectionEvent e)

fireViewExpanded

public final void fireViewExpanded()
Fires the ViewStateEvent.viewExpanded(..) event.


fireViewCollapsed

public final void fireViewCollapsed()
Fires the ViewStateEvent.viewCollapsed(..) event.


getTabName

public java.lang.String getTabName()

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

E13403-05

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