bibliothek.gui.dock.common.intern
Class DefaultCDockable

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.AbstractCDockable
      extended by bibliothek.gui.dock.common.intern.DefaultCDockable
All Implemented Interfaces:
CDockable
Direct Known Subclasses:
DefaultMultipleCDockable, DefaultSingleCDockable

@FrameworkOnly
public class DefaultCDockable
extends AbstractCDockable

An CDockable that uses a DefaultCommonDockable to show its content.
Subclasses may override createCommonDockable() to provide a custom subclass of DefaultCommonDockable, note that createCommonDockable() is called as soon as the internal representation is required, e.g. for setting a property like the title or the icon.

Author:
Benjamin Sigg

Nested Class Summary
static class DefaultCDockable.Permissions
          Describes what the user can do with the enclosing DefaultCDockable.
 
Field Summary
 
Fields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollection
 
Fields inherited from interface bibliothek.gui.dock.common.intern.CDockable
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_NORMALIZE, ACTION_KEY_UNEXTERNALIZE, ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
 
Constructor Summary
DefaultCDockable()
          Creates a new dockable
DefaultCDockable(DefaultCDockable.Permissions permission)
          Creates a new dockable.
 
Method Summary
 void add(Component component)
          Adds component to the content pane.
 void add(Component component, Object constraints)
          Adds component to the content pane.
 void addAction(CAction action)
          Adds an action to this dockable.
 void addSeparator()
          Adds a separator to the list of CActions of this dockable.
protected  DefaultCommonDockable createCommonDockable()
          Creates the CommonDockable that is associated with this dockable, called the first time the CommonDockable is required for an operation.
 CAction getAction(int index)
          Gets the index'th action of this dockable.
 int getActionCount()
          Gets the number of CActions that were added to this dockable.
 Container getContentPane()
          Gets the container on which the client can pack its components.
 Icon getTitleIcon()
          Gets the icon that is shown in the title.
 String getTitleText()
          Gets the text that is shown as title.
 String getTitleToolTip()
          Gets the tooltip that is shown on the title of this dockable.
 void insertAction(int index, CAction action)
          Adds a new action to this dockable.
 void insertSeparator(int index)
          Adds a separator to the list of CActions of this dockable.
 DefaultCommonDockable intern()
          Gets the intern representation of this dockable.
 boolean isCloseable()
          Tells whether this CDockable can be closed by the user.
 boolean isExternalizable()
          Tells whether this CDockable can be externalized by the user.
 boolean isMaximizable()
          Tells whether this CDockable can be maximized by the user.
 boolean isMinimizable()
          Tells whether this CDockable can be minimized by the user.
 boolean isStackable()
          Tells whether this CDockable can be combined with another Dockable to create a stack.
 void remove(Component component)
          Removes component from the content pane.
 void removeAction(CAction action)
          Removes an action from this dockable.
 void removeAction(int index)
          Removes an action from this dockable
 void setCloseable(boolean closeable)
          Sets whether the user can close this dockable.
 void setExternalizable(boolean externalizable)
          Sets whether the user can externalize this dockable.
 void setLayout(LayoutManager layout)
          Sets the LayoutManager of the content pane.
 void setMaximizable(boolean maximizable)
          Sets whether the user can maximize this dockable.
 void setMinimizable(boolean minimizable)
          Sets whether the user can minimize this dockable.
 void setStackable(boolean stackable)
          Sets whether this element can be combined with other dockable to create a stack.
 void setTitleIcon(Icon icon)
          Sets the icon that is shown in the title of this CDockable.
 void setTitleText(String text)
          Sets the text that is shown as title.
 void setTitleToolTip(String text)
          Sets the tooltip that should be shown on the title of this dockable.
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, control, getAction, getAndClearResizeRequest, getBaseLocation, getClose, getColors, getControl, getDefaultLocation, getExtendedMode, getFonts, getMinimizedSize, getWorkingArea, init, isMinimizedHold, isResizeLocked, isResizeLockedHorizontally, isResizeLockedVertically, isSingleTabShown, isTitleShown, isVisible, propertyListeners, putAction, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControl, setDefaultLocation, setExtendedMode, setLocation, setMinimizedHold, setMinimizedSize, setResizeLocked, setResizeLockedHorizontally, setResizeLockedVertically, setResizeRequest, setResizeRequest, setSingleTabShown, setTitleShown, setVisible, setWorkingArea, stateListeners, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCDockable

public DefaultCDockable()
Creates a new dockable


DefaultCDockable

public DefaultCDockable(DefaultCDockable.Permissions permission)
Creates a new dockable.

Parameters:
permission - the permissions of this dockable
Method Detail

createCommonDockable

protected DefaultCommonDockable createCommonDockable()
Description copied from class: AbstractCDockable
Creates the CommonDockable that is associated with this dockable, called the first time the CommonDockable is required for an operation.

Specified by:
createCommonDockable in class AbstractCDockable
Returns:
the new dockable

getContentPane

public Container getContentPane()
Gets the container on which the client can pack its components.

Returns:
the panel showing the content

setLayout

public void setLayout(LayoutManager layout)
Sets the LayoutManager of the content pane.

Parameters:
layout - the new layout manager

add

public void add(Component component)
Adds component to the content pane.

Parameters:
component - the new component

add

public void add(Component component,
                Object constraints)
Adds component to the content pane.

Parameters:
component - the new component
constraints - constraints for the layout manager

remove

public void remove(Component component)
Removes component from the content pane.

Parameters:
component - the component to remove

setTitleText

public void setTitleText(String text)
Sets the text that is shown as title.

Parameters:
text - the title

getTitleText

public String getTitleText()
Gets the text that is shown as title.

Returns:
the title

setTitleToolTip

public void setTitleToolTip(String text)
Sets the tooltip that should be shown on the title of this dockable.

Parameters:
text - the new tooltip, can be null

getTitleToolTip

public String getTitleToolTip()
Gets the tooltip that is shown on the title of this dockable.

Returns:
the tooltip or null

setTitleIcon

public void setTitleIcon(Icon icon)
Sets the icon that is shown in the title of this CDockable.

Parameters:
icon - the title-icon

getTitleIcon

public Icon getTitleIcon()
Gets the icon that is shown in the title.

Returns:
the title-icon, might be null

isMinimizable

public boolean isMinimizable()
Description copied from interface: CDockable
Tells whether this CDockable can be minimized by the user.

Returns:
true if this element can be minimized

setMinimizable

public void setMinimizable(boolean minimizable)
Sets whether the user can minimize this dockable.

Parameters:
minimizable - true if the user can minimize this element

isMaximizable

public boolean isMaximizable()
Description copied from interface: CDockable
Tells whether this CDockable can be maximized by the user.

Returns:
true if this element can be maximized

setMaximizable

public void setMaximizable(boolean maximizable)
Sets whether the user can maximize this dockable.

Parameters:
maximizable - true if the user can maximize this element

isExternalizable

public boolean isExternalizable()
Description copied from interface: CDockable
Tells whether this CDockable can be externalized by the user.

Returns:
true if this element can be externalized

setExternalizable

public void setExternalizable(boolean externalizable)
Sets whether the user can externalize this dockable.

Parameters:
externalizable - true if the user can externalize this element

isCloseable

public boolean isCloseable()
Description copied from interface: CDockable
Tells whether this CDockable can be closed by the user. A close-button has to be provided by the CDockable itself. The best way to do that is to instantiate a CloseActionSource and include this source in the array that is returned by CommonDockable.getSources().

Returns:
true if this element can be closed

setStackable

public void setStackable(boolean stackable)
Sets whether this element can be combined with other dockable to create a stack. Note that this property is ignored if this element is already in a stack.

Parameters:
stackable - true if this element can be combined.

isStackable

public boolean isStackable()
Description copied from interface: CDockable
Tells whether this CDockable can be combined with another Dockable to create a stack.

Returns:
true if this element can be combined with another Dockable, normally true should be the answer.

setCloseable

public void setCloseable(boolean closeable)
Sets whether the user can close this dockable.

Parameters:
closeable - true if the user can close this element

addAction

public void addAction(CAction action)
Adds an action to this dockable. The action will be shown in the popup-menu which belongs to this dockable, and also as button in some titles of this dockable.

Parameters:
action - the new action

insertAction

public void insertAction(int index,
                         CAction action)
Adds a new action to this dockable.

Parameters:
index - the location of the action
action - the action
See Also:
addAction(CAction)

addSeparator

public void addSeparator()
Adds a separator to the list of CActions of this dockable.


insertSeparator

public void insertSeparator(int index)
Adds a separator to the list of CActions of this dockable.

Parameters:
index - the location of the action

removeAction

public void removeAction(int index)
Removes an action from this dockable

Parameters:
index - the location of the action

removeAction

public void removeAction(CAction action)
Removes an action from this dockable.

Parameters:
action - the action to remove

getActionCount

public int getActionCount()
Gets the number of CActions that were added to this dockable.

Returns:
the number of actions

getAction

public CAction getAction(int index)
Gets the index'th action of this dockable. Be aware that the result might be CSeparator.SEPARATOR.

Parameters:
index - the location of an action
Returns:
the action

intern

public DefaultCommonDockable intern()
Description copied from class: AbstractCDockable
Gets the intern representation of this dockable.

Specified by:
intern in interface CDockable
Overrides:
intern in class AbstractCDockable
Returns:
the intern representation.