com.pietschy.command.group.impl
Class EmbeddedContribution

java.lang.Object
  extended by com.pietschy.command.group.impl.AbstractCommandContribution
      extended by com.pietschy.command.group.impl.CommandContribution
          extended by com.pietschy.command.group.impl.EmbeddedContribution
All Implemented Interfaces:
Contribution

public class EmbeddedContribution
extends CommandContribution

A contribution that attempts to adds it's member to a matching child of the parent group. If matches aren't found, the member is added to the parent groups expansion point.


Constructor Summary
EmbeddedContribution(CommandGroup command, java.util.Comparator<CommandGroup> groupComparator)
          Creates a new instance.
 
Method Summary
 CommandGroup getCommand()
          Returns the command this contribution is adding.
 void performAdd(CommandGroup parent, ExpansionPointMember expansionMember)
          Adds the specified this contribution the specified group.
 void performRemove(CommandGroup parent, ExpansionPointMember expansionMember)
          Removes the specified this contribution the specified group.
 
Methods inherited from class com.pietschy.command.group.impl.CommandContribution
toString
 
Methods inherited from class com.pietschy.command.group.impl.AbstractCommandContribution
isContributionFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EmbeddedContribution

public EmbeddedContribution(CommandGroup command,
                            java.util.Comparator<CommandGroup> groupComparator)
Creates a new instance.

Parameters:
command - the command to add.
groupComparator - the commarator to use embedding the command.
Method Detail

getCommand

public CommandGroup getCommand()
Description copied from class: AbstractCommandContribution
Returns the command this contribution is adding.

Overrides:
getCommand in class AbstractCommandContribution
Returns:
the command this contribution is adding.

performAdd

public void performAdd(CommandGroup parent,
                       ExpansionPointMember expansionMember)
Description copied from interface: Contribution
Adds the specified this contribution the specified group.

Specified by:
performAdd in interface Contribution
Overrides:
performAdd in class CommandContribution
Parameters:
parent - the parent group.
expansionMember - the expansion point member of the group.

performRemove

public void performRemove(CommandGroup parent,
                          ExpansionPointMember expansionMember)
Description copied from interface: Contribution
Removes the specified this contribution the specified group.

Specified by:
performRemove in interface Contribution
Overrides:
performRemove in class CommandContribution
Parameters:
parent - the parent group.
expansionMember - the expansion point member of the group.


Copyright © 2006 - 2007 Andrew Pietsch