|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.apploader.propertysheets.ExplicitPropertyDescriptor
An object for manipulating a field on a property sheet. It includes methods for setting and getting the values of the field, as well as displaying it and editing it. It uses the AppLoader preferences model to get information about how to edit the property.
For example, given the RDF description of a property below:
[ lal:propertyName "AttrName" ; props:interfacer :setAttrName ; props:renderer :attrConfigNameEditor ; props:editor :attrConfigNameEditor ; rdfs:label "Name"@en , "Nom"@fr ]
Then there must exist a bean with a property given the text description "Name" (in english) that has the java name "AttrName". The preferences must also define an interfacer, as a java bean (see the apploader information) with the uri :setAttrName and the same bean for the renderer and editor with the uri :setConfigNameEditor. These are described below:
:setAttrName a lal:Bean ; rdfs:label "Function Object to Set an Attribute Name"@en ; lal:className "edu.umd.cfar.lamp.viper.gui.config.SetAttrName" . :attrConfigNameEditor a props:Editor ; lal:className "edu.umd.cfar.lamp.viper.gui.config.AttrNameEditor" ; lal:setProperty [ lal:propertyName "Text" ] .The setAttrName is a PropertyInterfacer, impelemnted by the class specified by lal:className. The label isn't used currently.
Constructor Summary | |
ExplicitPropertyDescriptor(PrefsManager prefs,
com.hp.hpl.jena.rdf.model.Resource prop,
java.lang.Object bean)
Creates a new descriptor for the property of the given instance as described in the preferences by the resource prop |
Method Summary | |
java.lang.Object |
applyGetter(java.lang.Object bean)
Get the value from the bean instance. |
void |
applySetter(java.lang.Object bean,
java.lang.Object toValue)
Set the value of this property on the given bean |
boolean |
equals(java.lang.Object o)
Tests to see that this and the other object are both explicit property descriptors with the same proxy. |
java.lang.Class |
getBeanType()
Gets the class of the bean. |
javax.swing.JComponent |
getEditor(java.lang.Object bean,
AppLoader core)
Gets the associated cell editor for the property |
PropertyInterfacer |
getInterfacer()
Gets the property functor. |
java.lang.String |
getName()
Gets the display name of the property. |
javax.swing.JComponent |
getRenderer(java.lang.Object bean,
AppLoader core)
Gets the associated cell renderer for the property. |
int |
hashCode()
Computes the hash code on the proxy object. |
boolean |
isSettable(java.lang.Object bean)
Checks to see if the property is currently settable on the given instance bean. |
void |
setInterfacer(PropertyInterfacer functor)
Sets the property functor. |
protected void |
setProxy(PropertyInterfacer proxy)
Set the interfacer proxy. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExplicitPropertyDescriptor(PrefsManager prefs, com.hp.hpl.jena.rdf.model.Resource prop, java.lang.Object bean) throws PreferenceException
prop
prefs
- The apploader prefs that describe this resource.prop
- The RDF node that represents this kind of bean propertybean
- The instance to describe
PreferenceException
Method Detail |
public boolean equals(java.lang.Object o)
o
- the object to compare to
true
when this and o
refer to
equal proxiespublic int hashCode()
protected void setProxy(PropertyInterfacer proxy)
proxy
- public java.lang.Object applyGetter(java.lang.Object bean)
applyGetter
in interface InstancePropertyDescriptor
bean
- The instance to get this property from
PropertyException
- When the value can't be extracted.public void applySetter(java.lang.Object bean, java.lang.Object toValue)
applySetter
in interface InstancePropertyDescriptor
bean
- The instance to set this property oftoValue
- The new value for the property
PropertyException
- When the value can't be set.public boolean isSettable(java.lang.Object bean)
isSettable
in interface InstancePropertyDescriptor
bean
- the instance to check
false
if the bean may not be setpublic javax.swing.JComponent getEditor(java.lang.Object bean, AppLoader core) throws PreferenceException
InstancePropertyDescriptor
getEditor
in interface InstancePropertyDescriptor
bean
- core
-
PreferenceException
InstancePropertyDescriptor.getEditor(java.lang.Object, edu.umd.cfar.lamp.apploader.AppLoader)
public javax.swing.JComponent getRenderer(java.lang.Object bean, AppLoader core) throws PreferenceException
InstancePropertyDescriptor
getRenderer
in interface InstancePropertyDescriptor
bean
- core
-
PreferenceException
InstancePropertyDescriptor.getRenderer(java.lang.Object, edu.umd.cfar.lamp.apploader.AppLoader)
public PropertyInterfacer getInterfacer()
getInterfacer
in interface InstancePropertyDescriptor
setInterfacer(PropertyInterfacer)
.public void setInterfacer(PropertyInterfacer functor)
setInterfacer
in interface InstancePropertyDescriptor
functor
- the property interfacer for the current
property on the current instance objectpublic java.lang.Class getBeanType()
getBeanType
in interface InstancePropertyDescriptor
public java.lang.String getName()
getName
in interface InstancePropertyDescriptor
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |