com.tarantella.tta.webservices.client.views
Class WebtopGroupContainer

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by com.tarantella.tta.webservices.client.views.WebtopGroupContainer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class WebtopGroupContainer
extends java.util.Vector

The WebtopGroupContainer class manages personalised grouping of assigned applications. The groups can be applied to the generateView... methods on WebtopViewBean to modify the view.

See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_GROUP_NAME
          Name of the default group (ungrouped content).
 
Constructor Summary
WebtopGroupContainer()
          Constructor.
WebtopGroupContainer(java.lang.String name)
          Constructor.
 
Method Summary
 int addGroup(WebtopGroup group)
          Adds a new group to the container.
 int addGroup(WebtopGroup group, int location)
          Adds a new group to the container.
 void clear()
          Clears the contents.
 boolean copyFrom(WebtopGroupContainer source)
          Replaces the contents of the container with those from another.
 Item[] dumpPreferences()
          Gets the data to store as preferences.
 WebtopGroup getDefaultGroup()
          Gets the default group.
 WebtopGroup getGroup(int location)
          Gets the group at the specified location.
 int getGroupCount()
          Gets the number of groups in the container.
 java.lang.String getName()
          Gets the name of the container.
 java.lang.String[] getPreferences()
          Gets the preferences used to store the groupings.
 boolean getValid()
          Gets the valid flag.
 void loadPreferences(java.lang.String xml)
          Loads the data in the XML.
 boolean removeGroup(int location)
          Removes the group at the specified location.
 void setName(java.lang.String name)
          Sets the name of the container.
 void setValid(boolean b)
          Sets the valid flag.
 void stampIt()
          Burns a timestamp into the container.
 boolean stampsDiffer(WebtopGroupContainer other)
          Tests if the timestamps in the containers are the same.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

DEFAULT_GROUP_NAME

public static final java.lang.String DEFAULT_GROUP_NAME
Name of the default group (ungrouped content).

See Also:
Constant Field Values
Constructor Detail

WebtopGroupContainer

public WebtopGroupContainer()
Constructor. Creates an unnamed container and a default group.

Since:
1.0

WebtopGroupContainer

public WebtopGroupContainer(java.lang.String name)
Constructor. Creates a named container and a default group.

Parameters:
name - The name of the assigned applications groupings container.
Since:
1.0
Method Detail

clear

public void clear()
Clears the contents.

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.Vector
Since:
1.0

getPreferences

public java.lang.String[] getPreferences()
Gets the preferences used to store the groupings.

Returns:
The preferences used to store the groupings.
Since:
1.0

loadPreferences

public void loadPreferences(java.lang.String xml)
Loads the data in the XML. The XML is parsed and WebtopGroup groupings are created.

Parameters:
xml - XML representation of the data.
Since:
1.0

dumpPreferences

public Item[] dumpPreferences()
Gets the data to store as preferences.

Returns:
The data to store as preferences.
Since:
1.0

addGroup

public int addGroup(WebtopGroup group)
Adds a new group to the container. The group is added at the end of the container.

Parameters:
group - The assigned applications group.
Returns:
The index of the group in the container.
Since:
1.0

addGroup

public int addGroup(WebtopGroup group,
                    int location)
Adds a new group to the container. The group is added at the specified location.

Parameters:
group - The assigned applications group.
location - The location/index where the group should be stored.
Returns:
The index of the group in the container.
Since:
1.0

removeGroup

public boolean removeGroup(int location)
Removes the group at the specified location.

Parameters:
location - The location/index of the group to be remove.
Returns:
truegroup successfully removed
falsegroup not removed
Since:
1.0

getGroup

public WebtopGroup getGroup(int location)
Gets the group at the specified location.

Parameters:
location - The location/index of the group to be retrieved.
Returns:
The WebtopGroup if successful or null on failure.
Since:
1.0

getGroupCount

public int getGroupCount()
Gets the number of groups in the container.

Returns:
The number of groups in the container.
Since:
1.0

copyFrom

public boolean copyFrom(WebtopGroupContainer source)
Replaces the contents of the container with those from another.

Parameters:
source - The source container.
Returns:
truecontents successfully copied
falsecontents not copied
Since:
1.0

stampIt

public void stampIt()
Burns a timestamp into the container. The timestamp can be used to track changes between copies, for example, by stamping a container after changing its contents.

Since:
1.0

stampsDiffer

public boolean stampsDiffer(WebtopGroupContainer other)
Tests if the timestamps in the containers are the same.

Parameters:
other - The other container.
Returns:
truetimestamps differ
falsetimestamps are the same
Since:
1.0

getName

public java.lang.String getName()
Gets the name of the container.

Returns:
The name of the assigned applications group container.
Since:
1.0

setName

public void setName(java.lang.String name)
Sets the name of the container.

Parameters:
name - The name to set on the assigned applications group container.
Since:
1.0

getDefaultGroup

public WebtopGroup getDefaultGroup()
Gets the default group. The default group is created automatically.

Returns:
The default group.
Since:
1.0

getValid

public boolean getValid()
Gets the valid flag.

Returns:
Validation flag.

setValid

public void setValid(boolean b)
Sets the valid flag.

Parameters:
b - New valid flag value.