Package org.eclipse.swt.widgets

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


            FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
            if (text != null) {
                dialog.setFileName(text.getText());
            }
            dialog.setFilterExtensions(new String[] {defaultExtension, "*"});
            file = dialog.open();           
        }
        if (file != null) {
            setFile(file);
        }
    }
View Full Code Here


        // open a file dialog
        FileDialog fd = new FileDialog(Display.getCurrent().getActiveShell(), SWT.MULTI);
        fd.setText("Choose text files");
        fd.setFilterExtensions(new String[] { "*.txt", "*.rtf" });

        if (fd.open() != null) {
          for (String fileItem : fd.getFileNames()) {
            fileTable.add(new File(fd.getFilterPath() + File.separator + fileItem));
          }

          computePageComplete();
View Full Code Here

                {
                    FileDialog fileDialog = new FileDialog( ImageDialog.this.getShell(), SWT.SAVE );
                    fileDialog.setText( Messages.getString( "ImageDialog.SaveImage" ) ); //$NON-NLS-1$
                    fileDialog.setFilterExtensions( new String[]
                        { "*.jpg" } ); //$NON-NLS-1$
                    String returnedFileName = fileDialog.open();
                    if ( returnedFileName != null )
                    {
                        try
                        {
                            File file = new File( returnedFileName );
View Full Code Here

                FileDialog fileDialog = new FileDialog( ImageDialog.this.getShell(), SWT.OPEN );
                fileDialog.setText( Messages.getString( "ImageDialog.SelectImage" ) ); //$NON-NLS-1$
                // fileDialog.setFilterExtensions(IMAGE_FILE_EXTENSIONS);
                fileDialog.setFileName( new File( newImageFilenameText.getText() ).getName() );
                fileDialog.setFilterPath( new File( newImageFilenameText.getText() ).getParent() );
                String returnedFileName = fileDialog.open();
                if ( returnedFileName != null )
                {
                    newImageFilenameText.setText( returnedFileName );
                }
            }
View Full Code Here

            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

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

        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

    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

  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

    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

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.