/** * This is a convenience method that can be used to obtain the top level frame for a <code>Workspace</code>. This * method actually delegates to the <code>WorkspaceManager</code> * * @param workspace The <code>Workspace</code> for which the top level frame is to be retrieved. * * @return The top level frame for a <code>Workspace</code> or <code>null</code> if there is no such * <code>Workspace</code> or no frame exists. */ public WorkspaceFrame getFrame(Workspace workspace) { return getEditorKitManager().getWorkspaceManager().getFrame(workspace); }
/** * This is a convenience method that can be used to obtain the top level frame for a <code>Workspace</code>. This * method actually delegates to the <code>WorkspaceManager</code> * * @param workspace The <code>Workspace</code> for which the top level frame is to be retrieved. * * @return The top level frame for a <code>Workspace</code> or <code>null</code> if there is no such * <code>Workspace</code> or no frame exists. */ public WorkspaceFrame getFrame(Workspace workspace) { return getEditorKitManager().getWorkspaceManager().getFrame(workspace); }
/** * This is a convenience method that can be used to obtain the top level frame for a <code>Workspace</code>. This * method actually delegates to the <code>WorkspaceManager</code> * * @param workspace The <code>Workspace</code> for which the top level frame is to be retrieved. * * @return The top level frame for a <code>Workspace</code> or <code>null</code> if there is no such * <code>Workspace</code> or no frame exists. */ public WorkspaceFrame getFrame(Workspace workspace) { return getEditorKitManager().getWorkspaceManager().getFrame(workspace); }
public void handleClose() { if (!quitting) { final EditorKitManager eKitMngr = ProtegeManager.getInstance().getEditorKitManager(); if (eKitMngr.getEditorKitCount() == 0) { handleQuit(); } } }
public void handleClose() { if (!quitting) { final EditorKitManager eKitMngr = ProtegeManager.getInstance().getEditorKitManager(); if (eKitMngr.getEditorKitCount() == 0) { handleQuit(); } } }
private void closeFirstEditorKitIfNotModified() { EditorKit firstEditorKit = this.firstEditorKit.get(); if(firstEditorKit == null) { return; } EditorKitManager editorKitManager = getEditorKitManager(); if(!firstEditorKit.hasModifiedDocument()) { editorKitManager.getWorkspaceManager().doClose(firstEditorKit.getWorkspace()); } }
private void closeFirstEditorKitIfNotModified() { if(firstEditorKit == null) { return; } EditorKit firstEditorKit = this.firstEditorKit.get(); if(firstEditorKit == null) { return; } EditorKitManager editorKitManager = getEditorKitManager(); if(!firstEditorKit.hasModifiedDocument()) { editorKitManager.getWorkspaceManager().doClose(firstEditorKit.getWorkspace()); } }
public void handleClose() { if (!quitting){ final EditorKitManager eKitMngr = ProtegeManager.getInstance().getEditorKitManager(); if (eKitMngr.getEditorKitCount() == 0){ showWelcomeFrame(); } } }
/** * Closes an <code>EditorKit</code>. This disposes of the editor kit's <code>Workspace</code>, and * closes the editor kit's model manager. */ public void disposeOfEditorKit(EditorKit editorKit) { ProtegeManager.getInstance().getEditorKitManager().removeEditorKit(editorKit); try { editorKit.dispose(); } catch (Exception e) { logger.warn("An error occurred whilst trying to dispose of the editor kit '{}': {}", editorKit.getId(), e); } System.gc(); application.handleClose(); }
public void actionPerformed(ActionEvent e) { ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager().doClose(getWorkspace()); }
public void actionPerformed(ActionEvent e) { ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager().doClose(getWorkspace()); }
public void actionPerformed(ActionEvent e) { ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager().doClose(getWorkspace()); }
/** * Closes an <code>EditorKit</code>. This disposes of the editor kit's <code>Workspace</code>, and * closes the editor kit's model manager. */ public void disposeOfEditorKit(EditorKit editorKit) { ProtegeManager.getInstance().getEditorKitManager().removeEditorKit(editorKit); try { editorKit.dispose(); } catch (Exception e) { ProtegeApplication.getErrorLog().logError(e); } System.gc(); application.handleClose(); }
public boolean openAndSetupRecentEditorKit(EditorKitDescriptor editorKitDescriptor) throws Exception { for (EditorKitFactoryPlugin plugin : getEditorKitFactoryPlugins()) { if (plugin.getId().equals(editorKitDescriptor.getEditorKitFactoryID())) { EditorKitFactory editorKitFactory = getEditorKitFactory(plugin); EditorKit editorKit = editorKitFactory.createEditorKit(); if (editorKit.handleLoadRecentRequest(editorKitDescriptor)) { getEditorKitManager().addEditorKit(editorKit); return true; } } } return false; }
public static void openRequest(OpenRequestHandler handler) throws Exception { ProtegeManager pm = ProtegeManager.getInstance(); EditorKitManager editorKitManager = pm.getEditorKitManager(); if(editorKitManager.getEditorKitCount() == 1) { EditorKit editorKit = editorKitManager.getEditorKits().get(0); if(!editorKit.hasModifiedDocument()) { handler.openInNewWorkspace(); return; } } int ret = JOptionPane.showConfirmDialog(handler.getCurrentWorkspace(), "Do you want to open the ontology in the current window?", "Open in current window", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if(ret == JOptionPane.YES_OPTION) { handler.openInCurrentWorkspace(); } else if(ret == JOptionPane.NO_OPTION) { handler.openInNewWorkspace(); } }
private void updateDirtyFlag() { WorkspaceManager workspaceManager = ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager(); JFrame frame = workspaceManager.getFrame(this); Set<OWLOntology> dirtyOntologies = getOWLModelManager().getDirtyOntologies(); boolean dirty = false; for (OWLOntology ont : getOWLModelManager().getOntologies()) { if (dirtyOntologies.contains(ont)) { dirty = true; break; } } frame.getRootPane().putClientProperty(WINDOW_MODIFIED, dirty); }
public boolean openAndSetupRecentEditorKit(EditorKitDescriptor editorKitDescriptor) throws Exception { for (EditorKitFactoryPlugin plugin : getEditorKitFactoryPlugins()) { if (plugin.getId().equals(editorKitDescriptor.getEditorKitFactoryID())) { EditorKitFactory editorKitFactory = getEditorKitFactory(plugin); EditorKit editorKit = editorKitFactory.createEditorKit(); if (editorKit.handleLoadRecentRequest(editorKitDescriptor)) { getEditorKitManager().addEditorKit(editorKit); closeFirstEditorKitIfNotModified(); return true; } } } return false; }
public boolean openAndSetupRecentEditorKit(EditorKitDescriptor editorKitDescriptor) throws Exception { for (EditorKitFactoryPlugin plugin : getEditorKitFactoryPlugins()) { if (plugin.getId().equals(editorKitDescriptor.getEditorKitFactoryID())) { EditorKitFactory editorKitFactory = getEditorKitFactory(plugin); EditorKit editorKit = editorKitFactory.createEditorKit(); if (editorKit.handleLoadRecentRequest(editorKitDescriptor)) { getEditorKitManager().addEditorKit(editorKit); closeFirstEditorKitIfNotModified(); return true; } } } return false; }
private void updateDirtyFlag() { WorkspaceManager workspaceManager = ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager(); JFrame frame = workspaceManager.getFrame(this); Set<OWLOntology> dirtyOntologies = getOWLModelManager().getDirtyOntologies(); boolean dirty = false; for (OWLOntology ont : getOWLModelManager().getOntologies()) { if (dirtyOntologies.contains(ont)) { dirty = true; break; } } frame.getRootPane().putClientProperty(WINDOW_MODIFIED, dirty); }
private void updateDirtyFlag() { WorkspaceManager workspaceManager = ProtegeManager.getInstance().getEditorKitManager().getWorkspaceManager(); JFrame frame = workspaceManager.getFrame(this); Set<OWLOntology> dirtyOntologies = getOWLModelManager().getDirtyOntologies(); boolean dirty = false; for(OWLOntology ont : getOWLModelManager().getOntologies()) { if(dirtyOntologies.contains(ont)) { dirty = true; break; } } frame.getRootPane().putClientProperty(WINDOW_MODIFIED, dirty); }