Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.FileDialog


            final IEditorInput input = getEditorInput();

            IDocumentProvider provider = getDocumentProvider();
            final IEditorInput newInput;

            FileDialog dialog = new FileDialog( shell, SWT.SAVE );

            String path = dialog.open();
            if ( path == null )
            {
                if ( progressMonitor != null )
                {
                    progressMonitor.setCanceled( true );
View Full Code Here


        btnOpenFileDialog = new Button (row, SWT.PUSH);
        btnOpenFileDialog.setText (Messages.Wizard_WW_SelectFile);
        final Shell shell = parent.getShell();
        btnOpenFileDialog.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                FileDialog fd = new FileDialog(shell, SWT.OPEN);
                fd.setText(Messages.Wizard_WW_SelectFile);
                setLastUsedPath(fd);
               
                // Set filter on XML-files
                String[] filterExtensions = {"*.xml"}//$NON-NLS-1$
                String[] filterNames = {"NASA WorldWind Configuration File (*.xml)"}; //$NON-NLS-1$
                fd.setFilterExtensions(filterExtensions);               
                fd.setFilterNames(filterNames);
               
                // Open the dialog
                String selectedFile = fd.open();
               
                if (selectedFile != null) {
                    txtLocalFile.setText(selectedFile);                   
                    saveLastUsedPath(fd.getFilterPath());
                       
                    modifyText(null);
                }
            }

            private void saveLastUsedPath(String path) {
                if (settings != null && path != null) {
                    settings.put(WW_PATH, path);
                }
            }

            private void setLastUsedPath(FileDialog fd) {
                if (settings != null) {
                    fd.setFilterPath(settings.get(WW_PATH));
                }
            }
        });
        //endregion
       
View Full Code Here

        Button browseButton = new Button(control, SWT.PUSH);
        browseButton.setLayoutData(new GridData(SWT.END, SWT.FILL, false, false));
        browseButton.setText("...");
        browseButton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter(){
            public void widgetSelected( org.eclipse.swt.events.SelectionEvent e ) {
                FileDialog fileDialog = new FileDialog(control.getShell(), SWT.OPEN);
                String path = fileDialog.open();
                if (path == null || path.length() < 1) {
                    txtUrl.setText("");
                } else {
                    txtUrl.setText(path);
                }
View Full Code Here

 
  private Action createExportAction()
  {
    Action action = new Action() {
      public void run() {
        FileDialog saveDialog = new FileDialog(getSite().getShell(), SWT.SAVE);
        saveDialog.setFilterExtensions(new String[] { "*.txt" });
       
        String absPathName = saveDialog.open();
       
        if (absPathName != null)
        {
          try
          {
View Full Code Here

  public IEditorDescriptor getSelectedEditor() {
    return selectedEditor;
  }

  protected void promptForExternalEditor() {
    FileDialog dialog = new FileDialog(getShell(), SWT.OPEN
        | SWT.PRIMARY_MODAL);
    dialog.setFilterExtensions(Executable_Filters);
    String result = dialog.open();
    if (result != null) {
      EditorDescriptor editor = EditorDescriptor.createForProgram(result);
      // pretend we had obtained it from the list of os registered editors
      TableItem ti = new TableItem(editorTable, SWT.NULL);
      ti.setData(editor);
View Full Code Here

  /**
   * Open an appropriate destination browser so that the user can specify a
   * source to import from
   */
  protected void handleDestinationBrowseButtonPressed() {
    FileDialog dialog = new FileDialog(getContainer().getShell(),
        getFileDialogStyle());
    dialog.setText(getFileDialogTitle());
    dialog.setFilterPath(getDestinationValue());
    dialog.setFilterExtensions(new String[] { "*.epf" ,"*.*"}); //$NON-NLS-1$ //$NON-NLS-2$
    String selectedFileName = dialog.open();

    if (selectedFileName != null) {
      setDestinationValue(selectedFileName);
    }
  }
View Full Code Here

   * receive our bounty.
   *
   * @since 3.1
   */
  private final void selectedButtonExport() {
    final FileDialog fileDialog = new FileDialog(getShell(), SWT.SAVE);
    fileDialog.setFilterExtensions(new String[] { "*.csv" }); //$NON-NLS-1$
    fileDialog.setFilterNames(new String[] { Util.translateString(
        RESOURCE_BUNDLE, "csvFilterName") }); //$NON-NLS-1$
    final String filePath = fileDialog.open();
    if (filePath == null) {
      return;
    }

    final SafeRunnable runnable = new SafeRunnable() {
View Full Code Here

    }
    // name
    {
      m_imageField = new StringButtonDialogField(new IStringButtonAdapter() {
        public void changeControlPressed(DialogField field) {
          FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
          fileDialog.setFilterPath(m_imageField.getText());
          String newPath = fileDialog.open();
          if (newPath != null) {
            m_imageField.setText(newPath);
          }
        }
      });
View Full Code Here

    /**
     * Pops up the file browse dialog box
     * 
     */
    private void handleFileBrowse() {
        FileDialog fileDialog = new FileDialog(this.getShell());
        fileDialog.setFilterExtensions(new String[]{"*.jar"});
        String fileName = fileDialog.open();
        if (fileName != null) {
          javaClasspathList.add(fileName);
          updateListEntries();
        }
        updateStatusTextField(false,"");
View Full Code Here

    /**
     * Pops up the file browse dialog box
     * 
     */
    private void handleBrowse() {
        FileDialog fileDialog = new FileDialog(this.getShell());
        fileDialog.setFilterExtensions(new String[] { "*.wsdl" });
        String fileName = fileDialog.open();
        if (fileName != null) {
            fileText.setText(fileName);
        }

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