|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FocusController
The FocusController is responsible for transfering focus between Dockables.
| Method Summary | |
|---|---|
void |
addDockableFocusListener(DockableFocusListener listener)
Adds a listener to this controller, the listener will be informed when the focused Dockable changes. |
void |
addVetoListener(FocusVetoListener listener)
Adds a listener to this controller which can cancel a call to the DockController. |
FocusVetoListener.FocusVeto |
checkFocusedDockable(DockElementRepresentative source)
Checks whether source can be used to select the next focused Dockable. |
void |
ensureFocusSet(boolean dockableOnly)
Ensures that a title or a Component of the currently
focused Dockable really
has the focus. |
void |
focus(FocusRequest request)
Sets the Dockable which should have the focus. |
void |
freezeFocus()
Temporarily disables this FocusController. |
DockController |
getController()
Gets the DockController whose Dockables are tracked by this observer. |
Dockable |
getFocusedDockable()
Gets the Dockable which is currently focused. |
FocusStrategy |
getStrategy()
Gets the strategy that selects the Components to focus. |
boolean |
isOnFocusing()
Tells whether one of the methods which change the focus is currently running, or not. |
void |
meltFocus()
Re-enabls this FocusController after it was temporarily disabled. |
void |
onFocusRequestCompletion(Runnable run)
After the currently executed FocusRequest is completed, or if there is currently no FocusRequest running,
run is executed. |
void |
removeDockableFocusListener(DockableFocusListener listener)
Removes a listener from this controller. |
void |
removeVetoListener(FocusVetoListener listener)
Removes a listener from this controller |
FocusVetoListener.FocusVeto |
setFocusedDockable(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
Deprecated. this method will be replaced by focus(FocusRequest) |
void |
setStrategy(FocusStrategy strategy)
Sets the strategy which will be used to focus components. |
| Method Detail |
|---|
DockController getController()
DockController whose Dockables are tracked by this observer.
void addVetoListener(FocusVetoListener listener)
DockController.
listener - the new listenervoid removeVetoListener(FocusVetoListener listener)
listener - the listener to removevoid addDockableFocusListener(DockableFocusListener listener)
Dockable changes.
listener - the new listenervoid removeDockableFocusListener(DockableFocusListener listener)
listener - the listener to removevoid freezeFocus()
FocusController. Any call that would lead to a change
in the focus is silently ignored.
void meltFocus()
FocusController after it was temporarily disabled.
void setStrategy(FocusStrategy strategy)
strategy - the new strategy, can be nullFocusStrategy getStrategy()
Components to focus.
nullDockable getFocusedDockable()
Dockable which is currently focused.
nullboolean isOnFocusing()
true, noone should
change the focus.
true if the focus is currently changingFocusVetoListener.FocusVeto checkFocusedDockable(DockElementRepresentative source)
source can be used to select the next focused Dockable.
source - the element which may be focused
null indicates that
source does not represent a Dockablevoid ensureFocusSet(boolean dockableOnly)
Component of the currently
focused Dockable really
has the focus.
dockableOnly - if true, then only the Dockable itself
should be focused
@Deprecated
@Todo(compatibility=BREAK_MAJOR,
description="remove this method",
priority=ENHANCEMENT,
target=VERSION_1_1_3)
FocusVetoListener.FocusVeto setFocusedDockable(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
focus(FocusRequest)
Dockable which should have the focus.
source - the item to focus, may be nullcomponent - the Component which triggered this call for example because the user clicked with the mouse on it.
This method can assume that the focus will automatically be transfered to component by the Swing framework itself.
Can be null, in which case this method decides on its own which Component to focus. This method may or may
not do sanity checks concerning component. An invalid argument will silently be ignored and treated
as if it would be null.force - true if this controller must ensure
that all properties are correct, false if some
optimizations are allowed. Clients normally can set this argument
to false.ensureFocusSet - if true, then this method should make sure that either focusedDockable
itself or one of its DockElementRepresentative is the focus ownerensureDockableFocused - if true, then this method should make sure that focusedDockable
is the focus owner. This parameter is stronger that ensureFocusSet
null indicates that isOnFocusing() returned
true and the call was ignoredvoid focus(FocusRequest request)
Dockable which should have the focus.
request - information about the Dockable that should receive the focus, must not be nullvoid onFocusRequestCompletion(Runnable run)
FocusRequest is completed, or if there is currently no FocusRequest running,
run is executed. If this controller is frozen, then run is executed
Immediately.
run - some code to execute once a new Dockable has been focusedfocus(FocusRequest)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||