Examples of showOpenDialog()


Examples of gov.nasa.arc.mct.gui.FileChooser.showOpenDialog()

    fileChooser.setApproveButtonText(bundle.getString("export_button"));
    fileChooser.setFileSelectionMode(FileChooser.FILES_ONLY);
    fileChooser.setFileFilter(new XMLFileFilter());
    if (source == null)
      return null;
    int returnVal = fileChooser.showOpenDialog(source);

    if (returnVal == FileChooser.APPROVE_OPTION) {
      File file = fileChooser.getSelectedFile();

      // check if the selected file ends with the extension
View Full Code Here

Examples of gov.nasa.jsc.mct.importExport.utilities.CustomFileChooser.showOpenDialog()

        fileChooser.setFileFilter(new XMLFileFilter());
        fileChooser.setMultiSelectionEnabled(true);
       
        if (source == null) return null;
        int returnVal = fileChooser.showOpenDialog(source);

        if (returnVal == FileChooser.APPROVE_OPTION) {
            File[] rootFileOrDir = fileChooser.getSelectedFiles();
            List<File> files = Utilities.filterSelectedFiles(Arrays.asList(rootFileOrDir));    
            //set the owner
View Full Code Here

Examples of java.awt.FileDialog.showOpenDialog()

            } else {
                JFileChooser dia = new JFileChooser(".");
                dia.setCurrentDirectory(new File(System.getProperty("user.home")));
                dia.setDialogTitle("Please show me the path to " + fileID + " (select the directory and confirm)");
                dia.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                int result = dia.showOpenDialog(null);
                if (result == JFileChooser.APPROVE_OPTION) {
                    dotStarterFileFile = dia.getSelectedFile();
                } else {
                    GeneralDialog.message(fileID + " is not available, sorry I will not be able to perform the according actions.", fileID + " not available");
                    throw new RuntimeException(fileID + " not available: " + dsf);
View Full Code Here

Examples of javafx.stage.FileChooser.showOpenDialog()

    private BorderPane root;

    @FXML
    protected void handleMenuItemImportCsvAction(final ActionEvent event) {
        final FileChooser fileChooser = new FileChooser();
        final File importFile = fileChooser.showOpenDialog(root.getScene().getWindow());
        if (importFile == null) {
            return;
        }

        final ImportController importController = new ImportControllerImpl(PersistenceHelper.getInstance().createEntityManager());
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

      public void actionPerformed(ActionEvent event) {
        File file = new File(tf.getText());
        JFileChooser fileChooser = new JFileChooser(file.getParent());
        String[] extArr = { ".jpg", ".jpeg", ".gif", ".png" };
        fileChooser.setFileFilter(new util.ui.ExtensionFileFilter(extArr, ".jpg, .gif, png"));
        if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
          File selection = fileChooser.getSelectedFile();
          if (selection != null) {
            tf.setText(selection.getAbsolutePath());
          }
        }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

        Designer.findWindowFor(this) == null ?
        null : Designer.findWindowFor(this).getFrame();
      JFileChooser chooser = Designer.getChooser();
      chooser.setDialogTitle(I18N.get("Report.select_source_file"));
      Designer.setPrefsDir(chooser, "dataSourceDir");
      int returnVal = chooser.showOpenDialog(frame);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        Designer.savePrefsDir(chooser, "dataSourceDir");
        dataSource.setSourceFile(chooser.getSelectedFile().getPath());
      } else {
        throw new UserCancellationException(I18N.get("Report.user_cancelled"));
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

   */
  private void changeIcon() {
    JFileChooser fileChooser = new JFileChooser(mIconFile);
    String[] extArr = { ".jpg", ".jpeg", ".gif", ".png" };
    fileChooser.setFileFilter(new util.ui.ExtensionFileFilter(extArr, ".jpg, .gif, .png"));
    if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
      File selection = fileChooser.getSelectedFile();
      if (selection != null) {
        mIconFile = selection;
        mIconLabel.setIcon(createUserIcon());
      }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

        ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

              if (this.modelsDirectory != null) {
                fileChooser.setCurrentDirectory(this.modelsDirectory);
              }
              fileChooser.setDialogTitle(dialogTitle);
              fileChooser.setMultiSelectionEnabled(true);
              if (fileChooser.showOpenDialog((JComponent)parentView) == JFileChooser.APPROVE_OPTION) {
                // Retrieve current directory for future calls
                this.modelsDirectory = fileChooser.getCurrentDirectory();
                // Return selected files separated by path separator character
                String files = "";
                for (File selectedFile : fileChooser.getSelectedFiles()) {
View Full Code Here

Examples of javax.swing.JFileChooser.showOpenDialog()

        final ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        file = fc.getSelectedFile();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.