|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.List | +--com.sssw.rt.atlas.AtList | +--com.sssw.rt.form.AgcList
The AgcList control (List) is a data-bound list control that displays a list of values to users. Users can browse the list of values and select a value from it. The AgcList class exposes the AWT list control as a com.sssw.rt.form control.
When the control is bound to a database column via the Data Column property, the value in the database sets the initially selected item in the list. If the user makes a different selection, that value becomes the value associated with the current row. The selected value is saved to the database when you call updateRows() for the form.
In addition to being data-bound, the control is a data-loaded control in which a database table or other data source can provide the list of values. You can use methods of AgiRowSetManager to navigate the list. However, changes to the list items do not affect the underlying data; therefore, calling updateRows() is not allowed. If you call it for the control, updateRows() throws AgoUnsupportedOperationException.
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Fields inherited from interface com.sssw.rt.form.AgiControl |
IMAGE_MODE_CENTERED,
IMAGE_MODE_NORMAL,
IMAGE_MODE_STRETCH,
IMAGE_MODE_TILED |
Constructor Summary | |
AgcList()
|
Method Summary | |
void |
add(String title,
Object value)
Appends an item to the list, specifying both the display text and the list item's value. |
void |
addRow(String title)
Deprecated. replaced by List.add(String) method. |
int |
countRows()
Deprecated. replaced by List.getItemCount() method. |
void |
deselect(int index)
Deselects a row. |
Color |
getBackgroundColor()
Deprecated. replaced by Component.getBackground() . |
AgoFontIdentifier |
getFontIdentifier()
Returns the SilverStream font object (AgoFontIdentifier) for the control's text. |
Object |
getItemValue(int index)
Get the value of the item at the specified index. |
String |
getRowText(int index)
Deprecated. replaced by List.getItem(int) method. |
Object |
getRowValue(int index)
Deprecated. use AgcList.getItemValue(int) to obtain the value of the specified row. |
Object |
getValue()
Returns the control's value. |
void |
insert(String title,
int index)
Provides the same functionality as the java.awt.List add(title, index) method. |
void |
insert(String title,
Object value,
int index)
Inserts an item at the specified index in the AgcList, specifying both the display text and the list item's value (may be null). |
void |
removeAllRows()
Deprecated. replaced by List.removeAll() . |
void |
removeRow(int index)
Deprecated. replaced by List.remove(int) method. |
void |
replaceItem(String newTitle,
int index)
Replace the text for the item at the specified index. |
void |
replaceItem(String newTitle,
Object newValue,
int index)
Replace the text and value for the item at the specified index. |
void |
replaceRow(String newTitle,
int index)
Deprecated. replaced by AgcList.replaceItem(String,int) method. |
void |
select(int index)
Selects the specified row. |
void |
setBackgroundColor(Color backgroundcolor)
Deprecated. replaced by Component.setBackground(Color) . |
void |
setFontIdentifier(AgoFontIdentifier fontidentifier)
Assigns the SilverStream font object (AgoFontIdentifier) to the control's text. |
void |
setValue(Object value)
Selects the row whose value is equal to the specified value. |
Methods inherited from class com.sssw.rt.atlas.AtList |
deliverMouseEvent,
deliverMouseMoveEvent,
doAtCommand,
enableAtCommands,
getHelper,
getToolTipText,
getToolTipText,
grabFocus,
isFocusTraversable,
isRequestFocusEnabled,
preprocessKeyEvent,
processEvent,
requestFocus,
setRequestFocusEnabled,
setToolTipText |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Methods implemented from interface com.sssw.rt.form.AgiControl |
getBackgroundImage,
getBackgroundImageMode,
getComponent,
getHelpInfo,
setBackgroundImage,
setBackgroundImageMode,
setHelpInfo |
Methods implemented from interface com.sssw.rt.util.AgiRowSetManager |
clearRows,
haveRowsChanged,
query,
query,
refreshRows,
updateRows |
Constructor Detail |
public AgcList()
Method Detail |
public AgoFontIdentifier getFontIdentifier()
The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.
The Font Style can be one of these values:
The Font Size can be any integer.
The following code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont)
and how to call the getFontIdentifier()
method:
AgoFontIdentifier font; font = ControlName1.getFontIdentifier();
AgcList.setFontIdentifier(AgoFontIdentifier)
public void setFontIdentifier(AgoFontIdentifier fontidentifier)
fontidentifier
- specifies the AgoFontIdentifier object that assigns the font for the control.The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.
The Font Style can be one of these values:
The Font Size can be any integer.
This code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call
the setFontIdentifier()
method:
AgoFontIdentifier newFont; String newName; int newSize; int newStyle; newName="TimesRoman"; newSize=20; newStyle=AgoFontIdentifier.ITALIC; newFont=new AgoFontIdentifier(newName, newStyle, newSize); ControlName1.setFontIdentifier(newFont);
AgcList.getFontIdentifier()
public Color getBackgroundColor()
Component.getBackground()
.
public void setBackgroundColor(Color backgroundcolor)
Component.setBackground(Color)
.
backgroundcolor
- public void addRow(String title)
List.add(String)
method.
title
- specifies the text of the row to add.
The addRow()
method adds a row dynamically at runtime. Rows added dynamically
are not saved across sessions or instances of the control in the way that rows added as properties
of the control are.
AgcList.removeRow(int)
,
AgcList.removeAllRows()
public void insert(String title, int index)
add(title, index)
method.title
- index
- public void add(String title, Object value)
title
- specifies the text of the row to add.value
- specifies the value of the row to add.
The add()
method adds a row dynamically at runtime. Rows added dynamically
are not saved across sessions or instances of the control in the way that rows added as
properties of the control are.
ControlName1.add("One", new Integer(1)); ControlName1.add("Two", new Integer(2));
AgcList.removeRow(int)
,
AgcList.removeAllRows()
public void insert(String title, Object value, int index)
title
- the display text.value
- the item's value.index
- where to add the item.If 'index' is -1, the item is added as the last item.
public void removeRow(int index)
List.remove(int)
method.
index
- specifies the index of the row to remove.The rows are zero-based.
The following code fragment illustrates how to remove the row whose index is three.
ControlName1.removeRow(3);
AgcList.addRow(String)
public void replaceRow(String newTitle, int index)
AgcList.replaceItem(String,int)
method.
newText
- the replacement text.index
- the index of the row to replace.Row indexes are zero-based.
public void replaceItem(String newTitle, int index)
newTitle
- index
- public void replaceItem(String newTitle, Object newValue, int index)
newTitle
- String for new title.newValue
- Object that specifies new value.index
- An int that specifies the index of the item in the list.public void removeAllRows()
List.removeAll()
.
The following code fragment illustrates how to use the removeAllRows()
method.
ControlName1.removeAllRows();
AgcList.addRow(String)
,
AgcList.removeRow(int)
public int countRows()
List.getItemCount()
method.
The rows are zero-based.
public String getRowText(int index)
List.getItem(int)
method.
index
- specifies the index of the row whose text is desired.The rows are zero-based.
public final Object getRowValue(int index)
AgcList.getItemValue(int)
to obtain the value of the specified row.
index
- specifies the index of the row whose value is desired.The rows are zero-based.
AgcList.getItemValue(int)
public Object getItemValue(int index)
index
- specifies the index of the row whose value is desired.The indexes are zero-based.
Object value; value = ControlName1.getItemValue(3);
public void select(int index)
index
- specifies the row to select.The rows are zero-based.
The following code fragment illustrates how to select a row.
ControlName1.select(3);
AgcList.addRow(String)
,
AgcList.removeRow(int)
public void deselect(int index)
index
- specifies the index of the row to deselect.Only useful if setMultipleMode(true). Rows are zero-based.
The following code fragment illustrates how to deselect the row whose index is three.
ControlName1.deselect(3);
AgcList.select(int)
public Object getValue()
This is the internal value associated with the selected node. If the internal value is null, then the selected node's text is returned as a String. If no node is selected, then null is returned.
Object value; value = ControlName1.getValue();
AgcList.setValue(Object)
public void setValue(Object value)
value
- specifies an internal value that specifies which row to select.At design time the contents of the internal value can be established using the Property Inspector. It can be static or retrieved from the database. Each row can have its own internal value.
If the control is populated from a static list of data (that is the Load Choices property is set to Statically), the internal values can be specified using the Values property.
If the control is populated from the database (that is the Load Choices property is set to From Table), the internal values can be specifed using the Storage value property.
Suppose a control is loaded statically:
The following code fragment illustrates how to make Orange the selected item using setValue().
int x=3; ControlName1.setValue(new Integer(x));
Note that this example uses the Integer class instead of the int primitive data type because an Object cannot be cast to an int.
AgcList.getValue()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |