public static void openRequest(OpenRequestHandler handler) throws Exception { 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(); } }
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(); } }
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(); } }