|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.group.impl.AbstractGroupMember
com.pietschy.command.group.impl.DynamicMember
public class DynamicMember
Dynamic members are used handle commands and groups that are specified only by their id. This means all members loaded from configuration files are managed by dynamic members.
Dynamic members continually monitor the command container hierarchy and update accordingly.
When the actual member is located that task of managing it is delegated to
instances of StaticMember and InlineMember.
| Constructor Summary | |
|---|---|
DynamicMember(CommandGroup parent,
java.lang.String commandId,
boolean inlineGroup)
Creates a new member for the group with the specified id. |
|
| Method Summary | |
|---|---|
void |
acceptVisitor(GroupVisitor visitor)
Accepts a visitor to the members command or commands. |
int |
addComponentTo(javax.swing.JComponent container,
Factory factory,
java.lang.String defaultFaceId,
java.util.List<java.awt.Component> previousComponents,
int buttonIndex)
Invoked to add this members content to the specified component. |
void |
addNotify()
Invoked to notify that this member has been added to its parent group. |
java.lang.Object |
getId()
Gets this members id. |
(package private) GroupMember |
getRealGroupMember()
|
(package private) boolean |
isAddedToParent()
Checks if the member has already been added to it's parent group. |
(package private) boolean |
isInline()
Checks if this member represents an inline group. |
boolean |
isMemberFor(java.lang.String id)
Checks if this member represents the command with the specified id. |
(package private) GroupMember |
lookupRealMember(CommandGroup parentGroup,
java.lang.String commandId)
Attempts to retreive the command that this member represents. |
void |
notifyCommandContainerHierarchyChanged()
Clears the current member and causes it to scan the container hierarchy again. |
void |
removeNotify()
Invoked to notify that this member has been removed from its parent group. |
boolean |
reset()
Returns true if the member changed as a result of the reset. |
protected boolean |
resolved()
Ensures this members command has been resolved from the container hierarchy. |
int |
size()
Returns the size of this member. |
java.lang.String |
toString()
Returns a string representation of the object. |
| Methods inherited from class com.pietschy.command.group.impl.AbstractGroupMember |
|---|
addChangeListener, fireChanged, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DynamicMember(CommandGroup parent,
java.lang.String commandId,
boolean inlineGroup)
parent - the parent group.commandId - the command id to track and addinlineGroup - true if the group is to be inlined, false otherwise.| Method Detail |
|---|
public java.lang.Object getId()
GroupMember
GroupMember getRealGroupMember()
public int addComponentTo(javax.swing.JComponent container,
Factory factory,
java.lang.String defaultFaceId,
java.util.List<java.awt.Component> previousComponents,
int buttonIndex)
GroupMember
container - the component to add the component to.factory - the factory to be used, either a ButtonFactory or MenuFactory.defaultFaceId - the context to use when adding the component.previousComponents - the list of previsous components built by the parent. The member
should reuse and components in preference to creating new ones.buttonIndex - the index that of the member in the parent group.
protected boolean resolved()
true if this member has been resolved and has a command to insert, false if
no command has been located.
GroupMember lookupRealMember(CommandGroup parentGroup,
java.lang.String commandId)
parentGroup - the parent group.commandId - the command id to locate.
Command this member respresents, or null if it isn't available.public boolean isMemberFor(java.lang.String id)
GroupMember
id - the command id.
true if this member represents the specified command, false otherwise.boolean isInline()
true if this member represents an inline group, false otherwise.boolean isAddedToParent()
true if this member has already been added to its parent
group, false otherwise.public void notifyCommandContainerHierarchyChanged()
notifyCommandContainerHierarchyChanged in interface GroupMembernotifyCommandContainerHierarchyChanged in class AbstractGroupMemberpublic boolean reset()
true if the member changed as a result of the reset.
public int size()
resolved() this method returns 0, if isInline()
it returns the size of the inlined group, otherwise it returns 1.
public void acceptVisitor(GroupVisitor visitor)
GroupMember
visitor - the visitor.public void addNotify()
GroupMember
public void removeNotify()
GroupMember
public java.lang.String toString()
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||