|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiamondedge.util.ListFormat
public class ListFormat
This class allows a mapping to be specified between the actual data value and the value displayed to the user. When used with DsGrid as the Format for a cell the user will be presented with a ComboBox of the display values. The value stored in the cell will be the data value.
Constructor Summary | |
---|---|
ListFormat()
|
Method Summary | |
---|---|
void |
add(Connection con,
String sql)
A ResultSet will be created based on the given connection and SQL query and will then be loaded into the ListFormat. |
void |
add(int index,
Object dataValue,
Object displayValue)
Add a mapping between the actual data value and the value displayed to the user. |
void |
add(Object dataValue,
Object displayValue)
Add a mapping between the actual data value and the value displayed to the user. |
void |
add(ResultSet rs)
Loads data from the ResultSet into the ListFormat. |
void |
clear()
|
boolean |
containsDataValue(Object dataValue)
|
boolean |
containsDisplayValue(Object displayValue)
|
Object |
get(int index)
Returns the display value at the given index. |
Object |
get(Object dataValue)
Returns the display value that corresponds to the dataValue argument specified when the member referred to was added to the collection |
Object |
getDataValue(int index)
Returns the dataValue at specified index |
int |
getIndex(Object dataValue)
Returns a 0-based index for the dataValue |
static ListFormat |
getMonthNames(Locale l)
Returns a ListFormat with entries for each month name. |
static ListFormat |
getWeekdayNames(Locale l)
Returns a ListFormat with entries for the name of each day of the week. |
Object |
remove(int index)
Remove an element based on its position in the List. |
boolean |
remove(Object displayValue)
Remove the specified element, displayValue, from the List. |
Object |
removeDataValue(Object dataValue)
Remove an element based on its dataValue. |
Object |
set(int index,
Object displayValue)
Changes the display value at the specified position in the list |
Object |
set(Object dataValue,
Object displayValue)
Changes the display value for the specified data value. |
void |
setDataValueType(Class dataValueType)
Sets the type all data values are coerced to. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListFormat()
Method Detail |
---|
public int size()
public void setDataValueType(Class dataValueType)
public int getIndex(Object dataValue)
public Object get(int index)
index
- specifies the position that the value was addedpublic Object get(Object dataValue)
public Object getDataValue(int index)
public Object set(int index, Object displayValue)
public Object set(Object dataValue, Object displayValue)
public void add(Object dataValue, Object displayValue)
dataValue
- value used in the underlying data modeldisplayValue
- value to be displayed to the userpublic void add(int index, Object dataValue, Object displayValue)
dataValue
- value used in the underlying data modeldisplayValue
- value to be displayed to the userpublic void add(ResultSet rs) throws SQLException
SQLException
public void add(Connection con, String sql) throws SQLException
SQLException
add(ResultSet)
public Object remove(int index)
public Object removeDataValue(Object dataValue)
public boolean remove(Object displayValue)
public void clear()
public boolean containsDataValue(Object dataValue)
public boolean containsDisplayValue(Object displayValue)
public static ListFormat getMonthNames(Locale l)
l
- locale to be used to generate the month names. If null, it will use the default locale.public static ListFormat getWeekdayNames(Locale l)
l
- locale to be used to generate the day names. If null, it will use the default locale.
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |