|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.control.focus.AbstractFocusController
bibliothek.gui.dock.control.DefaultFocusController
public class DefaultFocusController
Default implementation of FocusController.
| Constructor Summary | |
|---|---|
DefaultFocusController(DockController controller)
Creates a new focus-controller |
|
| Method Summary | |
|---|---|
protected Component |
accept(FocusRequest request,
Dockable dockable)
Decides whether to execute or to refuse request. |
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. |
protected void |
execute(FocusRequest request,
Dockable dockable,
Component component)
Called if accept(FocusRequest, Dockable) accepted request. |
void |
focus(FocusRequest request)
Requests focus for the Component that is described by request. |
Dockable |
getFocusedDockable()
Gets the Dockable which is currently focused. |
boolean |
isOnFocusing()
Tells whether one of the methods which change the focus is currently running, or not. |
void |
onFocusRequestCompletion(Runnable run)
After the currently executed FocusRequest is completed, or if there is currently no FocusRequest running,
run is executed. |
FocusVetoListener.FocusVeto |
setFocusedDockable(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
Sets the Dockable which should have the focus. |
| Methods inherited from class bibliothek.gui.dock.control.focus.AbstractFocusController |
|---|
addDockableFocusListener, addVetoListener, dockableFocusListeners, fireDockableFocused, fireVetoDockable, fireVetoTitle, freezeFocus, getController, getStrategy, isFrozen, meltFocus, removeDockableFocusListener, removeVetoListener, setStrategy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFocusController(DockController controller)
controller - the owner of this controller| Method Detail |
|---|
public boolean isOnFocusing()
FocusControllertrue, noone should
change the focus.
true if the focus is currently changingpublic Dockable getFocusedDockable()
FocusControllerDockable which is currently focused.
nullpublic FocusVetoListener.FocusVeto checkFocusedDockable(DockElementRepresentative source)
FocusControllersource can be used to select the next focused Dockable.
source - the element which may be focused
null indicates that
source does not represent a Dockable
public FocusVetoListener.FocusVeto setFocusedDockable(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
FocusControllerDockable 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 FocusController.isOnFocusing() returned
true and the call was ignoredpublic void ensureFocusSet(boolean dockableOnly)
FocusControllerComponent of the currently
focused Dockable really
has the focus.
dockableOnly - if true, then only the Dockable itself
should be focusedpublic void focus(FocusRequest request)
Component that is described by request. The request is either
executed now (if delay is 0) or in the near future. The request may be canceled either
because another request is executed first, because of a FocusVetoListener, or because the request contains
invalid data.
request - the requestpublic void onFocusRequestCompletion(Runnable run)
FocusControllerFocusRequest 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 focusedFocusController.focus(FocusRequest)
protected Component accept(FocusRequest request,
Dockable dockable)
request.
request - the request to checkdockable - the dockable that would receive the focus through this request
Component or null if the
request is to be refused
protected void execute(FocusRequest request,
Dockable dockable,
Component component)
accept(FocusRequest, Dockable) accepted request.
request - the request to executedockable - the element that will receive the focuscomponent - the Component that is to be focused
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||