at.spardat.xma.mdl.list
Interface IListWM

All Superinterfaces:
ISelectable
All Known Subinterfaces:
IListWMClient
All Known Implementing Classes:
ListWM, ListWMClient

public interface IListWM
extends ISelectable

Interface of the widged model to represent a list of choises. It can be used with the SWT-widgets Combo and List. The entries of the list have to be provided by the programmer. All entries must by Atoms of the same type. The supported types are T_STRING, T_BCD, T_DATE and T_TIMESTAMP. There are convinience methods to use Java Strings directly. These Strings are converted to Atoms of type T_STRING internally. For domain values please use ListDomWM.


Field Summary
static int S_MULTI_SELECT
          If the IListWM is used with the SWT-Control List, you can allow multi-selection by specifying this style constant in the constructor.
static int S_NOT_STRICT
          If the IListWM is used with the SWT-Control Combo, you can allow entering of values not contained in the list.
 
Method Summary
 void add(Atom entry)
          Adds an entry to the list.
 void add(Atom[] entries)
          Adds the entries to the list.
 void add(java.util.Collection entries)
          Adds the entries to the list.
 void add(int index, Atom entry)
          Inserts an entry into the list at the specified position.
 void add(int index, java.lang.String entry)
          Inserts an entry into the list at the specified position.
 void add(java.lang.String entry)
          Adds an entry to the list.
 void add(java.lang.String[] entries)
          Adds the entries to the list.
 void clear()
          Removes all entries from the list and deselects all selected entries.
 boolean contains(Atom entry)
          Returns true if the list contains the given entry.
 boolean contains(java.lang.String entry)
          Returns true if the list contains the given entry.
 Atom getEntry(int index)
          Get the entry at the specified position.
 Atom getEntry(java.lang.String key)
          Get the entry for the given key.
 java.lang.String getStringEntry(int index)
          Get the entry at the specified position.
 int indexOf(Atom entry)
          Get the index of the given entry.
 int indexOf(java.lang.String entry)
          Get the index of the given entry.
 void remove(Atom entry)
          Removes an entry from the list.
 void remove(int index)
          Removes the entry at the given position from the list.
 void remove(java.lang.String entry)
          Removes an entry from the list.
 void replace(int index, Atom newEntry)
          Replaces an entry in the list.
 void replace(int index, java.lang.String newEntry)
          Replaces an entry in the list.
 int size()
          Gets the size of the list.
 
Methods inherited from interface at.spardat.xma.mdl.ISelectable
deselect, deselectAll, getSelected, getSelection, getSelectionCount, isMultiSelect, isSelected, isStrict, select
 

Field Detail

S_MULTI_SELECT

public static final int S_MULTI_SELECT
If the IListWM is used with the SWT-Control List, you can allow multi-selection by specifying this style constant in the constructor. Multi-selection is possible for List only.

See Also:
Constant Field Values

S_NOT_STRICT

public static final int S_NOT_STRICT
If the IListWM is used with the SWT-Control Combo, you can allow entering of values not contained in the list. With S_NON_STRICT the user can enter additional values in the textfield of the combo box.

See Also:
Constant Field Values
Method Detail

add

public void add(Atom entry)
Adds an entry to the list. The entry is appended at the end of the selection list.

Parameters:
entry - to add

add

public void add(int index,
                Atom entry)
Inserts an entry into the list at the specified position.

Parameters:
index - the desired zero base index of the new entry
entry - to add

add

public void add(Atom[] entries)
Adds the entries to the list. The entries are appended at the end of the list.

Parameters:
entries - to add

add

public void add(java.util.Collection entries)
Adds the entries to the list. The entries are appended at the end of the list. The collection may contain Atoms or Strings. If it contains Atoms, all entries must be Atoms with the same type. If it contains Strings, all entries must be Strings.

Parameters:
entries - to add

getEntry

public Atom getEntry(int index)
Get the entry at the specified position.

Parameters:
index - the index of the desired entry.
Returns:
the entry at the given index.

getEntry

public Atom getEntry(java.lang.String key)
Get the entry for the given key.

Parameters:
key - string representation of the desired entry.
Returns:
the entry corresponding to the string representation.

indexOf

public int indexOf(Atom entry)
Get the index of the given entry.

Parameters:
entry - the entry of which the index is desired.
Returns:
the index of the given entry.

remove

public void remove(Atom entry)
Removes an entry from the list.

Parameters:
entry - to remove

remove

public void remove(int index)
Removes the entry at the given position from the list.

Parameters:
index -

replace

public void replace(int index,
                    Atom newEntry)
Replaces an entry in the list. The old entry at the given index position is replaced by the entry given as parameter.

Parameters:
index - the index of the entry to replace.
newEntry - the new entry to insert.

contains

public boolean contains(Atom entry)
Returns true if the list contains the given entry.

Parameters:
entry -
Returns:
true if the given entry is contained in the list.

add

public void add(java.lang.String entry)
Adds an entry to the list. The entry is appended at the end of the selection list.

Parameters:
entry - to add

add

public void add(int index,
                java.lang.String entry)
Inserts an entry into the list at the specified position.

Parameters:
index - the desired zero base index of the new entry
entry - to add

add

public void add(java.lang.String[] entries)
Adds the entries to the list. The entries are appended at the end of the list.

Parameters:
entries - to add

getStringEntry

public java.lang.String getStringEntry(int index)
Get the entry at the specified position.

Parameters:
index - the index of the desired entry.
Returns:
the entry at the given index.

indexOf

public int indexOf(java.lang.String entry)
Get the index of the given entry.

Parameters:
entry - the entry of which the index is desired.
Returns:
the index of the given entry.

remove

public void remove(java.lang.String entry)
Removes an entry from the list.

Parameters:
entry - to remove

replace

public void replace(int index,
                    java.lang.String newEntry)
Replaces an entry in the list. The old entry at the given index position is replaced by the entry given as parameter.

Parameters:
index - the index of the entry to replace.
newEntry - the new entry to insert.

contains

public boolean contains(java.lang.String entry)
Returns true if the list contains the given entry.

Parameters:
entry -
Returns:
true if the given entry is contained in the list.

clear

public void clear()
Removes all entries from the list and deselects all selected entries.


size

public int size()
Gets the size of the list.

Returns:
the number of entries.