be.ugent.caagt.swirl.commands
Class AttributedCommandManager
CommandManager
be.ugent.caagt.swirl.commands.AttributedCommandManager
public class AttributedCommandManager
extends CommandManager
Extension of
CommandManager
that uses an
AttributedContext
as context.
This class also provides helper methods for retrieving and setting attributes in this context.
Note: Currently a face builder of type
FaceBuilder
is automatically registered
with every newly created object of this type. This functionality will be removed from this
package as soon as it is integrated in a new version of the GUI commands framework.
Important note: work on this part of the Swirl library will be
discontinued because unfortunately newer versions
of the
GUI commands framework will no longer be available as
open source.
In due course this class will become deprecated and will eventually be
removed from the library.
AttributedCommandManager
public AttributedCommandManager()
Create a command manager of this type without parent and with a newly
created context of type
AttributedContext
.
AttributedCommandManager
public AttributedCommandManager(AttributedContext context)
Create a command manager of this type without parent and with the given
context.
getAttribute
public Object getAttribute(String key)
Retrieve a value for a given attribute. Looks for the attribute first
in the current context and then in the context of each ancestor in turn.
Returns the firstvaue found or null
when the attribute does not exist
in any of these contexts.
getContext
public AttributedContext getContext()
Returns the context of this command manager. (Overridden to return the
correct type.)
getParent
public AttributedCommandManager getParent()
Returns the parent of this command manager. (Overridden to return the
correct type.)
setAttribute
public void setAttribute(String key,
Object value)
Sets a new value for a given attribute. Convenience method which simply
delegates to the context.