com.flexive.shared.structure
Class FxGroupEdit

java.lang.Object
  extended by com.flexive.shared.structure.FxStructureElement
      extended by com.flexive.shared.structure.FxGroup
          extended by com.flexive.shared.structure.FxGroupEdit
All Implemented Interfaces:
SelectableObject, SelectableObjectWithName, java.io.Serializable

public class FxGroupEdit
extends FxGroup

FxGroup used for structure editing

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.flexive.shared.structure.FxStructureElement
hint, label, multiplicity, name, options, overrideMultiplicity, referenced
 
Constructor Summary
FxGroupEdit(FxGroup group)
          Make an editable instance of an existing group
 
Method Summary
 void clearOption(java.lang.String key)
          Clear an option entry
static FxGroupEdit createNew(FxGroup base, java.lang.String newName)
          Create a clone of an existing group with a new name
static FxGroupEdit createNew(java.lang.String name, FxString description, FxString hint, boolean overrideBaseMultiplicity, FxMultiplicity multiplicity)
          Create a new FxGroupEdit instance
 int getAssignmentDefaultMultiplicity()
          Get the created assignments default multiplicity
 GroupMode getAssignmentGroupMode()
          Get the group mode if this GroupEdit is for a new group and assignment is to be created
 boolean isNew()
          Is this a new group
 FxGroupEdit setAssignmentDefaultMultiplicity(int defaultMultiplicity)
          This value set will only be used when creating a new property and will be set for the created assignment! Set the default multiplicity (used i.e.
 FxGroupEdit setAssignmentGroupMode(GroupMode mode)
          Set the group mode.
 FxGroupEdit setHint(FxString hint)
          Set the hint message
 FxGroupEdit setLabel(FxString label)
          Set the label
 FxGroupEdit setMultiplicity(FxMultiplicity multiplicity)
          Set the multiplicity
 FxGroupEdit setName(java.lang.String name)
          Set the name for the group
 FxGroupEdit setOption(java.lang.String key, boolean overrideable, boolean value)
          Set a boolean option
 FxGroupEdit setOption(java.lang.String key, boolean overrideable, java.lang.String value)
          Set an option
 FxGroupEdit setOverrideMultiplicity(boolean overrideMultiplicity)
          May the base multiplicity be overridden?
 
Methods inherited from class com.flexive.shared.structure.FxGroup
asEditable
 
Methods inherited from class com.flexive.shared.structure.FxStructureElement
getHint, getId, getLabel, getMultiplicity, getName, getOption, getOptions, hasOption, isReferenced, mayOverrideBaseMultiplicity, setReferenced
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxGroupEdit

public FxGroupEdit(FxGroup group)
Make an editable instance of an existing group

Parameters:
group - existing group
Method Detail

createNew

public static FxGroupEdit createNew(FxGroup base,
                                    java.lang.String newName)
Create a clone of an existing group with a new name

Parameters:
base - group to clone
newName - new name to assign
Returns:
FxGroupEdit

createNew

public static FxGroupEdit createNew(java.lang.String name,
                                    FxString description,
                                    FxString hint,
                                    boolean overrideBaseMultiplicity,
                                    FxMultiplicity multiplicity)
Create a new FxGroupEdit instance

Parameters:
name - group name
description - description
hint - hint message
overrideBaseMultiplicity - allow base multiplicity override?
multiplicity - multiplicity
Returns:
FxGroupEdit

isNew

public boolean isNew()
Is this a new group

Returns:
if this is a new group

setName

public FxGroupEdit setName(java.lang.String name)
Set the name for the group

Parameters:
name - group name
Returns:
this
Throws:
FxRuntimeException - on errors

setAssignmentGroupMode

public FxGroupEdit setAssignmentGroupMode(GroupMode mode)
                                   throws FxInvalidParameterException
Set the group mode. Only possible for new groups to reflect it to the new assignment

Parameters:
mode - group mode
Returns:
this
Throws:
FxInvalidParameterException - if group is not new

getAssignmentGroupMode

public GroupMode getAssignmentGroupMode()
Get the group mode if this GroupEdit is for a new group and assignment is to be created

Returns:
group mode

setLabel

public FxGroupEdit setLabel(FxString label)
Set the label

Parameters:
label - the label
Returns:
this

setHint

public FxGroupEdit setHint(FxString hint)
Set the hint message

Parameters:
hint - hint message
Returns:
this

setMultiplicity

public FxGroupEdit setMultiplicity(FxMultiplicity multiplicity)
Set the multiplicity

Parameters:
multiplicity - multiplicity
Returns:
this

setOverrideMultiplicity

public FxGroupEdit setOverrideMultiplicity(boolean overrideMultiplicity)
May the base multiplicity be overridden?

Parameters:
overrideMultiplicity - may the base multiplicity be overridden?
Returns:
this

setOption

public FxGroupEdit setOption(java.lang.String key,
                             boolean overrideable,
                             java.lang.String value)
Set an option

Parameters:
key - option key
overrideable - is the option overrideable from assignments?
value - value of the option
Returns:
the group itself, useful for chained calls

setOption

public FxGroupEdit setOption(java.lang.String key,
                             boolean overrideable,
                             boolean value)
Set a boolean option

Parameters:
key - option key
overrideable - is the option overrideable from assignments?
value - value of the option
Returns:
the group itself, useful for chained calls

clearOption

public void clearOption(java.lang.String key)
Clear an option entry

Parameters:
key - option name

setAssignmentDefaultMultiplicity

public FxGroupEdit setAssignmentDefaultMultiplicity(int defaultMultiplicity)
This value set will only be used when creating a new property and will be set for the created assignment! Set the default multiplicity (used i.e. in user interfaces editors and determines the amount of values that will be initialized when creating an empty element).

If the set value is < min or > max multiplicity of this assignment it will be auto adjusted to the next valid value without throwing an exception

Parameters:
defaultMultiplicity - the default multiplicity
Returns:
this

getAssignmentDefaultMultiplicity

public int getAssignmentDefaultMultiplicity()
Get the created assignments default multiplicity

Returns:
default multiplicity