Examples of showSaveDialog()


Examples of javax.swing.JFileChooser.showSaveDialog()

    JFileChooser chooser = proj.createChooser();
    File oldSelected = factory.getCurrentImage(instance);
    if (oldSelected != null) chooser.setSelectedFile(oldSelected);
    chooser.setDialogTitle(Strings.get("ramSaveDialogTitle"));
    int choice = chooser.showSaveDialog(frame);
    if (choice == JFileChooser.APPROVE_OPTION) {
      File f = chooser.getSelectedFile();
      try {
        HexFile.save(f, s.getContents());
        factory.setCurrentImage(instance, f);
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

      }
      select.setSelectedFile(new File((new File(mSavePath).getParent())
          + File.separator + fileName + ext));
    }

    if (select.showSaveDialog(CalendarExportPlugin.getInstance()
        .getBestParentFrame()) == JFileChooser.APPROVE_OPTION) {

      String filename = select.getSelectedFile().getAbsolutePath();

      if (!filename.toLowerCase().endsWith(ext)) {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

   * @param extension The file extension of the destination file
   */
  public static File showSaveFileDialog(Widget parent, String extension) {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileFilter(new ExtensionFilter(extension, true));
    if (chooser.showSaveDialog(parent.getRealWidget()) == JFileChooser.APPROVE_OPTION) {
      String path = chooser.getSelectedFile().getPath();
      if (!path.endsWith("." + extension))
        path = path + "." + extension;
      return new File(path);
    } else {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

      if (parentDir != null)
      {
        fileChooser.setCurrentDirectory(parentDir);
      }
    }
    final int result = fileChooser.showSaveDialog(parent);
    if (result == JFileChooser.APPROVE_OPTION)
    {
      final File resultFile = fileChooser.getSelectedFile();
      instances.put(key, resultFile);
      return resultFile;
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

public class FileUtils {

    public static String getFilePathToSaveFromUser(String title) {
        JFileChooser chooser = getChooser(title);
        int state = chooser.showSaveDialog(null);
        String ret = handleResponse(chooser, state);
        return ret;
    }

    public static String getFilePathToOpenFromUser(String title) {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

            public void actionPerformed(ActionEvent e) {
                EsriLayer layer = pickEsriLayer();
                if (layer != null) {
                    JFileChooser fileChooser = new JFileChooser();
                    fileChooser.setFileFilter(new EsriFilter());
                    int returnVal = fileChooser.showSaveDialog(null);
                    if (returnVal == JFileChooser.APPROVE_OPTION) {
                        try {
                            File file = fileChooser.getSelectedFile();
                            String path = file.getCanonicalPath();
                            EsriGraphicList list = layer.getEsriGraphicList();
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

     */
    public File promptForFile(FileFilter fileFilter) {
        JFileChooser chooser = new JFileChooser();
        chooser.addChoosableFileFilter(fileFilter);

        if (chooser.showSaveDialog(parent) != JFileChooser.APPROVE_OPTION) {
            return null;
        }

        return chooser.getSelectedFile();
    }
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

    if (lastFolder != null)
    {
      fileChooser.setCurrentDirectory(lastFolder);
    }
   
    int retValue = fileChooser.showSaveDialog(this);
    if (retValue == JFileChooser.APPROVE_OPTION)
    {
      FileFilter fileFilter = fileChooser.getFileFilter();
      File file = fileChooser.getSelectedFile();
     
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

      File trackFile = null;
      JFileChooser chooser = new JFileChooser(getChooserRoot());
      chooser.addChoosableFileFilter(new MixFileFilter());
      chooser.addChoosableFileFilter(new HTMLFileFilter());

      int rc = chooser.showSaveDialog(SimpleMixer.this);

      if (rc == JFileChooser.APPROVE_OPTION) {
    trackFile = chooser.getSelectedFile();
    FileFilter ff = chooser.getFileFilter();
    if (ff instanceof ExtensionFilter) {
View Full Code Here

Examples of javax.swing.JFileChooser.showSaveDialog()

                 result = true;
             }
            break;
         }

         if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION)
         {
            
            _toSaveTo = chooser.getSelectedFile();

            if (!_toSaveTo.exists() && null != fileAppenixes.get(chooser.getFileFilter()))
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.