|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@FrameworkOnly public interface CDockable
A basic element representing some Component
and a wrapper
around a Dockable
.
Note: This interface is not intended to be implemented by clients.
Clients should either extend the class AbstractCDockable
or use
one of DefaultSingleCDockable
or DefaultMultipleCDockable
.
Field Summary | |
---|---|
static String |
ACTION_KEY_CLOSE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_EXTERNALIZE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_MAXIMIZE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_MINIMIZE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_MINIMIZE_HOLD
Key for an action of getAction(String) . |
static String |
ACTION_KEY_NORMALIZE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_UNEXTERNALIZE
Key for an action of getAction(String) . |
static String |
ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
Key for an action of getAction(String) . |
Method Summary | |
---|---|
void |
addCDockableLocationListener(CDockableLocationListener listener)
Adds a listener to this dockable which gets informed if the location or the visibility changes. |
void |
addCDockablePropertyListener(CDockablePropertyListener listener)
Adds a property listener to this dockable, the listener will be informed of changes of this dockable. |
void |
addCDockableStateListener(CDockableStateListener listener)
Adds a state listener to this dockable, the listener will be informed of changes of this dockable. |
void |
addDoubleClickListener(CDoubleClickListener listener)
Adds a new listener to this dockable. |
void |
addFocusListener(CFocusListener listener)
Adds a focus listener to this dockable. |
void |
addKeyboardListener(CKeyboardListener listener)
Adds a keyboard listener to this dockable. |
void |
addVetoClosingListener(CVetoClosingListener listener)
Adds a veto-listener to this dockable, the listener will be informed before this dockable gets closed and can issue a veto. |
CStation<?> |
asStation()
Gets this or an object representing this as
CStation . |
CAction |
getAction(String key)
Gets an action which is not added to the title by this CDockable
put by another module. |
RequestDimension |
getAndClearResizeRequest()
Gets the preferred size of this CDockable . |
CLocation |
getAutoBaseLocation(boolean noBackwardsTransformation)
Tries to find out at which location this CDockable may appear if it would be made visible. |
CLocation |
getBaseLocation()
Gets the location of this CDockable . |
ColorMap |
getColors()
Gets a mutable map of colors. |
CControl |
getControl()
Gets the control which is responsible for this dockable. |
CControlAccess |
getControlAccess()
Gets the control which is responsible for this dockable. |
ExtendedMode |
getExtendedMode()
Gets the size and location of this CDockable . |
Component |
getFocusComponent()
Gets the Component which should receive the focus once this CDockable is focused. |
FontMap |
getFonts()
Gets a mutable map of fonts. |
DockableGrouping |
getGrouping()
Gets an algorithm that tells how this CDockable attempts to group itself automatically with other Dockable s. |
Dimension |
getMinimizedSize()
Gets the size which is used when this CDockable is minimzed and
on a popup window. |
CStation<?> |
getParentStation()
Searches the first CStation that is a parent of this CDockable . |
CStation<?> |
getWorkingArea()
Gets the parent of this CDockable , this should be the same as
set by the last call of setWorkingArea(CStation) . |
boolean |
hasParent()
Tells whether this CDockable has a root station as parent. |
CommonDockable |
intern()
Gets the intern representation of this CDockable . |
boolean |
isCloseable()
Tells whether this CDockable can be closed by the user. |
boolean |
isDockableVisible()
Deprecated. this method gets replaced by isShowing() , which offers the exact same information. This method
will be removed in a future release |
boolean |
isEnabled(EnableableItem item)
Tells whether a part of this dockable is enabled. |
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 |
isNormalizeable()
Tells whether this CDockable can be normalized by the user. |
boolean |
isResizeLockedHorizontally()
Tells whether the width of this CDockable should remain the same when
its parent changes the size. |
boolean |
isResizeLockedVertically()
Tells whether the height of this CDockable should remain the same when
its parent changes the size. |
boolean |
isShowing()
Tells whether this CDockable is currently visible to the user. |
boolean |
isSingleTabShown()
Tells whether a single tab should be shown for this CDockable . |
boolean |
isStackable()
Tells whether this CDockable can be combined with another
Dockable to create a stack. |
boolean |
isSticky()
Tells whether this CDockable remains visible when minimized and
without focus. |
boolean |
isStickySwitchable()
Tells whether the isSticky() property can be changed by the user
by clicking a button that is displayed on the FlapDockStation . |
boolean |
isTitleShown()
Tells whether this CDockable shows its title or not. |
boolean |
isVisible()
Tells whether this CDockable is currently visible or not. |
void |
removeCDockableLocationListener(CDockableLocationListener listener)
Removes listener from this dockable |
void |
removeCDockablePropertyListener(CDockablePropertyListener listener)
Removes a property listener from this dockable. |
void |
removeCDockableStateListener(CDockableStateListener listener)
Removes a state listener from this dockable. |
void |
removeDoubleClickListener(CDoubleClickListener listener)
Removes a listener from this dockable. |
void |
removeFocusListener(CFocusListener listener)
Removes a focus listener from this dockable. |
void |
removeKeyboardListener(CKeyboardListener listener)
Removes a listener from this dockable. |
void |
removeVetoClosingListener(CVetoClosingListener listener)
Removes listener from this CDockable . |
void |
setControlAccess(CControlAccess control)
Sets the CControl which is responsible for this CDockable . |
void |
setExtendedMode(ExtendedMode extendedMode)
Sets how and where this CDockable should be shown. |
void |
setLocation(CLocation location)
Sets the location of this CDockable . |
void |
setLocationsAside(CDockable dockable)
Sets the location of this CDockable aside dockable in all ExtendedMode s. |
boolean |
setLocationsAside(Filter<CDockable> filter)
Traverses the history of focused CDockable s, and selects the newest item with focus and matching
filter for calling setLocationsAside(CDockable) . |
boolean |
setLocationsAsideFocused()
Searches for the last focused CDockable with the same working area as
this , and calls setLocationsAside(CDockable) with it.Note that if this dockable is visible, then it may or may not change its location. |
void |
setMinimizedSize(Dimension size)
Sets the size of this CDockable when this CDockable is minimized and
on a popup window. |
void |
setSticky(boolean sticky)
Sets whether this CDockable should remain visible when minimized
and without focus. |
void |
setStickySwitchable(boolean switchable)
Sets whether the user can switch the isSticky() property by clicking
on a button that is presented by the FlapDockStation . |
void |
setVisible(boolean visible)
Shows or hides this CDockable . |
void |
setWorkingArea(CStation<?> area)
Sets the parent of this CDockable . |
Field Detail |
---|
static final String ACTION_KEY_MINIMIZE
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with an argument of ExtendedMode.MINIMIZED
.
static final String ACTION_KEY_MAXIMIZE
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with an argument of ExtendedMode.MAXIMIZED
.
static final String ACTION_KEY_NORMALIZE
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with an argument of ExtendedMode.NORMALIZED
.
static final String ACTION_KEY_EXTERNALIZE
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with an argument of ExtendedMode.EXTERNALIZED
.
static final String ACTION_KEY_UNEXTERNALIZE
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with
an argument of ExtendedMode.NORMALIZED
.
static final String ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
getAction(String)
. The action behind this
key should call setExtendedMode(ExtendedMode)
with
an argument of ExtendedMode.EXTERNALIZED
.
static final String ACTION_KEY_CLOSE
getAction(String)
. The action behind this
key should call setVisible(boolean)
with the argument
false
.
static final String ACTION_KEY_MINIMIZE_HOLD
getAction(String)
. The action behind
this key should toggle CDockable#setMinimizedHold(boolean)
.
Method Detail |
---|
void addCDockableStateListener(CDockableStateListener listener)
listener
- the new listenervoid addCDockablePropertyListener(CDockablePropertyListener listener)
listener
- the new listenervoid addCDockableLocationListener(CDockableLocationListener listener)
listener
- the new listenervoid removeCDockableStateListener(CDockableStateListener listener)
listener
- the listener to removevoid removeCDockablePropertyListener(CDockablePropertyListener listener)
listener
- the listener to removevoid removeCDockableLocationListener(CDockableLocationListener listener)
listener
from this dockable
listener
- the listener to removevoid addFocusListener(CFocusListener listener)
listener
- the new listenervoid removeFocusListener(CFocusListener listener)
listener
- the listener to removevoid addKeyboardListener(CKeyboardListener listener)
listener
- the new listenervoid removeKeyboardListener(CKeyboardListener listener)
listener
- the listener to removevoid addDoubleClickListener(CDoubleClickListener listener)
listener
- the new listenervoid removeDoubleClickListener(CDoubleClickListener listener)
listener
- the listener to removevoid addVetoClosingListener(CVetoClosingListener listener)
CVetoClosingEvent
which contains only this CDockable
(even if
other dockables are closed at the same time).CVetoClosingListener
s added to the CControl
are invoked before listeners that
are added to a CDockable
.
listener
- the new listenerCControl.addVetoClosingListener(CVetoClosingListener)
void removeVetoClosingListener(CVetoClosingListener listener)
listener
from this CDockable
.
listener
- the listener to removeboolean isMinimizable()
CDockable
can be minimized by the user.
true
if this element can be minimizedboolean isMaximizable()
CDockable
can be maximized by the user.
true
if this element can be maximizedboolean isExternalizable()
CDockable
can be externalized by the user.
true
if this element can be externalizedboolean isNormalizeable()
CDockable
can be normalized by the user. Usually this method should
return true
for any dockable, as "normalizing" is the default mode.
true
, unless a subclass requires very special behavior.boolean isStackable()
CDockable
can be combined with another
Dockable
to create a stack.
true
if this element can be combined with
another Dockable
, normally true
should be the answer.boolean isCloseable()
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()
.
true
if this element can be closedboolean isResizeLockedVertically()
CDockable
should remain the same when
its parent changes the size. This has only effect if the parent can
choose the size of its children. A lock is no guarantee for staying
with the same size, the user still can resize this CDockable
.
true
if the height of this CDockable
should remain
the same during resize events of the parent.boolean isResizeLockedHorizontally()
CDockable
should remain the same when
its parent changes the size. This has only effect if the parent can
choose the size of its children. A lock is no guarantee for staying
with the same size, the user still can resize this CDockable
.
true
if the width of this CDockable
should remain
the same during resize events of the parent.RequestDimension getAndClearResizeRequest()
CDockable
. The preferred size
will be used to resize this CDockable
when
CControl.handleResizeRequests()
is called. There are no guarantees
that the request can be granted, or will be handled at all.null
is
returned.
null
void setVisible(boolean visible)
CDockable
. If this CDockable
is not visible and
is made visible, then the framework tries to set its location at the last known position.CControlAccess.show(CDockable)
or CControlAccess.hide(CDockable)
.
visible
- the new visibility state
IllegalStateException
- if this dockable can't be made visibleisVisible()
boolean isVisible()
CDockable
is currently visible or not. Visibility
means that this CDockable
is in the tree structure of DockingFrames and has a parent. Being
in the structure does not imply being visible on the screen: If some
JFrame
is not shown, or some DockStation
not
properly added to a parent component, then a visible CDockable
can
be invisible for the user. For CDockable
s that are also root-CStation
this method will
always return true
.isShowing()
.CControlAccess.isVisible(CDockable)
.
true
if this CDockable
can be accessed by the user
through a graphical user interface.hasParent()
,
isShowing()
boolean hasParent()
CDockable
has a root station as parent. Having a root station as parent
implies isVisible()
. For root-CStation
this method will return false
if they
do not have a parent, they are not considered to be parents of themselves.CControlAccess.hasParent(CDockable)
.
true
if this dockable has a parent and is in the tree@Deprecated @Todo(compatibility=BREAK_MAJOR, priority=ENHANCEMENT, target=VERSION_1_1_3, description="remove this method") boolean isDockableVisible()
isShowing()
, which offers the exact same information. This method
will be removed in a future release
CDockable
is currently visible to the user. A CDockable
which is not visible
, is not dockable visible
either. The method
does not take into account that a frame may be positioned such that it is not entierly visible on the
screen. Neither does the method take into account, that a frame may be minimized.
true
if the user should be able to see this itemboolean isShowing()
CDockable
is currently visible to the user. A CDockable
which is not visible
, is not showing
either. The method
does not take into account that a frame may be positioned such that it is not entierly visible on the
screen. The method may or may not take into account, that a frame may be minimized.CDockableLocationListener
to this dockable.
true
if the user should be able to see this itemCDockableLocationListener
,
addCDockableLocationListener(CDockableLocationListener)
void setLocation(CLocation location)
CDockable
. If this CDockable
is visible, than
this method will take immediately effect. Otherwise the location will be
stored in a cache and read as soon as this CDockable
is made visible.CControlAccess.getLocationManager()
and
CLocationModeManager.setLocation(bibliothek.gui.Dockable, CLocation)
.
location
- the new location, null
is possible, but
will not move the CDockable
immediatelygetBaseLocation()
void setLocationsAside(CDockable dockable)
CDockable
aside dockable
in all ExtendedMode
s. If this
Dockable
is visible, then it may or may not change its location and ExtendedMode
. Note that dockable
and this
must not be the same object, and that both CDockable
s must be registered
at a CControl
.
dockable
- the item whose locations should be copied
IllegalArgumentException
- if dockable
is null
, not registered, the same
as this
, or has a different working area
IllegalStateException
- if this
is not registered at the same CControl
as dockable
boolean setLocationsAside(Filter<CDockable> filter)
CDockable
s, and selects the newest item with focus and matching
filter
for calling setLocationsAside(CDockable)
.
filter
- to select a CDockable
which did have the focus
true
if an old focused Dockable
was found, false
if notboolean setLocationsAsideFocused()
CDockable
with the same working area
as
this
, and calls setLocationsAside(CDockable)
with it.dockable
is visible, then it may or may not change its location. This method
should be called before making the dockable
visible.
true
if the last focused CDockable
was found, false
otherwise. If
false
then no action was performedCLocation getBaseLocation()
CDockable
. If this CDockable
is visible, then
a location will always be returned. Otherwise a location will only
be returned if it just was set using setLocation(CLocation)
.
null
CLocation getAutoBaseLocation(boolean noBackwardsTransformation)
CDockable
may appear if it would be made visible. The default
implementation of this method has severe limitations:
null
CDockable
is associated with a placeholder, then the
placeholder information will be completely lost.CDockable
must not be visible and it must be registered at a CControl
.null
)CDockable
will appear at the exact location that
is returned by this method ignoring any other settings.
noBackwardsTransformation
- if true
, then this method should not convert any DockableProperty
back to a CLocation
, instead it should return null
if such a conversion would be necessary. This
way the method does return null
in any case where information (e.g. placeholders) could be lost
due to the limitations of CLocation
CDockable
, this may either be the location that was set
by calling setLocation(CLocation)
, the last location of this dockable when it was visible, the
default location
of the CControl
or the default location for the
normalized extended mode
. A value of null
is returned if this
CDockable
would appear at a random location, is not registered at a CControl
or is already visible.void setExtendedMode(ExtendedMode extendedMode)
CDockable
should be shown. Conflicts with
isExternalizable()
, isMaximizable()
and isMinimizable()
will just be ignored. Implementations should call LocationModeManager.setMode(Dockable, ExtendedMode)
.extendedMode
.
extendedMode
- the size and locationExtendedMode getExtendedMode()
CDockable
. Implementations should
return LocationModeManager.getMode(Dockable)
.
null
if this CDockable
is not part of an CControl
. May be null
if this dockable is not visible.DockableGrouping getGrouping()
CDockable
attempts to group itself automatically with other Dockable
s.
The algorithm is able to rewrite the location of this CDockable
everytime when it is moved to a new location, assuming
that no stronger mechanism, or the user, already defined a location.
null
void setWorkingArea(CStation<?> area)
CDockable
. This method can be called by the client
or indirectly through setLocation(CLocation)
.
area
- the new parent or null
CStation<?> getWorkingArea()
CDockable
, this should be the same as
set by the last call of setWorkingArea(CStation)
.
null
void setMinimizedSize(Dimension size)
CDockable
when this CDockable
is minimized and
on a popup window.
size
- the sizeDimension getMinimizedSize()
CDockable
is minimzed and
on a popup window. If a value below 0 is set, then the default size
is used.
void setSticky(boolean sticky)
CDockable
should remain visible when minimized
and without focus.
sticky
- whether to remain visibleboolean isSticky()
CDockable
remains visible when minimized and
without focus.
true
if this remains visible, false
otherwisevoid setStickySwitchable(boolean switchable)
isSticky()
property by clicking
on a button that is presented by the FlapDockStation
.
switchable
- whether the user is able to switch the hold propertyboolean isStickySwitchable()
isSticky()
property can be changed by the user
by clicking a button that is displayed on the FlapDockStation
.
true
if the user is able to switch the property, false
otherwiseboolean isTitleShown()
CDockable
shows its title or not. Note that some
DockTheme
s might override this setting.
true
if the title is shown, false
otherwise.boolean isSingleTabShown()
CDockable
. Some
DockTheme
s might ignore this setting.
true
if a single tab should be shown,
false
if notboolean isEnabled(EnableableItem item)
item
- the part to check
item
is enabled, the default result should be true
Component getFocusComponent()
Component
which should receive the focus once this CDockable
is focused.
null
CommonDockable intern()
CDockable
.
CStation<?> asStation()
this
or an object representing this
as
CStation
.
null
@FrameworkOnly void setControlAccess(CControlAccess control)
CControl
which is responsible for this CDockable
. Subclasses
must call CControlAccess.link(CDockable, CDockableAccess)
to grant
the CControl
access to the internal properties of this
CDockable
. link
can also be used to revoke access.
control
- the new control or null
@FrameworkOnly CControlAccess getControlAccess()
CControl getControl()
CDockable
is registered at a CControl
.
null
CStation<?> getParentStation()
CStation
that is a parent of this CDockable
.
null
CAction getAction(String key)
CDockable
put by another module.
key
- the name of the action
null
ColorMap getColors()
FontMap getFonts()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |