public class ObjectFieldCache extends Object
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Modifier and Type | Field and Description |
---|---|
(package private) Field |
field |
(package private) JComponent |
guiLabel |
(package private) JComponent |
guiValue |
(package private) Object |
object |
private Collection<ObjectFieldCache> |
parent |
(package private) Object |
value |
Constructor and Description |
---|
ObjectFieldCache(Collection<ObjectFieldCache> parent,
Object object,
Field field,
Object value)
Constructs a new ObjectFieldCache given its enclosing collection object,
the field's containing object, the field, and the field's value.
|
Modifier and Type | Method and Description |
---|---|
Field |
getField() |
String |
getFieldName() |
JComponent |
getGuiLabel() |
JComponent |
getGuiValue() |
Object |
getGuiValueAsNative()
Gets the UI value for guiValue
|
String |
getGuiValueAsString()
Interprets the UI value of the guiValue as a string
|
private JComponent |
getLabelComponent(CasaOption annotation)
Generates a label based on the field's type
|
private JComponent |
getValueComponent(CasaOption annotation)
Generates a GUI component based on the type of the value.
|
void |
postSaveData()
Invokes the postSaveMethod (if present) on a CasaOption annotated field
|
void |
saveData()
Flushes the currently stored value into the field.
|
void |
setLong(long l) |
void |
setValue(boolean b) |
void |
setValue(int i) |
void |
setValue(Object value) |
String |
toString()
Returns a debugger friendly string (field=value)
|
Object object
Field field
Object value
JComponent guiLabel
JComponent guiValue
private Collection<ObjectFieldCache> parent
public ObjectFieldCache(Collection<ObjectFieldCache> parent, Object object, Field field, Object value)
parent
- this object's containing Collection objectobject
- the object containing the fieldfield
- the field to trackvalue
- the field's valueprivate JComponent getLabelComponent(CasaOption annotation)
public void setValue(Object value)
public void setValue(boolean b)
public void setValue(int i)
public void setLong(long l)
public void saveData() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
public void postSaveData()
public String toString()
private JComponent getValueComponent(CasaOption annotation)
public String getGuiValueAsString()
public Object getGuiValueAsNative()
public JComponent getGuiLabel()
public JComponent getGuiValue()
public Field getField()
public String getFieldName()