|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsymantec.itools.awt.MultiList
wt.clients.util.WTMultiList
public class WTMultiList
WTMultiList is a multi column list which fixes bugs found in
symantec.itools.awt.MultiList. Most of the fixes involve improving
the display appearance on UNIX clients. It is possible to use this class
in place of using the symantec.itools.awt.MultiList.
WTMultiList can also be configured to display attributes of modeled
Windchill business objects, such as Parts, Documents, etc in a multi column
list. When taking advantage of this feature of WTMultiList,
it is necessary to specify the class and attributes that will be used by
the display methods. A wt.clients.beans.query.WTSchema object
is used to specify the class and attributes used by WTMultiList
for displaying Windchill business objects. The attributes defined by the
WTSchema object are used to obtain the column headings and values
for the cells within a column. Methods that allow adding/obtaining modeled
Windchill business objects are included in this class. An icon representing
the object associated with a particular row is always displayed in the
first column.
An example of using the WTMultiList to display modeled Windchill
business objects is presenting the results of a database search to the user.
After performing the database search, the objects obtained can be added to
a WTMultiList object for later selection by the user.
WTMultiList can be configured in single and multi-select mode.
The user cannot type or edit a selection in a WTMultiList.
The user can resize a column at run-time by dragging the column boundary
to a new position.
The following code demonstrates creating a WTMultiList in a Frame:
Frame f = new Frame();
f.setSize(400,200);
WTMultiList multi_list = new WTMultiList();
// Create a schema to display Name, Version and Description of
// objects with class wt.doc.WTDocument
WTSchema schema = new WTSchema("C:wt.doc.WTDocument; D:name; D:versionIdentifier; D:description;");
multi_list.setSchema(schema);
f.add(multi_list);
f.show();
Supported API: true
Extendable: false
MultiList,
#wt.clients.beans.query.WTSchema| Constructor Summary | |
|---|---|
WTMultiList()
Constructs a new WTMultiList. |
|
WTMultiList(int cols)
Constructs a new WTMultiList with the specified number of columns. |
|
WTMultiList(int cols,
boolean multi)
Constructs a new WTMultiList with the spcified number of columns and whether multiple row selection allowed. |
|
WTMultiList(int cols,
boolean multi,
Color bg)
Constructs a new WTMultiList with the specified number of columns, whether multiple row selection is allowed, and given background color. |
|
| Method Summary | |
|---|---|
void |
addItemListener(ItemListener l)
Adds the specified item listener to receive item events from this list. |
WTObject |
addObject(WTObject an_object)
Add a modeled Windchill business object to the WTMultiList. |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events. |
static String |
escapeColumnSeparator(String item)
Escape special characters within the column text of a WTMultiList row. |
String[] |
getListItems()
Returns the text contents of all the cells as a string array. |
WTObject |
getObject(int a_row)
Returns the object at a particular row. |
int |
getObjectRow(WTObject an_object)
Returns the number of the row containing a particular object. |
String[] |
getRelativeColumnWidths()
This is the public getter that will return an array of strings representing the relative widths of each column. |
WTObject |
getSelectedObject()
Returns the currently selected object. |
Object[] |
getSelectedObjects()
Returns the currently selected array of objects. |
void |
redrawColumns()
This method should be called after the multilist is visible. |
void |
removeItemListener(ItemListener l)
Removes the specified item listener from this list. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events. |
void |
setListItems(String[] items)
Takes an array of Strings and puts them into a WTMultiList. |
void |
setRelativeColumnWidths(String[] widths)
Sets the relativeColumnWidths property. |
void |
updateObject(WTObject an_object)
Obtain new display values from the specified modeled Windchill business object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WTMultiList()
public WTMultiList(int cols)
cols - the number of columns
public WTMultiList(int cols,
boolean multi)
cols - the number of columnsmulti - true for multiple row selection, false otherwise
public WTMultiList(int cols,
boolean multi,
Color bg)
cols - the number of columnsmulti - true for multiple row selection, false otherwisebg - the background color| Method Detail |
|---|
public void setRelativeColumnWidths(String[] widths)
throws PropertyVetoException
relativeColumnWidths property. Pass an array of
Strings that can be converted to ints. Use 1 to give that column a column
width of 1 relative to the width of the whole table. Pass 0 for a hidden
column. A value of 2 will create a column twice the width of the column
with a value of 1.
widths - the relative width for each column
PropertyVetoException - if an error occurs setting the column sizespublic String[] getRelativeColumnWidths()
public void redrawColumns()
throws PropertyVetoException
WTMultiList and then
distribute the widths to the columns based on that width. No column
will be smaller than the minColumnWidth.
PropertyVetoException - if an error occurs setting the column sizespublic void addItemListener(ItemListener l)
l - the item listener.public void removeItemListener(ItemListener l)
l - the item listener.public int getObjectRow(WTObject an_object)
an_object - the object whose row number is to be found.
public WTObject getObject(int a_row)
a_row - the row of the object.
public WTObject getSelectedObject()
public Object[] getSelectedObjects()
public WTObject addObject(WTObject an_object)
WTMultiList.
If the object is already in the list, the object will be
updated to reflect the new values.
an_object - the modeled Windchill business object to add.
public void updateObject(WTObject an_object)
an_object - the object to be refreshed.public static String escapeColumnSeparator(String item)
item - the column item to be escaped
public void setListItems(String[] items)
throws PropertyVetoException
items - the text to be displayed in the WTMultiList
PropertyVetoExceptionpublic String[] getListItems()
Supported API: truepublic void addPropertyChangeListener(PropertyChangeListener listener)
listener - the listener to add
Supported API: truepublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - the listener to remove
Supported API: truepublic void addVetoableChangeListener(VetoableChangeListener listener)
listener - the listener to add
Supported API: truepublic void removeVetoableChangeListener(VetoableChangeListener listener)
listener - the listener to remove
Supported API: true
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||