|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
symantec.itools.awt.MultiList
wt.clients.util.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
,
Serialized FormNested Class Summary |
Nested classes inherited from class symantec.itools.awt.MultiList |
|
Nested classes inherited from class java.awt.Panel |
Panel.AccessibleAWTPanel |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
private symantec.itools.beans.PropertyChangeSupport |
changes
|
private boolean |
isSchemaAssigned
|
private ItemListener |
itemListener
|
private Vector |
itemListenerVector
|
private WTObject[] |
myLastObj
|
private WTObject[] |
myNewObj
|
private WTSchema |
mySchema
|
private ReferenceDelegateFactory |
referenceDelegateFactory
|
private String[] |
relativeColumnWidths
|
private symantec.itools.beans.VetoableChangeSupport |
vetos
|
Fields inherited from class symantec.itools.awt.MultiList |
actionCommand, actionListener, allowResizingOfColumns, allowSorting, BORDER, cachedHeight, cachedLastSplitter, cachedWidth, cellAscent, cellDescent, cellFont, cellHeight, cells, CENTER, clickedInHeadings, CLICKTHRESHOLD, clickTime, colorBg, colorFg, colorHBg, colorHFg, columnAlignments, columnClicked, columnCompareCellsRoutines, columnSizes, defaultColumnAlignment, defaultColumnSorter, dragColumn, errors, focusIndicatedVisually, focusListener, forceColumnSizeRecalc, forceFullRedraw, forceRedraw, hasFocus, headingBg, headingFg, headingFont, headingHeight, headings, headingVisible, highlightedRows, horizontalScrollbar, hScrollbarLineIncrement, isDragging, isSun1_1, isSuppressRedraw, lastColumnClicked, LEFT, memoryClick, minColumnWidth, multiSelect, offscreenImage, offscreenImageGraphics, redrawWasSupressed, RESIZE_FUDGE_FACTOR, RIGHT, sbHPosition, sbHShow, sbVPosition, sbVShow, scrollbarHeight, selectedRow, splitters, topRow, verticalScrollbar, verticalScrollbarWidth, xDragLast |
Fields inherited from class java.awt.Panel |
|
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
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 |
addObjects(WTObject[] aObjects)
Add the specified WTObject array to the list |
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. |
void |
addWTCellImpl(int row,
int column,
symantec.itools.awt.multiList.Cell cell)
Adds a cell to the MultiList in the row and column specified. |
protected void |
drawRows(int cell_row,
int num_rows_to_draw,
boolean to_repaint)
Draws the specifed rows into an offscreen image. |
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. |
int |
getNumberOfRows()
Gets the current number of rows. |
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. |
private ReferenceDelegateFactory |
getReferenceDelegateFactory()
Returns the ReferenceDelegateFactory Supported API: false |
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. |
WTCell |
getWTCell(int a_row)
Returns the cell at a particular row. |
private boolean |
isDuplicateObject(WTObject an_object)
Returns true if the specified object is already displayed in the list. |
void |
itemStateChanged(ItemEvent e)
itemStateChanged is used to make event processing
work similiar to how the JFC TreeView and JFC MultiList work. |
static void |
main(String[] args)
|
private void |
processEvent(ItemEvent aEvent)
Propagates the item event to current listeners. |
void |
redraw()
Paints this component into an offscreen image for cleaner screen repaints. |
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 |
setSchema(WTSchema aSchema)
Set the schema to use. |
void |
sort()
|
int |
totalObjects()
Deprecated. Use getNumberOfRows instead. |
void |
updateObject(WTObject an_object)
Obtain new display values from the specified modeled Windchill business object. |
private void |
updateRow(int row,
WTObject an_object)
Replace a particular row with values from another modeled Windchill business object. |
Methods inherited from class symantec.itools.awt.MultiList |
addActionListener, addCell, addCell, addCellImpl, addImageCell, addNotify, addTextCell, adjustHeadings, calcHeadings, calculateHeadingHeight, calcVerticalScrollbarPosition, changeSelection, clear, createColumns, deselectAll, deselectRow, draw3DBox, drawColumnHeading, drawHeading, getCellBg, getCellFg, getCellFont, getCellImage, getCellText, getColumnAlignment, getColumnAlignments, getColumnSize, getColumnSizes, getColumnSizesFromSplitters, getColumnSorter, getDefaultColumnAlignment, getDefaultColumnSorter, getHeading, getHeadingBg, getHeadingFg, getHeadingFont, getHeadings, getMinColumnWidth, getNumberOfCols, getNumVisibleRows, getSelectedRow, getSelectedRows, intArrayToStringArray, internalCreateColumns, isAllowResizingOfColumns, isAllowSorting, isFocusIndicatedVisually, isFocusTraversable, isHeadingVisible, isMultipleMode, minimumSize, paint, paintSelection, preferredSize, rangeCheckAlignment, rangeCheckColumn, removeActionListener, removeNotify, removeRow, removeSelectionBorder, repaintFocus, resizeHeadings, selectAll, selectRow, setAllowResizingOfColumns, setAllowSorting, setCellBg, setCellColors, setCellFg, setCellFont, setColumnAlignment, setColumnAlignments, setColumns, setColumnSizes, setColumnSorter, setDefaultColumnAlignment, setDefaultColumnSorter, setFocusIndicatedVisually, setHeading, setHeading, setHeadingBg, setHeadingColors, setHeadingFg, setHeadingFont, setHeadings, setHeadingVisible, setLayout, setMinColumnWidth, setMultipleMode, setNumberOfCols, setSelectedRow, setSupressRedraw, sourceActionEvent, sourceItemEvent, tokenizeStringArrayIfNeeded, triggerRedraw, update |
Methods inherited from class java.awt.Panel |
getAccessibleContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private String[] relativeColumnWidths
private WTSchema mySchema
private WTObject[] myNewObj
private WTObject[] myLastObj
private ItemListener itemListener
private Vector itemListenerVector
private boolean isSchemaAssigned
private ReferenceDelegateFactory referenceDelegateFactory
private symantec.itools.beans.VetoableChangeSupport vetos
private symantec.itools.beans.PropertyChangeSupport changes
Constructor Detail |
public WTMultiList()
public WTMultiList(int cols)
cols
- the number of columnspublic WTMultiList(int cols, boolean multi)
cols
- the number of columnsmulti
- true for multiple row selection, false otherwisepublic WTMultiList(int cols, boolean multi, Color bg)
cols
- the number of columnsmulti
- true for multiple row selection, false otherwisebg
- the background colorMethod 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 sizesprotected void drawRows(int cell_row, int num_rows_to_draw, boolean to_repaint)
drawRows
. If the very last
entry in a MultiList
is removed, selecting any other entry
in the list will result in an IllegalArgumentException
. This
implementation provides a fix for this bug. This implementation was
posted by Symantec and can be found by searching the Knowledge Base of their
technical support for Visual Cafe for Java (search on multilist).
cell_row
- the zero-relative index of the first row to drawnum_rows_to_draw
- the number of rows to drawto_repaint
- if true, calls the repaint
method
to update the screenpublic void redraw()
public void addItemListener(ItemListener l)
addItemListener
in interface ItemSelectable
l
- the item listener.public void removeItemListener(ItemListener l)
removeItemListener
in interface ItemSelectable
l
- the item listener.private void processEvent(ItemEvent aEvent)
public void setSchema(WTSchema aSchema)
WTMultiList
.
#wt.clients.beans.query.WTSchema
public int getNumberOfRows()
public int totalObjects()
getNumberOfRows()
private ReferenceDelegateFactory getReferenceDelegateFactory() throws WTException
WTException
- if an error occurs in obtaining the
factory.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()
getSelectedObjects
in interface ItemSelectable
private boolean isDuplicateObject(WTObject an_object)
an_object
- the object to check for duplicity.
WTMultiList
,
otherwise false.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 addObjects(WTObject[] aObjects)
aObjects
- the array of objects to add to the details listprivate void updateRow(int row, WTObject an_object)
row
- the row to replace.an_object
- the object to add to the specified row.public void updateObject(WTObject an_object)
an_object
- the object to be refreshed.public void itemStateChanged(ItemEvent e)
itemStateChanged
is used to make event processing
work similiar to how the JFC TreeView and JFC MultiList work.
It basically serializes all selection events as select and deselect
event atoms(one at a time).
itemStateChanged
in interface ItemListener
public void sort()
public void addWTCellImpl(int row, int column, symantec.itools.awt.multiList.Cell cell)
row
- the zero-relative row indexcolumn
- the zero-relative column indexcell
- the cell that is being added to the MultiListpublic WTCell getWTCell(int a_row)
a_row
- the row of the cell.
public static String escapeColumnSeparator(String item)
item
- the column item to be escapedpublic void setListItems(String[] items) throws PropertyVetoException
items
- the text to be displayed in the WTMultiList
PropertyVetoException
public String[] getListItems()
Supported API: true
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the listener to add
Supported API: true
public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the listener to remove
Supported API: true
public void addVetoableChangeListener(VetoableChangeListener listener)
listener
- the listener to add
Supported API: true
public void removeVetoableChangeListener(VetoableChangeListener listener)
listener
- the listener to remove
Supported API: true
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |