com.tensegrity.gui.swt
Class SwtUIItemEvaluationList

java.lang.Object
  extended bycom.tensegrity.gui.swt.SwtUIItemEvaluationList

public class SwtUIItemEvaluationList
extends java.lang.Object

THIS CLASS HAS BEEN TEMPORARY ADDED HERE IN ORDER TO TEST LANGUAGE SWITCH IN AN SWT CONTEXT AND MIGHT SOON BE REMOVE. TODO SGu (26.03.2004): REVIEW. Might want to create an abstract class here. The add and setAt method would then change there signatures to accept objects. The two apply() methods are Swing/SWT specific.

Version:
$Id: SwtUIItemEvaluationList.java,v 1.2 2004/11/18 11:10:00 SebastienGuyon Exp $
Author:
S�bastien Guyon

Constructor Summary
SwtUIItemEvaluationList(UIManager uiManager)
          Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to zero.
SwtUIItemEvaluationList(UIManager uiManager, int capacity)
          Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to the given value capicity.
 
Method Summary
 void add(java.lang.String id, org.eclipse.swt.widgets.Widget obj)
          Adds a new id to the id array and a the obj to the object array.
 void apply()
          The apply method invokes for each id-component pair the applyItem method of the internal UIManager.
 void apply(int index)
          This specialized apply method allows you to update the id-component-resource relation for a specific item identified by the given index.
 void clear()
          Clears both internal arrays.
 int getSize()
          Returns the minimum of sizes of the two internal arrays.
 void setAt(int index, org.eclipse.swt.widgets.Widget obj)
          Sets a specific Component at the given index in the object array,
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtUIItemEvaluationList

public SwtUIItemEvaluationList(UIManager uiManager)
Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to zero.

Parameters:
uiManager - the UIManager to use during the apply.

SwtUIItemEvaluationList

public SwtUIItemEvaluationList(UIManager uiManager,
                               int capacity)
Creates a new UIItemEvaluationList and sets the initial capacity of the internal arrays to the given value capicity.

Parameters:
uiManager - The UIManager which is used to apply id's to objects.
capacity - the initial capacity of the internal arrays.
Method Detail

getSize

public int getSize()
Returns the minimum of sizes of the two internal arrays.

Returns:
int

add

public void add(java.lang.String id,
                org.eclipse.swt.widgets.Widget obj)
Adds a new id to the id array and a the obj to the object array.

Parameters:
id - the id to add to the id array
obj - the obj to add to the object array.

setAt

public void setAt(int index,
                  org.eclipse.swt.widgets.Widget obj)
Sets a specific Component at the given index in the object array,

Parameters:
index - the position at which you want the component to be.
obj - the component to set at the given index.

clear

public void clear()
Clears both internal arrays.


apply

public void apply()
The apply method invokes for each id-component pair the applyItem method of the internal UIManager. This call will apply the designated resource to the component. When the application switches between different localized resource files this method should be invoked each time such a switch happens.

See Also:
com.tensegrity.gui.UIManager#applyItem(int,Component)

apply

public void apply(int index)
This specialized apply method allows you to update the id-component-resource relation for a specific item identified by the given index. If the index is out of bounds no exception is thrown and the method returns.

Parameters:
index - the index in the id- and object array, identifying the element you want to update.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.