Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.FileDialog.open()


  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


     
      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

     
      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

          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

        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

        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

    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

  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];
View Full Code Here

    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
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.