Putting a custom slot widget into my own container
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 --
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
What am I missing, or is there an easier way to do what I want to do?