Author: mes
Date: 2011-11-30 11:06:03 -0800 (Wed, 30 Nov 2011)
New Revision: 27648
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableInterceptor.java
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/BasicTunableHandlerFactory.java
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandlerFactory.java
core3/api/trunk/work-api/src/test/java/org/cytoscape/work/BasicTunableHandlerFactoryTest.java
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableHandlerFactory.java
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/sync/SyncTunableHandlerFactory.java
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandlerFactory.java
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/URLHandlerFactory.java
Log:
Renamed factory method names to be more consistent.
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableInterceptor.java
===================================================================
---
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableInterceptor.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/AbstractTunableInterceptor.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -251,7 +251,7 @@
private T getHandler(Field field, Object instance, Tunable tunable) {
for ( TunableHandlerFactory<T> thf : tunableHandlerFactories ) {
- T th = thf.getHandler(field, instance, tunable);
+ T th = thf.createTunableHandler(field, instance,
tunable);
if ( th != null )
return th;
}
@@ -260,7 +260,7 @@
private T getHandler(final Method getter, final Method setter, final
Object instance, final Tunable tunable) {
for ( TunableHandlerFactory<T> thf : tunableHandlerFactories ) {
- T th = thf.getHandler(getter, setter, instance,
tunable);
+ T th = thf.createTunableHandler(getter, setter,
instance, tunable);
if ( th != null ) {
return th;
}
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/BasicTunableHandlerFactory.java
===================================================================
---
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/BasicTunableHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/BasicTunableHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -36,7 +36,7 @@
}
@Override
- public final T getHandler(final Field field, final Object instance,
final Tunable tunable) {
+ public final T createTunableHandler(final Field field, final Object
instance, final Tunable tunable) {
if ( !properType(field.getType()) )
return null;
@@ -51,7 +51,7 @@
}
@Override
- public final T getHandler(final Method getter, final Method setter,
final Object instance, final Tunable tunable) {
+ public final T createTunableHandler(final Method getter, final Method
setter, final Object instance, final Tunable tunable) {
if ( !properType(getter.getReturnType()) )
return null;
Modified:
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandlerFactory.java
===================================================================
---
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/api/trunk/work-api/src/main/java/org/cytoscape/work/TunableHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -29,7 +29,7 @@
* @return T the newly constructed <code>TunableHandler</code> or
null if this factory
* can't handle a field of the specified type.
*/
- T getHandler(final Field field, final Object instance, final Tunable
tunable);
+ T createTunableHandler(final Field field, final Object instance, final
Tunable tunable);
/**
* This method returns a <code>TunableHandler</code> for a Method
annotated as a <code>Tunable</code>
@@ -43,6 +43,6 @@
* @return T the newly constructed <code>TunableHandler</code> or
null if this factory
* can't handle a field of the specified type.
*/
- T getHandler(final Method getter, final Method setter, final Object
instance, final Tunable tunable);
+ T createTunableHandler(final Method getter, final Method setter, final
Object instance, final Tunable tunable);
}
\ No newline at end of file
Modified:
core3/api/trunk/work-api/src/test/java/org/cytoscape/work/BasicTunableHandlerFactoryTest.java
===================================================================
---
core3/api/trunk/work-api/src/test/java/org/cytoscape/work/BasicTunableHandlerFactoryTest.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/api/trunk/work-api/src/test/java/org/cytoscape/work/BasicTunableHandlerFactoryTest.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -55,42 +55,42 @@
@Test
public void testGetHandlerField() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(GoodTunableHandler.class, int.class);
- TunableHandler th = thf.getHandler(getField(), source,
getFieldTunable() );
+ TunableHandler th = thf.createTunableHandler(getField(),
source, getFieldTunable() );
assertNotNull(th);
}
@Test
public void testGetHandlerMethod() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(GoodTunableHandler.class, int.class);
- TunableHandler th = thf.getHandler(getGetter(), getSetter(),
source, getMethodTunable() );
+ TunableHandler th = thf.createTunableHandler(getGetter(),
getSetter(), source, getMethodTunable() );
assertNotNull(th);
}
@Test
public void testInvalidTypesField() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(GoodTunableHandler.class, String.class);
- TunableHandler th = thf.getHandler(getField(), source,
getFieldTunable() );
+ TunableHandler th = thf.createTunableHandler(getField(),
source, getFieldTunable() );
assertNull(th);
}
@Test
public void testInvalidTypesMethod() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(GoodTunableHandler.class, String.class);
- TunableHandler th = thf.getHandler(getGetter(), getSetter(),
source, getMethodTunable() );
+ TunableHandler th = thf.createTunableHandler(getGetter(),
getSetter(), source, getMethodTunable() );
assertNull(th);
}
@Test
public void testNoFieldConstructor() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(NoFieldTunableHandler.class, int.class);
- TunableHandler th = thf.getHandler(getField(), source,
getFieldTunable() );
+ TunableHandler th = thf.createTunableHandler(getField(),
source, getFieldTunable() );
assertNull(th);
}
@Test
public void testNoMethodConstructor() {
BasicTunableHandlerFactory<TunableHandler> thf = new
BasicTunableHandlerFactory(NoMethodTunableHandler.class, int.class);
- TunableHandler th = thf.getHandler(getGetter(), getSetter(),
source, getMethodTunable() );
+ TunableHandler th = thf.createTunableHandler(getGetter(),
getSetter(), source, getMethodTunable() );
assertNull(th);
}
}
Modified:
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableHandlerFactory.java
===================================================================
---
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/tunables/CommandTunableHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -21,7 +21,7 @@
public class CommandTunableHandlerFactory implements
TunableHandlerFactory<StringTunableHandler> {
- public StringTunableHandler getHandler(final Method getter, final
Method setter, final Object instance, final Tunable tunable) {
+ public StringTunableHandler createTunableHandler(final Method getter,
final Method setter, final Object instance, final Tunable tunable) {
final Class<?> type = getter.getReturnType();
if (type == Boolean.class || type == boolean.class)
@@ -58,7 +58,7 @@
return null;
}
- public StringTunableHandler getHandler(final Field field, final Object
instance, final Tunable tunable) {
+ public StringTunableHandler createTunableHandler(final Field field,
final Object instance, final Tunable tunable) {
final Class<?> type = field.getType();
if (type == Boolean.class || type == boolean.class)
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/sync/SyncTunableHandlerFactory.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/sync/SyncTunableHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/sync/SyncTunableHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -12,11 +12,11 @@
public class SyncTunableHandlerFactory implements
TunableHandlerFactory<SyncTunableHandler> {
- public SyncTunableHandler getHandler(final Field field, final Object
instance, final Tunable tunable) {
+ public SyncTunableHandler createTunableHandler(final Field field, final
Object instance, final Tunable tunable) {
return new SyncTunableHandler(field,instance,tunable);
}
- public SyncTunableHandler getHandler(final Method getter, final Method
setter, final Object instance, final Tunable tunable) {
+ public SyncTunableHandler createTunableHandler(final Method getter,
final Method setter, final Object instance, final Tunable tunable) {
return new SyncTunableHandler(getter,setter,instance,tunable);
}
}
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandlerFactory.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/FileHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -22,14 +22,14 @@
this.fileTypesManager = fileTypesManager;
}
- public GUITunableHandler getHandler(Field field, Object instance,
Tunable tunable) {
+ public GUITunableHandler createTunableHandler(Field field, Object
instance, Tunable tunable) {
if (!File.class.isAssignableFrom(field.getType()))
return null;
return new FileHandler(field, instance, tunable,
fileTypesManager, fileUtil);
}
- public GUITunableHandler getHandler(Method getter, Method setter,
Object instance, Tunable tunable) {
+ public GUITunableHandler createTunableHandler(Method getter, Method
setter, Object instance, Tunable tunable) {
if (!File.class.isAssignableFrom(getter.getReturnType()))
return null;
Modified:
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/URLHandlerFactory.java
===================================================================
---
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/URLHandlerFactory.java
2011-11-30 19:01:50 UTC (rev 27647)
+++
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/URLHandlerFactory.java
2011-11-30 19:06:03 UTC (rev 27648)
@@ -22,14 +22,14 @@
}
- public GUITunableHandler getHandler(Field field, Object instance,
Tunable tunable) {
+ public GUITunableHandler createTunableHandler(Field field, Object
instance, Tunable tunable) {
if ( field.getType() != URL.class)
return null;
return new URLHandler(field, instance, tunable, bookmarks,
bookmarksUtil);
}
- public GUITunableHandler getHandler(Method getter, Method setter,
Object instance, Tunable tunable) {
+ public GUITunableHandler createTunableHandler(Method getter, Method
setter, Object instance, Tunable tunable) {
if ( getter.getReturnType() != URL.class)
return null;
--
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.