Extension SDK

oracle.ide.addin
Class AbstractPinnable

java.lang.Object
  |
  +--oracle.ide.addin.AbstractView
        |
        +--oracle.ide.docking.DockableWindow
              |
              +--oracle.ide.addin.AbstractPinnable
All Implemented Interfaces:
ActiveViewListener, Dockable, java.util.EventListener, Helpable, Pinnable, Subview, View, ViewListener, ViewSelectionListener

public abstract class AbstractPinnable
extends DockableWindow
implements ActiveViewListener, ViewListener, ViewSelectionListener, Pinnable

AbstractPinnable implements the Pinnable interface as it applies to a DockableWindow which is capable of responding to changes in selection in the active View as well as changes of the active View from one View to another.


Fields inherited from class oracle.ide.docking.DockableWindow
CLOSED, HIDDEN, SHOWN
 
Fields inherited from class oracle.ide.addin.AbstractView
owner, SEPARATOR, viewListeners, viewSelectionListeners
 
Fields inherited from interface oracle.ide.addin.Pinnable
PIN_NONE, PIN_OBJECT, PIN_VIEW
 
Fields inherited from interface oracle.ide.docking.Dockable
TYPE_DISCARDABLE, TYPE_NO_BUTTONS, TYPE_NORMAL, TYPE_NOT_TABBED, TYPE_RECYCLABLE, TYPE_TRUNCATE_TITLE
 
Fields inherited from interface oracle.ide.addin.View
PROJECT_PROP, VISIBLE_PROP, WORKSPACE_PROP
 
Constructor Summary
protected AbstractPinnable(View owner, java.lang.String viewId)
          Constructor.
 
Method Summary
 void activeViewChanged(ActiveViewEvent e)
          Respond to a change of active View filtered by the current pin state.
protected  void clear()
          Internal method allowing subclasses to perform cleaning duties when no View is available from which to fetch a selection for display.
protected  View getPinnedView()
          Get the View whose selection is currently the source displayed within this DockableWindow.
 int getPinState()
          Get the current pin state as one of PIN_NONE, PIN_VIEW, or PIN_OBJECT.
protected abstract  boolean isViewSupported(View view)
          Determine whether or not the given View is one that is considered interesting by this Pinnable.
 void setContext(Context context)
          Initialize the DockableView based upon the selection of the View contained in the incoming Context.
protected  void setPinnedView(View view)
          Set the View whose selection should be displayed within this DockableWindow.
 void setPinState(int newState)
          Set the current pin state as one of PIN_NONE, PIN_VIEW, or PIN_OBJECT.
 void stateChange(int newState)
          Responds to changes in state by adding or removing self as an ActiveViewListener on the active view held by the MainWindow.
 void viewActivated(ViewEvent e)
          Respond to an activation event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView.
 void viewClosed(ViewEvent e)
          Respond to a close event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView.
 void viewDeactivated(ViewEvent e)
          Respond to a deactivation event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView.
protected  void viewSelectionChanged(Context context)
          Internal method allowing subclasses to perform additional processing after the standard call to viewSelectionChanged(ViewSelectionEvent) has filtered out cases where the selection changes should be ignored.
 void viewSelectionChanged(ViewSelectionEvent e)
          Respond to a change in selection in the pinned View based on the pin state.
 
Methods inherited from class oracle.ide.docking.DockableWindow
addTitleChangeListener, close, dockableHidden, dockableShown, fireTitleChangeListener, getCachedDockable, getHostedComponent, getMenuPreferredMnemonic, getMenuTitle, getSite, getTabDropListener, getTabIcon, getType, getUniqueName, isVisible, loadLayout, removeTitleChangeListener, saveLayout, setDockableVisible, setSite, setType, show, updateTitle
 
Methods inherited from class oracle.ide.addin.AbstractView
activate, addViewListener, addViewSelectionListener, deactivate, fireViewActivated, fireViewClosed, fireViewDeactivated, fireViewSelectionChanged, getContext, getContextMenu, getController, getHelpInfo, getId, getSelection, getToolbar, loadToolbar, newId, owner, removeViewListener, removeViewSelectionListener, setId, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.ide.docking.Dockable
getTabName, getTitleName
 
Methods inherited from interface oracle.ide.addin.View
getContext
 
Methods inherited from interface oracle.ide.addin.Subview
getGUI
 

Constructor Detail

AbstractPinnable

protected AbstractPinnable(View owner,
                           java.lang.String viewId)
Constructor.
See Also:
DockableWindow
Method Detail

setContext

public void setContext(Context context)
Initialize the DockableView based upon the selection of the View contained in the incoming Context. Constructs an ActiveViewEvent instance from the context's View and internally calls activeViewChanged.
Parameters:
context - the Context from which to initialize.
See Also:
ActiveViewEvent, activeViewChanged(oracle.ide.addin.ActiveViewEvent)

stateChange

public void stateChange(int newState)
Responds to changes in state by adding or removing self as an ActiveViewListener on the active view held by the MainWindow.
Overrides:
stateChange in class DockableWindow
Parameters:
newState - the new visibility state of this DockableWindow
See Also:
ActiveViewListener, DockableWindow.stateChange, oracle.ide.MainWindow.addActiveViewListener, oracle.ide.MainWindow.removeActiveViewListener

activeViewChanged

public void activeViewChanged(ActiveViewEvent e)
Respond to a change of active View filtered by the current pin state. If this Pinnable supports the newly activated View type and if this Pinnable is in a pin state of PIN_NONE, then the pinned View will be set to the newly activated View and an internal viewSelectionChanged call will be fired using this updated pinned View as the View of interest.
Specified by:
activeViewChanged in interface ActiveViewListener
Parameters:
e - the ActiveViewEvent describing the newly activated View
See Also:
ActiveViewEvent, isViewSupported(oracle.ide.addin.View), getPinState(), setPinnedView(oracle.ide.addin.View), getPinnedView(), viewSelectionChanged(ViewSelectionEvent)

viewSelectionChanged

public void viewSelectionChanged(ViewSelectionEvent e)
Respond to a change in selection in the pinned View based on the pin state. If the pin state is PIN_OBJECT the event is ignored. Otherwise the context is fetched from the View from which the event originated and is passed as argument to an internal call of viewSelectionChanged(Context)
Specified by:
viewSelectionChanged in interface ViewSelectionListener
Parameters:
e - ViewSelecitonEvent describing the change of selection in the View
See Also:
ViewSelectionEvent, getPinState(), viewSelectionChanged(Context)

viewActivated

public void viewActivated(ViewEvent e)
Respond to an activation event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView. This implementation does nothing.
Specified by:
viewActivated in interface ViewListener
Parameters:
e - an event describing the activation.
See Also:
ViewEvent, getPinnedView()

viewDeactivated

public void viewDeactivated(ViewEvent e)
Respond to a deactivation event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView. This implementation does nothing.
Specified by:
viewDeactivated in interface ViewListener
Parameters:
e - an event describing the deactivation.
See Also:
ViewEvent, getPinnedView()

viewClosed

public void viewClosed(ViewEvent e)
Respond to a close event on the View holding the selection that this Pinnable is interested in as returned by getPinnedView. This implementation sets the pinned view to null, then calls setPinState passing PIN_NONE in order to simulates an ActiveView event to allow this Pinnable an opportunity to catch up to the current selection of the currently active View.
Specified by:
viewClosed in interface ViewListener
Parameters:
e - an event describing the close
See Also:
ViewEvent, setPinnedView(oracle.ide.addin.View), setPinState(int)

getPinState

public int getPinState()
Get the current pin state as one of PIN_NONE, PIN_VIEW, or PIN_OBJECT.
Specified by:
getPinState in interface Pinnable
Returns:
the current pin state.
See Also:
Pinnable.PIN_NONE, Pinnable.PIN_VIEW, Pinnable.PIN_OBJECT

setPinState

public void setPinState(int newState)
Set the current pin state as one of PIN_NONE, PIN_VIEW, or PIN_OBJECT. Setting the state to PIN_NONE will force an internal call to activeViewChanged using the MainWindow's last active View as the newly activated View in order to allow this Pinnable to catch up to the current selection of that View. Setting the state to PIN_VIEW will force an internal call to viewSelectionChanged(ViewSelectionEvent) using the currently pinned View in order to allow this Pinnable to catch up to the current selection of the current View. Setting the state to PIN_OBJECT will simply update the state without additional processing.
Specified by:
setPinState in interface Pinnable
Parameters:
newState - the new pin state to set.
See Also:
Pinnable.PIN_NONE, Pinnable.PIN_VIEW, Pinnable.PIN_OBJECT, getPinnedView(), activeViewChanged(oracle.ide.addin.ActiveViewEvent), viewSelectionChanged(ViewSelectionEvent)

isViewSupported

protected abstract boolean isViewSupported(View view)
Determine whether or not the given View is one that is considered interesting by this Pinnable. For example; a Property Inspector might not be interested in displaying properties of individual controls in a Control Palette and thus would return false from this method for views of that type.
Parameters:
view - the View under consideration

viewSelectionChanged

protected void viewSelectionChanged(Context context)
Internal method allowing subclasses to perform additional processing after the standard call to viewSelectionChanged(ViewSelectionEvent) has filtered out cases where the selection changes should be ignored. This implementation does nothing.
Parameters:
context - the Context of the View from which a selection has changed.
See Also:
#viewSelectionChagned(ViewSelectionEvent)

clear

protected void clear()
Internal method allowing subclasses to perform cleaning duties when no View is available from which to fetch a selection for display. This implementation does nothing.
See Also:
viewSelectionChanged(ViewSelectionEvent)

getPinnedView

protected View getPinnedView()
Get the View whose selection is currently the source displayed within this DockableWindow.
See Also:
activeViewChanged(oracle.ide.addin.ActiveViewEvent)

setPinnedView

protected void setPinnedView(View view)
Set the View whose selection should be displayed within this DockableWindow. The implementation removes this as listener from the previous pinned View and will add this as both a ViewListener and ViewSelectionListener to the new value such that those events may be responded to.
Parameters:
view - the new View to take interest in
See Also:
viewActivated(oracle.ide.addin.ViewEvent), viewDeactivated(oracle.ide.addin.ViewEvent), viewClosed(oracle.ide.addin.ViewEvent), viewSelectionChanged(ViewSelectionEvent)

Extension SDK