Search code examples
javaxmleclipsepluginsprotege

Protege plugin development: protege views sources?


I am trying to develop a plug-in for the Protege desktop application and I would like to find any reusable piece of code in the default views that Protege comes with.

The whole application can be downloaded using, a svn client, from https://smi-protege.stanford.edu/repos/protege/protege4/ide/eclipse/protege4.1/trunk/ For more information on how to set up Eclipse and run the application, please refer to this

Now, when a tab is loaded into the program, it is loaded according to the viewconfig-xxx.xml file associated. In the case of the DLQuery tab, for example, the viewconfig-dlquerytab.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <VSNode splits="0.3 0.7">

        <CNode>
            <Component label="Asserted hierarchy">
                <Property id="pluginId" value="org.protege.editor.owl.OWLAssertedClassHierarchy"/>
            </Component>
        </CNode>

        <CNode>
            <Component label="DL Query">
                <Property id="pluginId" value="org.coode.dlquery.OWLClassExpressionEditorViewComponent"/>
            </Component>
        </CNode>

    </VSNode>

</layout>

Saying that the default configuration of the DLQuery tab shows the following views:

  1. Asserted hierrarchy, which can be found (supposedly) in org.protege.editor.owl.OWLAssertedClassHierarchy

  2. DL Query, which can be found (actually) in org.coode.dlquery.OWLClassExpressionEditorViewComponent

Now, this source files that point to the views are somewhat elusive and I cannot find most of them (the ones referring to org.protege.owl.editor, which contains just 4 classes as indicated in the picture). I would really like to take a look at them and look for reusable code, since I am kinda new to Swing and plugin development.

picture

Please, any guidance will be greatly appreciated :'(


Solution

  • Ok, I found it right after posting the question. I guess it happens quite often..

    So, I ran a deep search in my foulder explorer starting from the root protege4.1 and found several files that contained the view name, said OWLAssertedClassHierarchy. I opened the file Protege4.1\org.protege.editor.owl\build\classes\plugin.xml and it turns out that the name I was looking for was just an alias! In this .xml file I found the source file it refers to: org.protege.editor.owl.ui.view.cls/ToldOWLClassHierarchyViewComponent.java

    Moral of the story: don't ever believe a .xml file without double checking