Examples of FileDialog


Examples of org.eclipse.swt.widgets.FileDialog

    _lstDefaultPlugins.setItems(pluginNames.toArray(new String[0]));
   
  }

  protected void handleAddDefaultPlugin() {
    FileDialog dialog = new FileDialog(getShell(), SWT.MULTI);
    dialog.setText("Select plugin files to add");
    dialog.setFilterExtensions(new String[] {"*.wgaplugin"});
    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];
        try {         
          _deployment.addDefaultPlugin(new File(dir, filename));           
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

      new AERunnable()
      {
        public void
        runSupport()
        {
          FileDialog dialog =
            new FileDialog( Utils.findAnyShell(), SWT.SYSTEM_MODAL | SWT.SAVE );
         
          dialog.setFilterPath( TorrentOpener.getFilterPathData() );
                     
          dialog.setText(MessageText.getString("subscript.export.select.template.file"));
         
          dialog.setFilterExtensions(new String[] {
              "*.vuze",
              "*.vuz",
              Constants.FILE_WILDCARD
            });
          dialog.setFilterNames(new String[] {
              "*.vuze",
              "*.vuz",
              Constants.FILE_WILDCARD
            });
         
          String path = TorrentOpener.setFilterPathData( dialog.open());

          if ( path != null ){
           
            String lc = path.toLowerCase();
           
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

  protected String getBrowseImageResource() {
    return "openFolderButton";
  }
 
  protected String openDialog(Shell shell, String old_value) {
        FileDialog dialog = new FileDialog(shell, SWT.APPLICATION_MODAL);
        dialog.setFilterPath(old_value);
        if (this.extension_list != null) {
          dialog.setFilterExtensions(this.extension_list);
        }
        return dialog.open();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    Messages.setLanguageText(browse, "importTorrentWizard.torrentfile.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[]{"*.torrent", "*.tor", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);
      }    
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    Button browse = new Button(panel,SWT.PUSH);
    Messages.setLanguageText(browse, "importTorrentWizard.importfile.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[]{"*.xml", Constants.FILE_WILDCARD});
     
      String path = fd.open();
     
      if(path != null) {
       
        textPath.setText(path);     
      }    
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

          new AERunnable()
          {
            public void
            runSupport()
            {
              FileDialog dialog =
                new FileDialog( shell, SWT.SYSTEM_MODAL | SWT.SAVE );
             
              dialog.setFilterPath( TorrentOpener.getFilterPathData() );
                         
              dialog.setText(MessageText.getString("metasearch.export.select.template.file"));
             
              dialog.setFilterExtensions(new String[] {
                  "*.vuze",
                  "*.vuz",
                  Constants.FILE_WILDCARD
                });
              dialog.setFilterNames(new String[] {
                  "*.vuze",
                  "*.vuz",
                  Constants.FILE_WILDCARD
                });
             
              String path = TorrentOpener.setFilterPathData( dialog.open());
   
              if ( path != null ){
               
                String lc = path.toLowerCase();
               
                if ( !lc.endsWith( ".vuze" ) && !lc.endsWith( ".vuz" )){
                 
                  path += ".vuze";
                }
               
                try{
                  engine.exportToVuzeFile( new File( path ));
                 
                  Map params = new HashMap();
                  params.put( "id", new Long( id ));
                  sendBrowserMessage( "metasearch", "exportTemplateCompleted", params );

                }catch( Throwable e ){
                 
                  Map params = new HashMap();
                  params.put( "id", new Long( id ));
                  params.put( "error", "save failed: " + Debug.getNestedExceptionMessage(e));

                  sendBrowserMessage("metasearch", "exportTemplateFailed",params);
                }
              }else{
               
                Map params = new HashMap();
                params.put( "id", new Long( id ));
                params.put( "error", "operation cancelled" );

                sendBrowserMessage("metasearch", "exportTemplateFailed",params);
              }
            }
          });
      }
    }else if ( OP_IMPORT_TEMPLATE.equals(opid)){
           
      final Shell shell = Utils.findAnyShell();
     
      shell.getDisplay().asyncExec(
        new AERunnable()
        {
          public void
          runSupport()
          {
            FileDialog dialog =
              new FileDialog( shell, SWT.SYSTEM_MODAL | SWT.OPEN );
           
            dialog.setFilterPath( TorrentOpener.getFilterPathData() );
                       
            dialog.setText(MessageText.getString("metasearch.import.select.template.file"));
           
            dialog.setFilterExtensions(new String[] {
                "*.vuze",
                "*.vuz",
                Constants.FILE_WILDCARD
              });
            dialog.setFilterNames(new String[] {
                "*.vuze",
                "*.vuz",
                Constants.FILE_WILDCARD
              });
           
            String path = TorrentOpener.setFilterPathData( dialog.open());
 
            if ( path != null ){
             
              VuzeFileHandler vfh = VuzeFileHandler.getSingleton();
             
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    final MenuItem save_item = new MenuItem(popup_menu,SWT.PUSH);
    save_item.setText(_._("mainwindow.logtab.popupmenu.save"));
    save_item.setImage(SWTImageRepository.getImage("save.png"));
    save_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        FileDialog dialog = new FileDialog (getShell(), SWT.SAVE);
        dialog.setFilterNames (new String [] {"All Files (*.*)"});
        dialog.setFilterExtensions (new String [] {"*.*"});
        dialog.open();
        String filename = dialog.getFileName();
        if (filename == null) return ;
        final String full_path = (dialog.getFilterPath() + File.separator + filename);
        final String content = log_content.getText();
        new Thread( new JMRunnable() {
          public void JMRun() {
            try {
              FileWriter file_writer = new FileWriter(full_path);
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    browse_button.setFont(skin.getButtonFont());
    browse_button.setText(_._("serverlistimportwindow.button.browse"));
   
    browse_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        FileDialog dialog = new FileDialog (shell, SWT.OPEN);
        dialog.setFilterNames (new String [] {"Server.met(*.met)", "All Files (*.*)"});
        dialog.setFilterExtensions (new String [] {"*.met", "*.*"});
        String result = dialog.open();
        if (result != null)
          file_path.setText(result);
    } });
   
   
View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

      search.setText("Search...");
      search.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
      search.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
          dialog.setFilterExtensions(new String[] { "*.opml", "*.xml", "*.*" });
          String file = dialog.open();
          if (file != null)
            fInput.setText(file);
        }
      });

View Full Code Here

Examples of org.eclipse.swt.widgets.FileDialog

    if (URIUtils.ABOUT_BLANK.equals(fBrowser.getControl().getUrl()))
      return;

    /* Ask user for File */
    FileDialog dialog = new FileDialog(getSite().getShell(), SWT.SAVE);
    dialog.setOverwrite(true);
    dialog.setFilterExtensions(new String[] { ".html" }); //$NON-NLS-1$
    dialog.setFileName("site.html"); //$NON-NLS-1$

    String fileName = dialog.open();
    if (fileName == null)
      return;

    StringBuilder content = new StringBuilder();
    content.append(fBrowser.getControl().getText());
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.