Class DefaultCDockable
java.lang.Object
bibliothek.gui.dock.common.intern.AbstractCDockable
bibliothek.gui.dock.common.intern.DefaultCDockable
- All Implemented Interfaces:
CDockable
- Direct Known Subclasses:
DefaultMultipleCDockable,DefaultSingleCDockable
An
Subclasses may override
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
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes what the user can do with the enclosingDefaultCDockable.
A name likeX_Ytells, that featureXand featureYare available. -
Field Summary
Fields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollectionFields inherited from interface bibliothek.gui.dock.common.intern.CDockable
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_MINIMIZE_HOLD, ACTION_KEY_NORMALIZE, ACTION_KEY_UNEXTERNALIZE, ACTION_KEY_UNMAXIMIZE_EXTERNALIZED -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new dockableDefaultCDockable(DefaultCDockable.Permissions permission) Creates a new dockable. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddscomponentto the content pane.voidAddscomponentto the content pane.voidAdds an action to this dockable.voidAdds a separator to the list ofCActions of this dockable.CStation<?>protected DefaultCommonDockableCreates theCommonDockablethat is associated with this dockable, called the first time theCommonDockableis required for an operation.getAction(int index) Gets theindex'th action of this dockable.intGets the number ofCActions that were added to this dockable.Gets the container on which the client can pack its components.Gets the icon that is shown in the title.Gets the behavior ofsetTitleIcon(Icon).Gets the text that is shown as title.Gets the tooltip that is shown on the title of this dockable.voidinsertAction(int index, CAction action) Adds a new action to this dockable.voidinsertSeparator(int index) Adds a separator to the list ofCActions of this dockable.intern()Gets the intern representation of this dockable.booleanTells whether thisCDockablecan be closed by the user.booleanTells whether thisCDockablecan be externalized by the user.booleanTells whether thisCDockablecan be maximized by the user.booleanTells whether thisCDockablecan be minimized by the user.booleanTells whether thisCDockablecan be combined with anotherDockableto create a stack.voidRemovescomponentfrom the content pane.voidremoveAction(int index) Removes an action from this dockablevoidremoveAction(CAction action) Removes an action from this dockable.voidsetCloseable(boolean closeable) Sets whether the user can close this dockable.voidsetExternalizable(boolean externalizable) Sets whether the user can externalize this dockable.voidsetLayout(LayoutManager layout) Sets theLayoutManagerof thecontent pane.voidsetMaximizable(boolean maximizable) Sets whether the user can maximize this dockable.voidsetMinimizable(boolean minimizable) Sets whether the user can minimize this dockable.voidsetStackable(boolean stackable) Sets whether this element can be combined with other dockable to create a stack.voidsetTitleIcon(Icon icon) Sets the icon that is shown in the title of thisCDockable.voidsetTitleIconHandling(IconHandling handling) Sets the behavior ofsetTitleIcon(Icon)in case of anullargument.voidsetTitleText(String text) Sets the text that is shown as title.voidsetTitleToolTip(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
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, control, getAction, getAndClearResizeRequest, getAutoBaseLocation, getBaseLocation, getClose, getColors, getControl, getControlAccess, getDefaultLocation, getDockableUniqueId, getExtendedMode, getFocusComponent, getFonts, getGrouping, getMinimizedSize, getParentStation, getWorkingArea, hasParent, init, isDockableVisible, isEnabled, isNormalizeable, isResizeLocked, isResizeLockedHorizontally, isResizeLockedVertically, isShowing, isSingleTabShown, isSticky, isStickySwitchable, isTitleShown, isVisible, propertyListeners, putAction, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControlAccess, setDefaultLocation, setEnabled, setExtendedMode, setFocusComponent, setGrouping, setLocation, setLocationsAside, setLocationsAside, setLocationsAsideFocused, setMinimizedSize, setResizeLocked, setResizeLockedHorizontally, setResizeLockedVertically, setResizeRequest, setResizeRequest, setSingleTabShown, setSticky, setStickySwitchable, setTitleShown, setVisible, setWorkingArea, stateListeners, toFront, toFront, toString
-
Constructor Details
-
DefaultCDockable
public DefaultCDockable()Creates a new dockable -
DefaultCDockable
Creates a new dockable.- Parameters:
permission- the permissions of this dockable
-
-
Method Details
-
createCommonDockable
Description copied from class:AbstractCDockableCreates theCommonDockablethat is associated with this dockable, called the first time theCommonDockableis required for an operation.- Specified by:
createCommonDockablein classAbstractCDockable- Returns:
- the new dockable
-
getContentPane
Gets the container on which the client can pack its components.- Returns:
- the panel showing the content
-
setLayout
Sets theLayoutManagerof thecontent pane.- Parameters:
layout- the new layout manager
-
add
Addscomponentto the content pane.- Parameters:
component- the new component
-
add
Addscomponentto the content pane.- Parameters:
component- the new componentconstraints- constraints for thelayout manager
-
remove
Removescomponentfrom the content pane.- Parameters:
component- the component to remove
-
setTitleText
Sets the text that is shown as title.- Parameters:
text- the title
-
getTitleText
Gets the text that is shown as title.- Returns:
- the title
-
setTitleToolTip
Sets the tooltip that should be shown on the title of this dockable.- Parameters:
text- the new tooltip, can benull
-
getTitleToolTip
Gets the tooltip that is shown on the title of this dockable.- Returns:
- the tooltip or
null
-
setTitleIconHandling
Sets the behavior ofsetTitleIcon(Icon)in case of anullargument. Either the icon is replaced by the default icon, or just not shown.- Parameters:
handling- the new behavior, notnull
-
getTitleIconHandling
Gets the behavior ofsetTitleIcon(Icon).- Returns:
- the behavior, not
null
-
setTitleIcon
Sets the icon that is shown in the title of thisCDockable. The exact behavior of this method depends on theIconHandlingthat was set bysetTitleIconHandling(IconHandling).- Parameters:
icon- the title-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:CDockableTells whether thisCDockablecan be minimized by the user.- Returns:
trueif this element can be minimized
-
setMinimizable
public void setMinimizable(boolean minimizable) Sets whether the user can minimize this dockable.- Parameters:
minimizable-trueif the user can minimize this element
-
isMaximizable
public boolean isMaximizable()Description copied from interface:CDockableTells whether thisCDockablecan be maximized by the user.- Returns:
trueif this element can be maximized
-
setMaximizable
public void setMaximizable(boolean maximizable) Sets whether the user can maximize this dockable.- Parameters:
maximizable-trueif the user can maximize this element
-
isExternalizable
public boolean isExternalizable()Description copied from interface:CDockableTells whether thisCDockablecan be externalized by the user.- Returns:
trueif this element can be externalized
-
setExternalizable
public void setExternalizable(boolean externalizable) Sets whether the user can externalize this dockable.- Parameters:
externalizable-trueif the user can externalize this element
-
isCloseable
public boolean isCloseable()Description copied from interface:CDockableTells whether thisCDockablecan be closed by the user. A close-button has to be provided by theCDockableitself. The best way to do that is to instantiate aCloseActionSourceand include this source in the array that is returned byCommonDockable.getSources().- Returns:
trueif 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-trueif this element can be combined.
-
isStackable
public boolean isStackable()Description copied from interface:CDockableTells whether thisCDockablecan be combined with anotherDockableto create a stack.- Returns:
trueif this element can be combined with anotherDockable, normallytrueshould be the answer.
-
setCloseable
public void setCloseable(boolean closeable) Sets whether the user can close this dockable.- Parameters:
closeable-trueif the user can close this element
-
addAction
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
Adds a new action to this dockable.- Parameters:
index- the location of the actionaction- the action- See Also:
-
addSeparator
public void addSeparator()Adds a separator to the list ofCActions of this dockable. -
insertSeparator
public void insertSeparator(int index) Adds a separator to the list ofCActions 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
Removes an action from this dockable.- Parameters:
action- the action to remove
-
getActionCount
public int getActionCount()Gets the number ofCActions that were added to this dockable.- Returns:
- the number of actions
-
getAction
Gets theindex'th action of this dockable. Be aware that the result might beCSeparator.SEPARATOR.- Parameters:
index- the location of an action- Returns:
- the action
-
intern
Description copied from class:AbstractCDockableGets the intern representation of this dockable.- Specified by:
internin interfaceCDockable- Overrides:
internin classAbstractCDockable- Returns:
- the intern representation.
-
asStation
Description copied from interface:CDockable- Returns:
- this as station or
null
-