|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Dockable
A dockable is an object that can be moved around and docked in a Dock
.
It contains a graphical component as content. This content should be set once and never be changed.
Information on using dockables is in How to Use Dockables in The Sanaware Developer Guide. Information on adding, moving, and removing dockables is in How to Add, Move, and Remove Dockables.
The purpose of the docks and dockables is to organize and move the graphical content components of the application. Docks are in a fixed position. They can receive dockables. The dockables are moved with their content from dock to dock.
All the dockables in the application should have a different ID. Implementations of this class should
overwrite Object.equals(java.lang.Object)
. Dockables are equal if their ID is equal.
Method Summary | |
---|---|
void |
addDockingListener(DockingListener listener)
Adds a listener for docking events of this dockable. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a java.beans.PropertyChangeListener. |
void |
fireDockingChanged(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
void |
fireDockingWillChange(DockableEvent dockableEvent)
Notifies all listeners that have registered interest for notification on this event type. |
javax.swing.Action[][] |
getActions()
Gets a matrix with the actions for the dockable. |
java.awt.Component |
getContent()
Gets the content of the dockable. |
java.lang.String |
getDescription()
Gets the description of the dockable. |
LeafDock |
getDock()
Gets the dock in which the dockable is docked. |
int |
getDockingModes()
Gets the modes how this dockable can be docked. |
javax.swing.Icon |
getIcon()
Gets the icon of the dockable. |
java.lang.String |
getID()
Gets the ID of the dockable. |
int |
getLastDockingMode()
Gets the mode how the dockable is docked in its current dock or how it was docked the last time it was in a dock. |
int |
getPossibleStates()
Gets the possible states of the dockable. |
int |
getState()
Gets the state of the dockable. |
java.lang.String |
getTitle()
Gets the title of the dockable. |
java.lang.Object |
getVisualizer()
Gets the object that currently shows the content of the dockable. |
boolean |
isWithHeader()
Returns whether the dockable will have a header when it is docked alone. |
void |
removeDockingListener(DockingListener listener)
Removes a listener for docking events of this dockable. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a java.beans.PropertyChangeListener. |
void |
setDock(LeafDock dock)
Sets the dock in which the dockable is docked. |
void |
setLastDockingMode(int dockingMode)
Sets the mode how the dockable is docked in its current dock or how it was docked the last time it was in a dock. |
void |
setState(int state,
java.lang.Object visualizer)
Tries to set the new state of the dockable. |
Method Detail |
---|
java.lang.String getID()
void setDock(LeafDock dock)
dock
- The dock in which the dockable is docked.
This can be null, if the dockable is not docked.LeafDock getDock()
java.awt.Component getContent()
java.lang.String getTitle()
java.lang.String getDescription()
javax.swing.Icon getIcon()
int getDockingModes()
Gets the modes how this dockable can be docked. The integer should be a combination of constants defined by DockingMode
.
Combinations of the different modes are made by using the bitwise or-operator.
DockingMode
.void setLastDockingMode(int dockingMode)
dockingMode
- The mode how the dockable is docked in its current dock or how it was docked the last time it was
in a dock. This integer should be a constant defined by DockingMode
.int getLastDockingMode()
DockingMode
.boolean isWithHeader()
int getState()
DockableState
.void setState(int state, java.lang.Object visualizer)
getPossibleStates()
.
state
- The new state of the dockable. This should be a constant defined by DockableState
.visualizer
- The object that currently shows the content of the dockable.
Can be null, i.e. when the state of the dockable is DockableState.CLOSED
.int getPossibleStates()
DockableState
.
A combination is made by the bitwise or-operation on the integer constants.
java.lang.Object getVisualizer()
DockableState.CLOSED
.
javax.swing.Action[][] getActions()
Gets a matrix with the actions for the dockable.
These actions can be displayed in a tool bar in the header of the dockable. They can also be displayed in a popup menu, that appears when right clicking on the header of a dockable.
The actions of the different rows are divided in the tool bar or in the popup menu.
In some headers i.e. in tabs, there is not enough space to display all the actions. In that case only the first row of actions is displayed.
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
dock
property.
listener
- The property change listener to be added.void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener to be removedvoid addDockingListener(DockingListener listener)
listener
- A docking listener that will be notified, when this dockable is added, moved, or removed.void removeDockingListener(DockingListener listener)
listener
- A docking listener to remove.void fireDockingWillChange(DockableEvent dockableEvent)
dockableEvent
- Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.void fireDockingChanged(DockableEvent dockableEvent)
dockableEvent
- Gives more information about the origin dock, the destination dock,
and the object whose docking state changed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |