|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.control.focus.DefaultFocusRequest
public class DefaultFocusRequest
The default implementation of a FocusRequest, the kind of
request clients usually will use.
| Constructor Summary | |
|---|---|
DefaultFocusRequest(DockElementRepresentative source,
boolean force)
Creates a new request for setting the focused Dockable. |
|
DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force)
Creates a new request for setting the focused Dockable. |
|
DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
Creates a new request for setting the focused Dockable. |
|
DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused,
boolean hardRequest)
Creates a new request for setting the focused Dockable. |
|
| Method Summary | |
|---|---|
boolean |
acceptable(Component component)
Tells whether component would be an acceptable Component to receive
the focus. |
Component |
getComponent()
Gets the Component which may receive the focus. |
int |
getDelay()
Gets a delay in milliseconds, the FocusController will wait executing this
request until the delay has passed. |
DockElementRepresentative |
getSource()
Gets the source of this request. |
FocusVetoListener.FocusVeto |
getVeto()
Tells whether the FocusVetoListeners approved of this request. |
FocusRequest |
grant(Component component)
Called once this FocusRequest is granted, this request must now call
a method like Component.requestFocusInWindow() on component. |
boolean |
isHardRequest()
A hard request is not checked for correctness regarding the visibility
or showing. |
boolean |
validate(FocusController controller)
Invoked by controller right before this request is processed. |
void |
veto(FocusVetoListener.FocusVeto veto)
Informs this request of the result of calling the FocusVetoListeners. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFocusRequest(DockElementRepresentative source,
boolean force)
Dockable.
source - the item to focus, may be nullforce - true if this request must ensure that all properties are correct, false if some
optimations are allowed. Clients normally can set this argument to false.
public DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force)
Dockable.
source - the item to focus, may be nullcomponent - the Component which triggered this request for example because the user clicked with the mouse on it.
This request can assume that the focus will automatically be transfered to component by the Swing framework itself.
Can be null, in which case this request decides on its own which Component to focus. This request 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 request must ensure that all properties are correct, false if some
optimations are allowed. Clients normally can set this argument to false.
public DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused)
Dockable.
source - the item to focus, may be nullcomponent - the Component which triggered this request for example because the user clicked with the mouse on it.
This request can assume that the focus will automatically be transfered to component by the Swing framework itself.
Can be null, in which case this request decides on its own which Component to focus. This request 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 request must ensure that all properties are correct, false if some
optimations are allowed. Clients normally can set this argument to false.ensureFocusSet - if true, then this request should make sure that either source
itself or one of its DockElementRepresentative is the focus ownerensureDockableFocused - if true, then this method should make sure that source
is the focus owner. This parameter is stronger that ensureFocusSet
public DefaultFocusRequest(DockElementRepresentative source,
Component component,
boolean force,
boolean ensureFocusSet,
boolean ensureDockableFocused,
boolean hardRequest)
Dockable.
source - the item to focus, may be nullcomponent - the Component which triggered this request for example because the user clicked with the mouse on it.
This request can assume that the focus will automatically be transfered to component by the Swing framework itself.
Can be null, in which case this request decides on its own which Component to focus. This request 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 request must ensure that all properties are correct, false if some
optimations are allowed. Clients normally can set this argument to false.ensureFocusSet - if true, then this request should make sure that either source
itself or one of its DockElementRepresentative is the focus ownerensureDockableFocused - if true, then this method should make sure that source
is the focus owner. This parameter is stronger that ensureFocusSethardRequest - whether this request should be executed even if the involved Components are not
visible.| Method Detail |
|---|
public DockElementRepresentative getSource()
FocusRequestDockable which receives
the focus, or the Component which received a MouseEvent. The
source will be used to ask the FocusVetoListeners whether to accept this
request or not.
getSource in interface FocusRequestnullpublic Component getComponent()
FocusRequestComponent which may receive the focus. This is no necessarily the
Component that gains the focus because the FocusStrategy may choose
another Component. This Component may be not focusable, not visible,
not showing, or not valid in any other respect. It is the FocusController's job
to correct such issues.
getComponent in interface FocusRequestComponent which may receive the focus, can be nullpublic int getDelay()
FocusRequestFocusController will wait executing this
request until the delay has passed.
getDelay in interface FocusRequestpublic boolean isHardRequest()
FocusRequestvisibility
or showing. These requests can be executed even if the application
is not yet visible.
isHardRequest in interface FocusRequestComponents are not
visiblepublic boolean acceptable(Component component)
FocusRequestcomponent would be an acceptable Component to receive
the focus. This method usually is called when FocusRequest.getComponent() returned an invalid
Component (e.g. null or a component that is not focusable) and that
Component gets replaced.
acceptable in interface FocusRequestcomponent - the component that might gain the focus
true if this request approves on component replacing
the result of FocusRequest.getComponent()public boolean validate(FocusController controller)
FocusRequestcontroller right before this request is processed. The method
checks whether this request is still valid, e.g. a request may no longer be valid because
it points to a Dockable that is no longer visible.
validate in interface FocusRequestcontroller - the controller which will process this request
true if this request is valid, false if this request is
invalid and should be ignoredpublic void veto(FocusVetoListener.FocusVeto veto)
FocusRequestFocusVetoListeners. This method is called
after FocusRequest.validate(FocusController).
veto in interface FocusRequestveto - the veto that was cast, including no vetopublic FocusVetoListener.FocusVeto getVeto()
FocusVetoListeners approved of this request.
nullpublic FocusRequest grant(Component component)
FocusRequestFocusRequest is granted, this request must now call
a method like Component.requestFocusInWindow() on component.
grant in interface FocusRequestcomponent - the Component which gains the focus. Usually this
Component is valid in the sense of that it is focusable, visible and
showing. There are no guarantees for this properties tough.
FocusRequest that will be executed. If the result of
FocusRequest.getSource() of this and of the result matches, and if the
result of FocusRequest.getComponent() is the same as component, then
the FocusController will accept the request without calling neither
FocusVetoListener nor FocusStrategy. In any other case the request
will be treated like a completely new request. The result of this method can also
be null. The result of this method can also by this.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||