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] using PromptTab in my own application

Norma Elisa Cabrera Gonzales normacg at uclv.edu.cu
Tue Sep 7 18:45:29 PDT 2010


Hi everyone,
I need to merge two domain ontologies semiautomatically. I want to use PROMPT, but I want to use it without Protégé. How can I use PROMPT Tab in my own application?
I tried with the code below, but raise this exception:
Exception in thread "main" java.lang.NullPointerException
      at edu.stanford.smi.protegex.prompt.PromptTab.addNotify(PromptTab.java:280)
      at java.awt.Container.addNotify(Unknown Source)
      at javax.swing.JComponent.addNotify(Unknown Source)
      at java.awt.Container.addNotify(Unknown Source)
      at javax.swing.JComponent.addNotify(Unknown Source)
      at java.awt.Container.addNotify(Unknown Source)
      at javax.swing.JComponent.addNotify(Unknown Source)
      at javax.swing.JRootPane.addNotify(Unknown Source)
      at java.awt.Container.addNotify(Unknown Source)
      at java.awt.Window.addNotify(Unknown Source)
      at java.awt.Frame.addNotify(Unknown Source)
      at java.awt.Window.pack(Unknown Source)
      at cu.edu.uclv.mermai.LoadPrompt.LoadPrompt.main(LoadPrompt.java:39)

public static void main(String[] args) {
  ArrayList errors = new ArrayList();

  Project prj = Project.loadProjectFromFile("test/default.pprj", errors);

  if (errors.size() > 0) {
    System.out.println("There were erros at loading prj: " + prj);
    return;}

  // In the next line, replace "PromptTab" with the plug-in class that you want to show in the JFrame
  WidgetDescriptor widgetDescriptor = prj.getTabWidgetDescriptor("edu.stanford.smi.protegex.prompt.PromptTab");

  if (widgetDescriptor == null) {
  System.out.println("Cannot instantiate tab widget.");
  return;}

  TabWidget widget = WidgetUtilities.createTabWidget(widgetDescriptor, prj);

  JFrame frame = new JFrame("My Application Frame");
  frame.getContentPane().add((Component)widget);
  frame.pack();
  frame.setVisible(true);
}


Best regards and thank in advance,
Norma

Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu




More information about the protege-discussion mailing list