Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] widget use examples

Michael Grove mhgrove at hotmail.com
Wed Apr 11 12:59:59 PDT 2007


All,

Are there any good examples for how to use the SubclassWidget and/or 
SuperclassWidget?  I'd like to display a list of all the sub and super 
classes for the selected class in my custom tab, and I cannot figure out how 
to properly create these widgets?  Is this not the intended use?

Here's an example of how I'm creating a SubclassWidget instance, this code 
is called from the initialize() method of my tab implementation:

        SubclassWidget aWidget = new SubclassWidget();
        aWidget.setup(this.getDescriptor(), false, getProject(), 
getKnowledgeBase().getRootCls(), null);
        aWidget.initialize();

This causes an exception to be thrown, the relevant part of the stack trace 
is as follows:

WARNING: java.lang.NullPointerException
        at 
edu.stanford.smi.protege.widget.AbstractSlotWidget.getDefaultLabel(AbstractSlotWidget.java:275)
        at 
edu.stanford.smi.protege.widget.AbstractSlotWidget.getLabel(AbstractSlotWidget.java:268)
        at 
edu.stanford.smi.protege.widget.SubclassWidget.getLabel(SubclassWidget.java:18)
        at 
edu.stanford.smi.protege.widget.AbstractListWidget.createLabeledComponent(AbstractListWidget.java:73)
        at 
edu.stanford.smi.protege.widget.AbstractListWidget.initialize(AbstractListWidget.java:99)
        at 
edu.stanford.smi.protege.widget.AbstractListWidget.initialize(AbstractListWidget.java:95)
        at 
edu.stanford.smi.protege.widget.ClsListWidget.initialize(ClsListWidget.java:84)

Because of this NPE, my tab fails to initialize.  I was hoping to use 
pre-exising protege widgets for the functionality of displaying the list of 
sub/super classes for an arbitrary class.  I'm sure this has already been 
done, so I did not want to spend time re-inventing the wheel.

On a related note, has anyone written, or does a widget exist, for 
displaying all the equivalent classes for an arbitrary class?  I'd like to 
have a Selectable list of these items just like for sub/super classes.  If 
this does not already exist, I suspect I could derive it from the 
SubclassWidget, but as I mentioned above, I can't get that working =)

Thanks for your time and help!

Cheers,

Michael

_________________________________________________________________
Exercise your brain! Try Flexicon. 
http://games.msn.com/en/flexicon/default.htm?icid=flexicon_hmemailtaglineapril07




More information about the protege-discussion mailing list