public abstract class AbstractFocusController extends java.lang.Object implements FocusController
FocusController
offering methods to
handle the listeners.Constructor and Description |
---|
AbstractFocusController(DockController controller)
Creates a new focus controller
|
Modifier and Type | Method and Description |
---|---|
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 . |
protected DockableFocusListener[] |
dockableFocusListeners()
Gets an array of currently registered
DockableFocusListener s. |
protected void |
fireDockableFocused(Dockable oldFocused,
Dockable newFocused)
Informs all listeners that
dockable has gained
the focus. |
protected FocusVetoListener.FocusVeto |
fireVetoDockable(Dockable dockable)
Asks all
FocusVetoListener through their method
FocusVetoListener.vetoFocus(FocusController, Dockable)
whether they want cancel a call to the DockController . |
protected FocusVetoListener.FocusVeto |
fireVetoTitle(DockTitle title)
Asks all
FocusVetoListener through their method
FocusVetoListener.vetoFocus(FocusController, DockTitle)
whether they want cancel a call to the DockController . |
void |
freezeFocus()
Temporarily disables this
FocusController . |
DockController |
getController()
Gets the
DockController whose Dockable s are tracked by this observer. |
FocusStrategy |
getStrategy()
Gets the strategy that selects the
Component s to focus. |
protected boolean |
isFrozen()
Tells whether this
FocusController is temporarily frozen and should
not process any events. |
void |
meltFocus()
Re-enables this
FocusController after it was temporarily disabled. |
void |
removeDockableFocusListener(DockableFocusListener listener)
Removes a listener from this controller.
|
void |
removeVetoListener(FocusVetoListener listener)
Removes a listener from this controller
|
void |
setStrategy(FocusStrategy strategy)
Sets the strategy which will be used to focus components.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkFocusedDockable, ensureFocusSet, focus, getFocusedDockable, isOnFocusing, onFocusRequestCompletion, setFocusedDockable
public AbstractFocusController(DockController controller)
controller
- the owner of this controller, not null
public void setStrategy(FocusStrategy strategy)
FocusController
setStrategy
in interface FocusController
strategy
- the new strategy, can be null
public FocusStrategy getStrategy()
FocusController
Component
s to focus.getStrategy
in interface FocusController
null
public void freezeFocus()
FocusController
FocusController
. Any call that would lead to a change
in the focus is silently ignored.freezeFocus
in interface FocusController
public void meltFocus()
FocusController
FocusController
after it was temporarily disabled.meltFocus
in interface FocusController
protected boolean isFrozen()
FocusController
is temporarily frozen and should
not process any events.true
if disabledpublic void addVetoListener(FocusVetoListener listener)
DockController
.addVetoListener
in interface FocusController
listener
- the new listenerpublic void removeVetoListener(FocusVetoListener listener)
removeVetoListener
in interface FocusController
listener
- the listener to removeprotected FocusVetoListener.FocusVeto fireVetoTitle(DockTitle title)
FocusVetoListener
through their method
FocusVetoListener.vetoFocus(FocusController, DockTitle)
whether they want cancel a call to the DockController
.title
- the title which is about to be focusedprotected FocusVetoListener.FocusVeto fireVetoDockable(Dockable dockable)
FocusVetoListener
through their method
FocusVetoListener.vetoFocus(FocusController, Dockable)
whether they want cancel a call to the DockController
.dockable
- the Dockable which is about to be focusedpublic DockController getController()
FocusController
DockController
whose Dockable
s are tracked by this observer.getController
in interface FocusController
public void addDockableFocusListener(DockableFocusListener listener)
Dockable
changes.addDockableFocusListener
in interface FocusController
listener
- the new listenerpublic void removeDockableFocusListener(DockableFocusListener listener)
removeDockableFocusListener
in interface FocusController
listener
- the listener to removeprotected DockableFocusListener[] dockableFocusListeners()
DockableFocusListener
s.