Exemplo n.º 1
0
 public static void showDialog(OWLEditorKit editorKit, Set<OWLOntology> ontologies) {
   SaveConfirmationPanel panel = new SaveConfirmationPanel(editorKit, ontologies);
   JOptionPaneEx.showConfirmDialog(
       editorKit.getWorkspace(),
       "Saved ontologies",
       panel,
       JOptionPane.PLAIN_MESSAGE,
       JOptionPane.DEFAULT_OPTION,
       null);
 }
Exemplo n.º 2
0
  public void actionPerformed(ActionEvent event) {
    OWLOntologySelectorPanel2 ontologyList =
        new OWLOntologySelectorPanel2(getOWLEditorKit(), getOWLModelManager().getOntologies());
    ontologyList.checkAll(false);

    if (JOptionPaneEx.showConfirmDialog(
            getWorkspace(),
            "Close ontologies",
            ontologyList,
            JOptionPane.PLAIN_MESSAGE,
            JOptionPane.OK_CANCEL_OPTION,
            ontologyList)
        == JOptionPane.OK_OPTION) {
      if (ontologyList.getSelectedOntologies().size()
          == getOWLModelManager().getOntologies().size()) {
        ProtegeManager.getInstance().disposeOfEditorKit(getOWLEditorKit());
      } else {
        for (OWLOntology ont : ontologyList.getSelectedOntologies()) {
          getOWLModelManager().removeOntology(ont);
        }
      }
    }
  }