public static File saveFile(Window parent, String title, String description, Set<String> extensions) { return saveFile(parent, title, description, extensions, null); }
public static File saveFile(Window parent, String title, String description, Set<String> extensions) { return saveFile(parent, title, description, extensions, null); }
public static File saveFile(Window parent, String title, String description, Set<String> extensions) { return saveFile(parent, title, description, extensions, null); }
/** * @deprecated Use saveFile(Window parent, String title, String description, Set<String> extensions) */ @Deprecated public static File saveFile(Window parent, String title, Set<String> extensions) { return saveFile(parent, title, null, extensions, null); }
/** * @deprecated Use saveFile(Window parent, String title, String description, Set<String> extensions) */ @Deprecated public static File saveFile(Window parent, String title, Set<String> extensions) { return saveFile(parent, title, null, extensions, null); }
/** * * @param parent * @param title * @param extensions * @param initialName * @deprecated Use saveFile(Window parent, String title, final String description, final Set<String> extensions, String initialName) */ @Deprecated public static File saveFile(Component parent, String title, Set<String> extensions, String initialName) { return saveFile(parent, title, null, extensions, initialName); }
/** * * @param parent * @param title * @param extensions * @param initialName * @deprecated Use saveFile(Window parent, String title, final String description, final Set<String> extensions, String initialName) */ @Deprecated public static File saveFile(Component parent, String title, Set<String> extensions, String initialName) { return saveFile(parent, title, null, extensions, initialName); }
private void browseForLocation() { Set<String> exts = new HashSet<>(); exts.add(".owl"); exts.add(".rdf"); File file = UIUtil.saveFile(new JFrame(), "Select a file", "OWL File", exts, getOntologyLocalName()); if (file != null) { locationField.setText(file.toString()); } }
private void browseForLocation() { Set<String> exts = new HashSet<String>(); exts.add(".owl"); exts.add(".rdf"); File file = UIUtil.saveFile(new JFrame(), "Select a file", "OWL File", exts, getOntologyLocalName()); if (file != null) { locationField.setText(file.toString()); } }
private void browseForLocation() { Set<String> exts = new HashSet<>(); exts.add(".owl"); exts.add(".rdf"); File file = UIUtil.saveFile(new JFrame(), "Select a file", "OWL File", exts, getOntologyLocalName()); if (file != null) { locationField.setText(file.toString()); } }
private void browseForLocation() { Set<String> exts = new HashSet<String>(); exts.add(".owl"); exts.add(".rdf"); File file = UIUtil.saveFile(new JFrame(), "Select a file", "OWL File", exts, getOntologyLocalName()); if (file != null) { locationField.setText(file.toString()); } }
public void browseForFile() { Window f = (Window) SwingUtilities.getAncestorOfClass(Window.class, this); File file = dialogMode == OPEN_DIALOG_MODE ? UIUtil.openFile(f, fileChooserText, "OWL File", extensions) : UIUtil.saveFile(new JFrame(),fileChooserText, "OWL File", extensions); if (file != null) { textField.setText(file.toString()); } }
public void browseForFile() { Window f = (Window) SwingUtilities.getAncestorOfClass(Window.class, this); File file = dialogMode == OPEN_DIALOG_MODE ? UIUtil.openFile(f, fileChooserText, "OWL File", extensions) : UIUtil.saveFile(new JFrame(),fileChooserText, "OWL File", extensions); if (file != null) { textField.setText(file.toString()); } }
public void browseForFile() { Window f = (Window) SwingUtilities.getAncestorOfClass(Window.class, this); File file = dialogMode == OPEN_DIALOG_MODE ? UIUtil.openFile(f, fileChooserText, "OWL File", extensions) : UIUtil.saveFile(new JFrame(),fileChooserText, "OWL File", extensions); if (file != null) { textField.setText(file.toString()); } }
public File saveOWLFile(String title) { return UIUtil.saveFile((JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, getParent()), title, "OWL File", OWL_EXTENSIONS); }
public File saveOWLFile(String title) { return UIUtil.saveFile((JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, getParent()), title, "OWL File", OWL_EXTENSIONS); }
public File saveOWLFile(String title) { return UIUtil.saveFile((JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, getParent()), title, "OWL File", OWL_EXTENSIONS); }
public File saveOWLFile(String title) { return UIUtil.saveFile((JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, getParent()), title, "OWL File", OWL_EXTENSIONS); }
public void actionPerformed(ActionEvent event) { TabbedWorkspace workspace = (TabbedWorkspace) getWorkspace(); Set<String> extensions = new HashSet<>(); extensions.add("xml"); String fileName = workspace.getSelectedTab().getLabel().replace(' ', '_') + ".layout.xml"; File f = UIUtil.saveFile((Window) SwingUtilities.getAncestorOfClass(Window.class, workspace), "Save layout to", "XML Layout", extensions, fileName); if (f == null) { return; } try { f.getParentFile().mkdirs(); FileWriter writer = new FileWriter(f); ((WorkspaceViewsTab) workspace.getSelectedTab()).getViewsPane().saveViews(writer); writer.close(); JOptionPane.showMessageDialog(workspace, "Layout saved to: " + f); } catch (IOException e) { logger.error("An error occurred when saving a tab layout to {}.", f, e); JOptionPane.showMessageDialog(workspace, "There was a problem saving the layout", "Error", JOptionPane.ERROR_MESSAGE); } }
public static void saveExplanationAsOntology(OWLEditorKit editorKit, Explanation<?> explanation) throws OWLOntologyCreationException, OWLOntologyChangeException, OWLOntologyStorageException { File f = UIUtil.saveFile( SwingUtilities.getAncestorOfClass(JFrame.class, editorKit.getWorkspace()), "Save ontology as", "Save justification as ontology", CollectionFactory.createSet("owl", "txt", "rdf"), "justification.owl"); if(f == null) { return; } OWLOntologyManager man = OWLManager.createOWLOntologyManager(); OWLOntology ont = man.createOntology(explanation.getAxioms()); OWLDataFactory df = man.getOWLDataFactory(); IRI annotationIRI = IRI.create("http://owl.cs.manchester.ac.uk/explanation/annotations/inferredAxiom"); String entailmentRendering = editorKit.getOWLModelManager().getRendering((OWLAxiom) explanation.getEntailment()); OWLAnnotationProperty prop = df.getOWLAnnotationProperty(annotationIRI); OWLAnnotation anno = df.getOWLAnnotation(prop, df.getOWLLiteral(entailmentRendering)); man.applyChange(new AddOntologyAnnotation(ont, anno)); man.saveOntology(ont, IRI.create(f)); } }