Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.FileDialog


    return composite;
  }

  private void handleBrowse() {
    FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
    dialog.setText("Select file");
    dialog.setFilterExtensions(new String[] { "*.zip", "*.wgaplugin" });
    String selectedFile = dialog.open();
    if (selectedFile != null) {
      String[] fileNames = dialog.getFileNames();
      File dir = new File(dialog.getFilterPath());
      if (fileNames.length > 0) {   
        _tmplFile.setText(new File(dir, fileNames[0]).getAbsolutePath());
      }
    }
  }
View Full Code Here


    Messages.setLanguageText(browse, "exportTorrentWizard.exportfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
     
      public void handleEvent(Event arg0){
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow(), SWT.SAVE );
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.xml", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);
      }    
View Full Code Here

    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "exportTorrentWizard.torrentfile.browse");
    browse.addListener(SWT.Selection,new Listener() {
      public void handleEvent(Event arg0) {
       
      FileDialog fd = new FileDialog(wizard.getWizardWindow());
     
      fd.setFileName(textPath.getText());
     
      fd.setFilterExtensions(new String[]{"*.torrent", "*.tor", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);     
      }    
View Full Code Here

       * (non-Javadoc)
       *
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event arg0) {
        FileDialog fd = new FileDialog(wizard.getWizardWindow());
        if (wizard.getErrorMessage().equals("") && !((NewTorrentWizard) wizard).singlePath.equals("")) {
          fd.setFileName(((NewTorrentWizard) wizard).singlePath);
        }else{
          String  def = ((NewTorrentWizard) wizard).getDefaultOpenDir();
         
          if ( def.length() > 0 & new File(def).isDirectory() ){
           
            fd.setFilterPath( def );
          }
        }
        String f = fd.open();
        if (f != null){
            file.setText(f);
           
            File  ff = new File(f);
           
View Full Code Here

      public void runSupport() {
        final Shell shell = Utils.findAnyShell();
        if (shell == null)
          return;

        FileDialog fDialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
        fDialog.setFilterPath(getFilterPathTorrent());
        fDialog
            .setFilterExtensions(new String[] { "*.torrent", "*.tor", Constants.FILE_WILDCARD });
        fDialog.setFilterNames(new String[] { "*.torrent", "*.tor", Constants.FILE_WILDCARD });
        fDialog.setText(MessageText.getString("MainWindow.dialog.choose.file"));
        String path = setFilterPathTorrent(fDialog.open());
        if (path == null)
          return;

        TorrentOpener.openTorrentsForTracking(path, fDialog.getFileNames());
      }
    });
  }
View Full Code Here

      public void runSupport() {
        final Shell shell = Utils.findAnyShell();
        if (shell == null)
          return;

        FileDialog fDialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
        fDialog.setFilterPath(getFilterPathTorrent());
        fDialog.setFilterExtensions(new String[] {
            "*.torrent",
            "*.tor",
            Constants.FILE_WILDCARD });
        fDialog.setFilterNames(new String[] {
            "*.torrent",
            "*.tor",
            Constants.FILE_WILDCARD });
        fDialog.setText(MessageText.getString("MainWindow.dialog.choose.file"));
        String path = setFilterPathTorrent(fDialog.open());
        if (path == null)
          return;

        openTorrentWindow(path, fDialog.getFileNames(), false);
      }
    });
  }
View Full Code Here

    setControl(container);
    performValidation();
  }

  private void handleBrowse() {
    FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
    dialog.setText("Choose an export file");
    dialog.setFilterExtensions(new String[]{"*.wgadesign"});
    dialog.setFilterPath(new File(_txtExportLocation.getText()).getParentFile().getAbsolutePath());
    dialog.setFilterIndex(0);
    String selectedFile = dialog.open();
    if (selectedFile != null) {
      _txtExportLocation.setText(selectedFile);
      Plugin.getDefault().getPreferenceStore().putValue(Preferences.DESIGN_EXPORT_LOCATION, new File(_txtExportLocation.getText()).getParentFile().getAbsolutePath());
    }
  }
View Full Code Here

      bind(form, SWTBinder.BINDING_STRATEGY_AS_YOU_TYPE);
  }

  private void handleAddLibrary() {
    Shell shell = getManagedForm().getForm().getShell();
    FileDialog dialog = new FileDialog(shell, SWT.MULTI);
    dialog.setText("Select libraries to add");
    dialog.setFilterExtensions(new String[] {"*.jar"});
    String selectedFile = dialog.open();
    if (selectedFile != null) {
      String[] fileNames = dialog.getFileNames();
      File dir = new File(dialog.getFilterPath());
      for (int i = 0; i < fileNames.length; i++) {
        String filename = fileNames[i];
        boolean overwrite = true;
        if (_model.hasLibrary(filename)) {
          overwrite = MessageDialog.openConfirm(shell, "Overwrite?", "Library '" + filename + "' already exists, overwrite?");
View Full Code Here

            _headerFileMap.get(current).readSpecificHeader(project);
        }
    }

    private void handleImport() {
        FileDialog fileDialog = new FileDialog(getShell());
        fileDialog.setText("Import project headers");
        Properties properties = new Properties();
        String file = fileDialog.open();

        if (file != null) {
            try {
                properties.load(new FileInputStream(file));
                for (String key : _headerFileMap.keySet()) {
View Full Code Here

            }
        }
    }

    private void handleExport() {
        FileDialog fileDialog = new FileDialog(getShell());
        fileDialog.setText("Export project headers");
        Properties properties = new Properties();
        String fileString = fileDialog.open();
       
        if(!fileString.endsWith(".pref")){
            fileString+=".pref";
        }
       
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.FileDialog

Copyright © 2018 www.massapicom. 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.