Extension SDK

oracle.ide.docking
Class DockableWindow

java.lang.Object
  extended byoracle.ide.addin.AbstractView
      extended byoracle.ide.docking.DockableWindow
All Implemented Interfaces:
Dockable, Helpable, Subview, View
Direct Known Subclasses:
AbstractPinnable

public abstract class DockableWindow
extends AbstractView
implements Dockable

This class is the bridge between the Dockable interface docking system and the View interface. Addin writers should extend this class and not implement Dockable directly.

See Also:
Docking Package Summary

Field Summary
static int CLOSED
          stateChange constant.
static int HIDDEN
          stateChange constant.
static int SHOWN
          stateChange constant.
 
Fields inherited from class oracle.ide.addin.AbstractView
owner, SEPARATOR, viewListeners, viewSelectionListeners
 
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 DockableWindow(View owner, java.lang.String viewId)
          Constructor.
 
Method Summary
 void addTitleChangeListener(TitleChangeListener l)
          Adds a title change listener to a dockable.
 void close()
          Closes the view.
protected  void dockableHidden(DockableEvent e)
           
protected  void dockableShown(DockableEvent e)
           
protected  void fireTitleChangeListener()
           
protected  Dockable getCachedDockable()
          This method returns the Dockable as know by the docking system based on the view ID.
 javax.swing.JComponent getHostedComponent()
          Gets the root component of the user interface to be docked or floated.
 int getMenuPreferredMnemonic()
          Gets mnemonic used in the menus of the docking for showing/hiding the dockable.
 java.lang.String getMenuTitle()
          Gets the text to display in the menus of the docking for showing/hiding the dockable.
 Site getSite()
          Gets a storage object for docking information.
 java.awt.dnd.DropTargetListener getTabDropListener()
          Gets the drop target listener for drop events on the tab.
 javax.swing.Icon getTabIcon()
          Gets the icon to display in a tab along side the name.
 int getType()
          Gets the types of dockable accepted by a specific dockable implementation.
 java.lang.String getUniqueName()
          Gets a unique name used for persistence.
 boolean isVisible()
          Returns true if the subview is visible.
 void loadLayout(PropertyAccess p)
          reloads the layout information of this dockable.
 void removeTitleChangeListener(TitleChangeListener l)
          Removes the specified title change listener from the dockable.
 void saveLayout(PropertyAccess p)
          Saves the layout information of this dockable.
 void setDockableVisible(boolean bVisible)
          Shows/hides the dockable.
 void setSite(Site site)
          Sets the current site where this dockable is docked or floated.
 void setType(int type)
           
 void show()
          Shows the view if hidden.
 void stateChange(int newState)
          This method gets called when a panel is shown, hidden, or closed.
 void updateTitle(java.lang.Object object)
          Called when the view needs to update its title based on the specified object.
 
Methods inherited from class oracle.ide.addin.AbstractView
activate, addViewListener, addViewSelectionListener, deactivate, fireViewActivated, fireViewClosed, fireViewDeactivated, fireViewSelectionChanged, getContext, getContextMenu, getController, getHelpInfo, getId, getSelection, getToolbar, loadToolbar, 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
 

Field Detail

SHOWN

public static final int SHOWN
stateChange constant.

Used when the UI is made visible or accessible.
Accessible means it is tabbed with other dockable windows. In this case, the SHOWN stateChange will be sent although the JComponent.isVisible==false.

SHOWN will be used when a layout is loaded as well as when the API is used.

See Also:
Constant Field Values

HIDDEN

public static final int HIDDEN
stateChange constant.

HIDDEN is the counterpart of SHOWN
It will be called when the user pressed the 'X' button, and when the layout changes (even if the dockable is visible in both layouts)

See Also:
Constant Field Values

CLOSED

public static final int CLOSED
stateChange constant.

CLOSED is sent to Dockable that return TYPE_DISCARDABLE on getType().
CLOSED is sent when the close button is pressed after HIDDEN only if the dockable is alone in a window or tabbed only with other discardable windows.

See Also:
Constant Field Values
Constructor Detail

DockableWindow

protected DockableWindow(View owner,
                         java.lang.String viewId)
Constructor.

Method Detail

getCachedDockable

protected Dockable getCachedDockable()
This method returns the Dockable as know by the docking system based on the view ID. The returned value != this if a proxy was used.

Returns:
this if no proxy has been used, the Dockable proxy known by the docking system or null if this has never been docked.

close

public void close()
Closes the view.

Specified by:
close in interface Subview
Overrides:
close in class AbstractView

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
Overrides:
show in class AbstractView

isVisible

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

Specified by:
isVisible in interface Subview
Overrides:
isVisible in class AbstractView

setDockableVisible

public void setDockableVisible(boolean bVisible)
Shows/hides the dockable. This should be called in place of setVisible


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
Overrides:
updateTitle in class AbstractView

getTabIcon

public javax.swing.Icon getTabIcon()
Gets the icon to display in a tab along side the name.

Specified by:
getTabIcon in interface Dockable
Returns:
the the icon to display in a tab.
See Also:
Dockable.getTabName()

getType

public int getType()
Gets the types of dockable accepted by a specific dockable implementation. The constants above define some standard types. These types can be OR(ed) together.

Specified by:
getType in interface Dockable
Returns:
the type accepted by this dockable implementation.

setType

public void setType(int type)

getUniqueName

public java.lang.String getUniqueName()
Gets a unique name used for persistence. The default is the ViewId

Specified by:
getUniqueName in interface Dockable
Returns:
a unique name used for registration purposes.

getSite

public Site getSite()
Gets a storage object for docking information. Implementors just need to provide a data member to hold the incoming site.

Specified by:
getSite in interface Dockable
Returns:
the current site.
See Also:
setSite(oracle.ide.docking.Site)

setSite

public void setSite(Site site)
Sets the current site where this dockable is docked or floated. Implementors just need to provide a data member to hold the incoming site.

Specified by:
setSite in interface Dockable
Parameters:
site - the site to set.
See Also:
getSite()

getHostedComponent

public javax.swing.JComponent getHostedComponent()
Gets the root component of the user interface to be docked or floated.

Specified by:
getHostedComponent in interface Dockable
Returns:
the root component.

getTabDropListener

public java.awt.dnd.DropTargetListener getTabDropListener()
Gets the drop target listener for drop events on the tab. The TitledPanel will forward drop events to the appropriate listener for each tab.

If handling drop events on the tab is not necessary, the implementation of this method should return null.

Note that this method may called repeatedly during a drag and drop operation, so it should be fast.

Specified by:
getTabDropListener in interface Dockable
Returns:
the drop target listener

getMenuTitle

public java.lang.String getMenuTitle()
Gets the text to display in the menus of the docking for showing/hiding the dockable.

Specified by:
getMenuTitle in interface Dockable
Returns:
the string to display in the menu

getMenuPreferredMnemonic

public int getMenuPreferredMnemonic()
Gets mnemonic used in the menus of the docking for showing/hiding the dockable.

Specified by:
getMenuPreferredMnemonic in interface Dockable
Returns:
the mnemonic

saveLayout

public void saveLayout(PropertyAccess p)
Saves the layout information of this dockable.

Specified by:
saveLayout in interface Dockable
Parameters:
p - the storage object

loadLayout

public void loadLayout(PropertyAccess p)
reloads the layout information of this dockable.

Specified by:
loadLayout in interface Dockable
Parameters:
p - the storage object

addTitleChangeListener

public void addTitleChangeListener(TitleChangeListener l)
Adds a title change listener to a dockable. TitleChangeEvents should be trigger by a dockable whenever their title information changes.

Specified by:
addTitleChangeListener in interface Dockable
Parameters:
l - a TitleChangeListener instance.

removeTitleChangeListener

public void removeTitleChangeListener(TitleChangeListener l)
Removes the specified title change listener from the dockable.

Specified by:
removeTitleChangeListener in interface Dockable
Parameters:
l - a TitleChangeListener instance.

stateChange

public void stateChange(int newState)
This method gets called when a panel is shown, hidden, or closed. The value passed in indicates precisely what happened. This method is really only intended as a convenience method for implementations of DockableListener which need to communicate to their dockable a state change.

Parameters:
newState - The new state indicating whether the panel was shown, hidden or closed.

fireTitleChangeListener

protected void fireTitleChangeListener()

dockableHidden

protected void dockableHidden(DockableEvent e)

dockableShown

protected void dockableShown(DockableEvent e)

Extension SDK

 

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