|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FocusRequest
A FocusRequest
can be sent to the FocusController
in order for a
Component
to gain the focus. Whether the request is granted depends on the
FocusController
. A FocusRequest
does not necessarily need to point
to a specific Component
, it can also point e.g. to a Dockable
telling
that one of its child Component
s should be focused.
A FocusRequest
can have a delay
, meaning it will be executed
not right away but at a later time. Hence it is possible for a FocusRequest
to
be overtaken by another request. In such a case the request that is executed first
wins and cancels the other request.
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. |
FocusRequest |
grant(Component component)
Called once this FocusRequest is granted, this request must now call
a method like Component.requestFocusInWindow() on component . |
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 FocusVetoListener s. |
Method Detail |
---|
int getDelay()
FocusController
will wait executing this
request until the delay has passed.
boolean validate(FocusController controller)
controller
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.
controller
- the controller which will process this request
true
if this request is valid, false
if this request is
invalid and should be ignoredvoid veto(FocusVetoListener.FocusVeto veto)
FocusVetoListener
s. This method is called
after validate(FocusController)
.
veto
- the veto that was cast, including no veto
DockElementRepresentative getSource()
Dockable
which receives
the focus, or the Component
which received a MouseEvent
. The
source will be used to ask the FocusVetoListener
s whether to accept this
request or not.
null
Component getComponent()
Component
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.
Component
which may receive the focus, can be null
boolean acceptable(Component component)
component
would be an acceptable Component
to receive
the focus. This method usually is called when getComponent()
returned an invalid
Component
(e.g. null
or a component that is not focusable) and that
Component
gets replaced.
component
- the component that might gain the focus
true
if this request approves on component
replacing
the result of getComponent()
FocusRequest grant(Component component)
FocusRequest
is granted, this request must now call
a method like Component.requestFocusInWindow()
on component
.
component
- 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
getSource()
of this
and of the result matches, and if the
result of 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 |