/**
  * Invoked when an action occurs.
  *
  * @param ae The {@code ActionEvent} of the action that occured
  * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
  */
 public void actionPerformed(@Nullable ActionEvent ae) {
   String[] chosenDirectories =
       GUIUtilities.showVFSFileDialog(
           jEdit.getActiveView(), directoryTextField.getText(), CHOOSE_DIRECTORY_DIALOG, false);
   if (null != chosenDirectories) {
     directoryTextField.setText(chosenDirectories[0]);
     directoryTextField.setCaretPosition(0);
   }
 }
    // {{{ actionPerformed() method
    @Override
    public void actionPerformed(ActionEvent ae) {

      path =
          jEdit.getProperty(
              PluginManager.PROPERTY_PLUGINSET, jEdit.getSettingsDirectory() + File.separator);
      String[] selectedFiles =
          GUIUtilities.showVFSFileDialog(
              InstallPanel.this.window, jEdit.getActiveView(), path, VFSBrowser.OPEN_DIALOG, false);
      if (selectedFiles == null || selectedFiles.length != 1) return;

      path = selectedFiles[0];
      boolean success = loadPluginSet(path);
      if (success) {
        jEdit.setProperty(PluginManager.PROPERTY_PLUGINSET, path);
      }
      updateUI();
    } // }}}
    public void actionPerformed(ActionEvent evt) {
      Object source = evt.getSource();
      if (source instanceof JRadioButton) updateEnabled();
      if (source == ok) ok();
      else if (source == cancel) cancel();
      else if (source == combo) updateList();
      else if (source == fileButton) {
        String directory;
        if (fileIcon == null) directory = null;
        else directory = MiscUtilities.getParentOfPath(fileIcon);
        String paths[] =
            GUIUtilities.showVFSFileDialog(null, directory, VFSBrowser.OPEN_DIALOG, false);
        if (paths == null) return;

        fileIcon = "file:" + paths[0];

        try {
          fileButton.setIcon(new ImageIcon(new URL(fileIcon)));
        } catch (MalformedURLException mf) {
          Log.log(Log.ERROR, this, mf);
        }
        fileButton.setText(MiscUtilities.getFileName(fileIcon));
      }
    }
Example #4
0
  public void chooseFile() {
    if (!h4JmfPlugin.jmf_ok) return;
    if (h4JmfPlugin.playMP3 != null) {
      h4JmfPlugin.cnsl.append("playMP3!=null");
      return;
    }

    String tmpdir = System.getProperty("java.io.tmpdir");
    String[] paths =
        GUIUtilities.showVFSFileDialog(
            view, tmpdir + File.separator, JFileChooser.OPEN_DIALOG, false);
    // if(paths!=null && !paths[0].equals(filename))
    if (paths != null) {
      String filename = paths[0];
      h4JmfPlugin.cnsl.append("filename=" + filename);
      try {
        URL url = new URL("file://" + filename);
        player_begin(url);
      } catch (Exception e) {
        logger.severe(e.getMessage());
        h4JmfPlugin.cnsl.append(e);
      }
    }
  } // chooseFile