Putting a custom slot widget into my own container

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Putting a custom slot widget into my own container

Daniel Elenius
I am writing a tab plugin, and somewhere in my code, I want a JPanel
containing a certain slot widget (that I have also written).

First attempt: Create the widget using its constructor, and add() it to
the panel. No widget appears.

Second attempt: I dug into the source code of OWLIndividualsTab,
ResourceDisplay, WidgetDescriptor, Project, etc, etc, and tried to
figure out how protege and protege-owl creates these widgets. It seemed
promising to use WidetUtilities.createSlotWidget(). This method needs a
WidgetDescriptor. My problem now is that I can't create a
WidgetDescriptor using any of its methods. There seems to be only two
ways to create a WidgetDescriptor: the create() methods, where one takes
a KnowledgeBase and the other takes an Instance. When I try the first
one, I get this error:

WARNING: Exception caught by default exception handler --
java.lang.AssertionError: widgetCls
        at edu.stanford.smi.protege.util.Assert.assertNotNull(Unknown
Source)
        at
edu.stanford.smi.protege.model.WidgetDescriptor.create(Unknown Source)
    ...

Looking at the source code, it appears that protege expects there to be
a class in the KB called "Widget", and it's not there. Maybe this is
something that protege-frames has but not protege-owl?

Then I tried the other create() method, i.e. using an Instance, but this
method expects the argument to be an instance of the abovementioned
"Widget" class.

What am I missing, or is there an easier way to do what I want to do?

Daniel
_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03