be.ugent.caagt.swirl.commands

Class 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.

Constructor Summary

AttributedCommandManager()
Create a command manager of this type without parent and with a newly created context of type AttributedContext.
AttributedCommandManager(AttributedCommandManager parent)
Create a command manager of this type with given parent and a newly created context of type AttributedContext.
AttributedCommandManager(AttributedCommandManager parent, AttributedContext context)
Create a command manager of this type with given parent and context.
AttributedCommandManager(AttributedContext context)
Create a command manager of this type without parent and with the given context.

Method Summary

Object
getAttribute(String key)
Retrieve a value for a given attribute.
AttributedContext
getContext()
Returns the context of this command manager.
AttributedCommandManager
getParent()
Returns the parent of this command manager.
void
setAttribute(String key, Object value)
Sets a new value for a given attribute.

Constructor Details

AttributedCommandManager

public AttributedCommandManager()

AttributedCommandManager

public AttributedCommandManager(AttributedCommandManager parent)
Create a command manager of this type with given parent and a newly created context of type AttributedContext.

AttributedCommandManager

public AttributedCommandManager(AttributedCommandManager parent,
                                AttributedContext context)
Create a command manager of this type with given parent and context.

AttributedCommandManager

public AttributedCommandManager(AttributedContext context)
Create a command manager of this type without parent and with the given context.

Method Details

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.