I've looked at the Widget.fx and the WidgetInstance.fx files, but I'm
having a bit of a problem with actually getting an instance of a class
with that code.
For example I've got these two classes in the
se.pmdit.widget.themepanel package:
public class TestClass {
public attribute test: TestClassImpl;
public attribute cls: String on replace {
if(cls.length() > 0 ) {
try {
var themeClass:Class = Class.forName(cls);
var name = Entry.entryMethodName();
System.out.println("name: {name}");
var args = Sequences.make(String.<<class>>) as Object;
var m: Method = themeClass.getMethod(name,
Sequence.<<class>>);
System.out.println("method: {m}");
test = m.invoke(null, args) as TestClassImpl;
System.out.println("invoke: {test}");
} catch (e:Throwable) {
System.out.println("error: {e}");
}
}
}
}
public class TestClassImpl {
attribute text: String = "nothing";
}
The output is as follows:
name: javafx$run$
method: public static java.lang.Object
se.pmdit.widget.themepanel.TestClassImpl.javafx$run$
(com.sun.javafx.runtime.sequence.Sequence)
invoke: null
Any idea why invoke would return null here?
/Pär