T
- the type of Dockables
on which this
ActionGuard
will reactpublic abstract class TypedActionGuard<T extends Dockable> extends java.lang.Object implements ActionGuard
ActionGuard
reacts only on Dockables
with a given type.Constructor and Description |
---|
TypedActionGuard(java.lang.Class<T> type)
Constructs the TypedActionGuard and sets the type to react on.
|
Modifier and Type | Method and Description |
---|---|
DockActionSource |
getSource(Dockable dockable)
Gets a list of actions for the
Dockable |
protected abstract DockActionSource |
getTypedSource(T dockable)
Gets the
DockActionSource that will be returned by
getSource . |
boolean |
react(Dockable dockable)
|
public TypedActionGuard(java.lang.Class<T> type)
type
- The type on which this guard will reactpublic boolean react(Dockable dockable)
ActionGuard
Dockable
and tells whether this
ActionGuard is interested in it and wants to add some additional
actions
to it, or if this guard
is not made for the dockable
.react
in interface ActionGuard
dockable
- The Dockable
to testtrue
if the ActionGuard.getSource(Dockable)
-method
should be invoked, false
otherwisepublic DockActionSource getSource(Dockable dockable)
ActionGuard
Dockable
getSource
in interface ActionGuard
dockable
- The Dockable
for which ActionGuard.react(Dockable)
is true
dockable
.protected abstract DockActionSource getTypedSource(T dockable)
DockActionSource
that will be returned by
getSource
.dockable
- The Dockable
for which a source is required