Okay, I just compiled and tested this simple example and it worked (in so far
as the TreeView was instantiated correctly and my custom skin was installed).
Does your custom skin have a no-arg constructor? That's the only reason I can
see that the "InstantiationException" would be thrown.
HTH,
~Roger
import org.apache.pivot.wtk.*;
import org.apache.pivot.collections.*;
import org.apache.pivot.wtk.skin.terra.*;
public class Test extends Application.Adapter
{
public static class MyTreeSkin extends TerraTreeViewSkin
{
public MyTreeSkin() {
System.out.println("MyTreeSkin()");
}
@Override
public boolean mouseClick(Component component, Mouse.Button
button, int x, int y, int count) {
return super.mouseClick(component, button, x, y, count);
}
}
@Override
public void startup(Display display, Map<String,String> properties) {
Theme.getTheme().set(TreeView.class, MyTreeSkin.class);
new TreeView();
}
public static void main(String[] args) {
DesktopApplicationContext.main(Test.class, args);
}
}
-----Original Message-----
From: Josh R [mailto:[email protected]]
Sent: Wed 8/8/2012 5:27 PM
To: [email protected]
Subject: Re: How to block UI input to a disabled/busy TreeNode
On Wed, Aug 8, 2012 at 8:12 PM, Roger L. Whitcomb
<[email protected]> wrote:
> Okay, I think the thing to do is this:
>
> myApp.startup(...) {
> ...
> Theme.getTheme().set(TreeView.class, MyTreeSkin.class);
> ...
>
> Then you don't need a MyTreeview class at all, and when you instantiate a
> TreeView it will automatically get the MyTreeSkin as its skin....
>
> See if that works.
Nope.
java.lang.IllegalArgumentException: java.lang.InstantiationException:
com.foobar.proto.main_proto$MyTreeSkin
at org.apache.pivot.wtk.Component.installSkin(Component.java:834)
at org.apache.pivot.wtk.TreeView.<init>(TreeView.java:924)
at org.apache.pivot.wtk.TreeView.<init>(TreeView.java:908)
at com.foobar.proto.main_proto.create_hosts_tree(main_proto.java:665)
at com.foobar.proto.main_proto.startup(main_proto.java:837)
>
> ~Roger
thanks