Changeset 725 for trunk/src/org/expeditee/items/widgets
- Timestamp:
- 01/21/14 10:10:57 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/InteractiveWidget.java
r720 r725 190 190 String classname = tokens[0]; 191 191 if (classname.charAt(0) == '$'){ 192 String shortClassname = classname.substring(1); 193 classname = Actions.getClassName(shortClassname); 194 195 if (classname == null) // ensure it exists 196 throw new InteractiveWidgetNotAvailableException(shortClassname 197 + " does not exist or is not an InteractiveWidget"); 198 } 192 classname = classname.substring(1); 193 } 194 199 195 // Attempt to locate the class using reflection 200 196 Class<?> iwclass = findIWidgetClass(classname); … … 248 244 if(classname == null) 249 245 return null; 250 246 // try just the classname 251 247 try { 252 248 Class c = Class.forName(classname); // attempt to find the class 249 250 // If one is found, ensure that it is a descendant of an 251 // InteractiveWidget 252 for (Class superclass = c.getSuperclass(); superclass != null 253 && superclass != Item.class; superclass = superclass 254 .getSuperclass()) { 255 if (superclass == InteractiveWidget.class) 256 return c; 257 } 258 259 } catch (ClassNotFoundException e) { 260 } 261 // see if the class is a widget with invalid capitalisation, or missing the widget package prefix 262 if(classname.startsWith(Actions.WIDGET_PACKAGE)) { 263 classname = classname.substring(Actions.WIDGET_PACKAGE.length()); 264 } 265 try { 266 Class c = Class.forName(Actions.getClassName(classname)); // attempt to find the class 253 267 254 268 // If one is found, ensure that it is a descendant of an
Note:
See TracChangeset
for help on using the changeset viewer.