Author: mes
Date: 2012-03-15 14:11:21 -0700 (Thu, 15 Mar 2012)
New Revision: 28555
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandler.java
Log:
added code that allows us to access the tunable type from the tunable handler
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
===================================================================
---
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
2012-03-15 19:43:57 UTC (rev 28554)
+++
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableHandler.java
2012-03-15 21:11:21 UTC (rev 28555)
@@ -66,6 +66,13 @@
/**
* {@inheritDoc}
*/
+ final public Class<?> getType() {
+ return field != null ? field.getType() : getter.getReturnType();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
final public Object getValue() throws IllegalAccessException,
InvocationTargetException {
return field != null ? field.get(instance) :
getter.invoke(instance);
}
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandler.java
===================================================================
---
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandler.java
2012-03-15 19:43:57 UTC (rev 28554)
+++
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandler.java
2012-03-15 21:11:21 UTC (rev 28555)
@@ -97,4 +97,10 @@
* @return the listenForChange property of the tunable
*/
String[] listenForChange();
+
+ /**
+ * Returns the class type of the field or method annotated by
<code>Tunable</code>.
+ * @return the class type of the field or method annotated by
<code>Tunable</code>.
+ */
+ Class<?> getType();
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.