Examples of SaveDialog


Examples of lupos.gui.operatorgraph.visualeditor.util.SaveDialog

    final JMenuItem exportMI = new JMenuItem("Export Document");
    exportMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));

        if(chooser.showDialog(DocumentEditorPane.this.that, "Export") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".rif")) {
            fileName += ".rif";
          }
          DocumentEditorPane.this.visualRifEditor.getSaveLoader().export(fileName);
        }
      }
    });

    final JMenuItem importMI = new JMenuItem("Import Document");
    importMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));

        if(chooser.showDialog(DocumentEditorPane.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();
          DocumentEditorPane.this.visualRifEditor.importNewDocument(FileHelper.fastReadFile(fileName));
        }
      }
    });
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.util.SaveDialog

    final JMenuItem saveMI = new JMenuItem("Save File");
    saveMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("JSON Save files", "json"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Save") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".json")) {
            fileName += ".json";
          }

          VisualRifEditor.this.that.saveLoader.save(fileName);
        }
      }
    });


    final JMenuItem importMI = new JMenuItem("Import Document");
    importMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {
        final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "txt","rif"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
          final String fileName = chooser.getSelectedFile().getAbsolutePath();

          VisualRifEditor.this.that.importNewDocument(FileHelper.fastReadFile(fileName));
        }
      }
    });

    final JMenuItem exportMI = new JMenuItem("Export Document");
    exportMI.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(final ActionEvent ae) {

        final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
        chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        chooser.setFileFilter(new FileNameExtensionFilter("rif document", "txt","rif"));

        if(chooser.showDialog(VisualRifEditor.this.that, "Export") == SaveDialog.APPROVE_OPTION) {
          String fileName = chooser.getSelectedFile().getAbsolutePath();

          if(!fileName.endsWith(".rif")) {
            fileName += ".rif";
          }
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.