/* use JFileChooser jfc to browse files */ private void BrowseFiles() { jfc.SetDialogTitle("Open file"); int status = jfc.ShowOpenDialog(this); if (status == JFileChooser.ApproveOption) { urlTextField.SetText(jfc.GetSelectedFile().GetPath()); openButton.SetEnabled(true); } }
// end class SaveOutputThread /// <summary>Opens dialog to load a serialized parser</summary> public virtual void LoadParser() { jfc.SetDialogTitle("Load parser"); int status = jfc.ShowOpenDialog(this); if (status == JFileChooser.ApproveOption) { string filename = jfc.GetSelectedFile().GetPath(); if (filename.EndsWith(".jar")) { string model = chooseJarParser.Show(filename, jfcLocation.location); if (model != null) { LoadJarParser(filename, model); } } else { LoadParser(filename); } } }
public virtual File GetFile(bool open) { File file = null; int returnVal; if (open) { returnVal = fileChooser.ShowOpenDialog(frame); } else { returnVal = fileChooser.ShowSaveDialog(frame); } if (returnVal == JFileChooser.ApproveOption) { file = fileChooser.GetSelectedFile(); if (open && !CheckFile(file)) { file = null; } } return(file); }