Author: mmichaud
Date: 2009-03-09 10:04:47 -0700 (Mon, 09 Mar 2009)
New Revision: 16184
Modified:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FilePropHandler.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropHandlerFactory.java
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/URLPropHandler.java
Log:
Modified:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FilePropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FilePropHandler.java
2009-03-09 17:03:30 UTC (rev 16183)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/FilePropHandler.java
2009-03-09 17:04:47 UTC (rev 16184)
@@ -1,7 +1,6 @@
package org.cytoscape.work.internal.props;
import java.lang.reflect.Field;
-import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -14,7 +13,6 @@
File file;
List<String> paths;
- String path;
public FilePropHandler(Field f, Object o, Tunable t) {
super(f,o,t);
@@ -25,33 +23,25 @@
public Properties getProps() {
Properties p = new Properties();
- p.put( propKey, file.getAbsolutePath());
+ p.put( propKey, file.getPath());
return p;
}
public void add(Properties p) {
- //test = new ArrayList<String>();
- //test.add(0,"");
- // TODO
- //files.setPaths(test);
try{
p.put(propKey,file.getAbsolutePath());
}catch(Exception e){e.printStackTrace();}
}
- @SuppressWarnings("unchecked")
public void setProps(Properties p) {
-// try {
+ try {
if ( p.containsKey( propKey ) ) {
- Object val = p.get( propKey );
- // TODO
- //if ( val != null )
- //files.setPaths((List<String>) val);
- //f.set(o, files);
+ String val = p.getProperty( propKey );
+ if ( val != null )
+ f.set(o, val);if ( val != null )
+ f.set(o, val);
}
-// } catch (IllegalAccessException iae) {
- // iae.printStackTrace();
- // }
+ } catch (IllegalAccessException iae) {iae.printStackTrace();}
}
}
Modified:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropHandlerFactory.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropHandlerFactory.java
2009-03-09 17:03:30 UTC (rev 16183)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/PropHandlerFactory.java
2009-03-09 17:04:47 UTC (rev 16184)
@@ -41,8 +41,8 @@
return new ListMultiplePropHandler(f,o,t);
else if (type == File.class)
return new FilePropHandler(f,o,t);
-// else if(type == URL.class)
-// return new URLPropHandler(f,o,t);
+ else if(type == URL.class)
+ return new URLPropHandler(f,o,t);
return null;
}
Modified:
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/URLPropHandler.java
===================================================================
---
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/URLPropHandler.java
2009-03-09 17:03:30 UTC (rev 16183)
+++
core3/work-tunable-props-impl/trunk/src/main/java/org/cytoscape/work/internal/props/URLPropHandler.java
2009-03-09 17:04:47 UTC (rev 16184)
@@ -1,6 +1,7 @@
package org.cytoscape.work.internal.props;
import java.lang.reflect.*;
+import java.net.URL;
import java.util.*;
import java.io.File;
@@ -8,24 +9,24 @@
public class URLPropHandler extends AbstractPropHandler {
- File file;
+ URL url;
public URLPropHandler(Field f, Object o, Tunable t) {
super(f,o,t);
try{
- file = (File) f.get(o);
+ url = (URL) f.get(o);
}catch(Exception e){e.printStackTrace();}
}
public Properties getProps() {
Properties p = new Properties();
- p.put( propKey, file.toString());
+ p.put( propKey, url.toString());
return p;
}
public void add(Properties p) {
try{
- p.put(propKey,file.toString());
+ p.put(propKey,url.toString());
}catch(Exception e){e.printStackTrace();}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---