bibliothek.gui.dock.action
Class SimpleTypedActionGuard<T extends Dockable>
java.lang.Object
bibliothek.gui.dock.action.TypedActionGuard<T>
bibliothek.gui.dock.action.SimpleTypedActionGuard<T>
- Type Parameters:
T
- the type a Dockable
must have such that this
ActionGuard
reacts
- All Implemented Interfaces:
- ActionGuard
public class SimpleTypedActionGuard<T extends Dockable>
- extends TypedActionGuard<T>
An ActionGuard
that reacts
if the
Dockable
has the exact type that was set through the
constructor
.
- Author:
- Benjamin Sigg
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
source
private DockActionSource source
SimpleTypedActionGuard
public SimpleTypedActionGuard(java.lang.Class<T> type,
DockActionSource source)
- Sets the type and the source of this guard
- Parameters:
type
- The type for which this SimpleTypedActionGuard will react.
The method TypedActionGuard.react(Dockable)
will return true
only
if the Dockable
has this typesource
- The source that will be returned by TypedActionGuard.getSource(Dockable)
getSource
public DockActionSource getSource()
- Gets the
DockActionSource
that will be added to all
Dockables
with the correct type.
- Returns:
- The source
setSource
public void setSource(DockActionSource source)
- Sets the source of this ActionGuard. The source will be returned
by
TypedActionGuard.getSource(Dockable)
and so it will be added to all
Dockables on which this ActionGuard
reacts
.
- Parameters:
source
- The source, not null
getTypedSource
protected DockActionSource getTypedSource(T dockable)
- Description copied from class:
TypedActionGuard
- Gets the
DockActionSource
that will be returned by
getSource
.
- Specified by:
getTypedSource
in class TypedActionGuard<T extends Dockable>
- Parameters:
dockable
- The Dockable
for which a source is required
- Returns:
- The source