Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.FileDialog


                            IPath p = ((IFile) elements[0]).getProjectRelativePath();
                            path = p.toString();
                        }
                    }
                } else {
                    FileDialog dialog = new FileDialog(IvyPlugin.getActiveWorkbenchShell(),
                            SWT.OPEN);
                    dialog.setText("Choose an ivy.xml");
                    path = dialog.open();
                }

                if (path != null) {
                    conf.ivyXmlPath = path;
                    ivyFilePathText.setText(path);
View Full Code Here


        retrievePatternText.setEnabled(doRetrieveButton.getSelection() && projectSpecific);
        alphaOrderCheck.setEnabled(projectSpecific);
    }

    File getFile(File startingDirectory) {
        FileDialog dialog = new FileDialog(getShell(), SWT.OPEN);
        if (startingDirectory != null) {
            dialog.setFileName(startingDirectory.getPath());
        }
        dialog.setFilterExtensions(new String[] {"*.xml", "*"});
        String file = dialog.open();
        if (file != null) {
            file = file.trim();
            if (file.length() > 0) {
                return new File(file);
            }
View Full Code Here

            String ret = dialog.open();
            if (ret != null)
              text.setText(ret);

          } else {
            FileDialog dialog = new FileDialog(button.getShell(),
                SWT.OPEN);
            dialog.setFileName(text.getText());
            dialog.setText(title);

            String ret = dialog.open();
            if (ret != null)
              text.setText(ret);

          }
        }
View Full Code Here

    input.setLayoutData(data);
   
    button.addListener(SWT.MouseUp, new Listener() {
      @Override
      public void handleEvent(Event arg0) {
        FileDialog dialog = new FileDialog(parent.getShell(), SWT.OPEN);
        String filepath = dialog.open();
        if (filepath != null) {
          input.setText(filepath);
        }
      }
    });
View Full Code Here

      }
    }
  }

  private void export() {
    FileDialog dialog = new FileDialog(shell, SWT.SAVE);
    dialog.setText(i18nFile.getText(I18nFile.EXPORTREDIS));
    String[] filterExt = { "*.*" };
    dialog.setFilterExtensions(filterExt);
    String file = dialog.open();
    if (file != null) {
      File exportFile = new File(file);

      boolean ok = false;
      boolean exist = exportFile.exists();
View Full Code Here

      treeItem = getTreeItemByTableItem((TableItem) itemsSelected[0]);
    }

    parseContainer(treeItem, cinfo);

    FileDialog dialog = new FileDialog(shell, SWT.OPEN);
    dialog.setText(i18nFile.getText(I18nFile.IMPORTREDIS));
    String[] filterExt = { "*.*" };
    dialog.setFilterExtensions(filterExt);
    String file = dialog.open();
    if (file != null) {
      ImportService service = new ImportService(file, cinfo.getId(),
          cinfo.getDb());
      try {
        service.importFile();
View Full Code Here

            }
        });
        btnAddExternal.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                FileDialog dialog = new FileDialog(getShell(), SWT.OPEN | SWT.MULTI);
                dialog.setFilterExtensions(new String[] {
                    "*.jar"}); //$NON-NLS-1$
                String res = dialog.open();
                if (res != null) {
                    IPath filterPath = new Path(dialog.getFilterPath());

                    String[] fileNames = dialog.getFileNames();
                    List<IPath> added = new ArrayList<IPath>(fileNames.length);
                    for (String fileName : fileNames) {
                        added.add(filterPath.append(fileName));
                    }
                    if (!added.isEmpty()) {
View Full Code Here

        browseButton = BaseWidgetUtils.createButton( parent, Messages.getString( "FileBrowserWidget.BrowseButton" ), 1 ); //$NON-NLS-1$
        browseButton.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent event )
            {
                FileDialog fileDialog = new FileDialog( parent.getShell(), type );
                fileDialog.setText( title );

                fileDialog.setFilterExtensions( extensions );

                File file = new File( fileCombo.getText() );
                if ( file.isFile() )
                {
                    fileDialog.setFilterPath( file.getParent() );
                    fileDialog.setFileName( file.getName() );
                }
                else if ( file.isDirectory() )
                {
                    fileDialog.setFilterPath( file.getPath() );
                }
                else
                {
                    fileDialog.setFilterPath( BrowserCommonActivator.getDefault().getDialogSettings().get(
                        BrowserCommonConstants.DIALOGSETTING_KEY_RECENT_FILE_PATH ) );
                }

                String returnedFileName = fileDialog.open();
                if ( returnedFileName != null )
                {
                    fileCombo.setText( returnedFileName );
                    File file2 = new File( returnedFileName );
                    BrowserCommonActivator.getDefault().getDialogSettings().put(
View Full Code Here

        {
            returnData = currentData;
        }
        else if ( buttonId == SAVE_BUTTON_ID )
        {
            FileDialog fileDialog = new FileDialog( getShell(), SWT.SAVE );
            fileDialog.setText( Messages.getString( "HexDialog.SaveData" ) ); //$NON-NLS-1$
            // fileDialog.setFilterExtensions(new String[]{"*.jpg"});
            String returnedFileName = fileDialog.open();
            if ( returnedFileName != null )
            {
                try
                {
                    File file = new File( returnedFileName );
                    FileUtils.writeByteArrayToFile( file, currentData );
                }
                catch ( IOException e )
                {
                    ConnectionUIPlugin.getDefault().getExceptionHandler().handleException(
                        new Status( IStatus.ERROR, BrowserCommonConstants.PLUGIN_ID, IStatus.ERROR, Messages
                            .getString( "HexDialog.CantWriteToFile" ), e ) ); //$NON-NLS-1$
                }
            }
        }
        else if ( buttonId == LOAD_BUTTON_ID )
        {
            FileDialog fileDialog = new FileDialog( getShell(), SWT.OPEN );
            fileDialog.setText( Messages.getString( "HexDialog.LoadData" ) ); //$NON-NLS-1$
            String returnedFileName = fileDialog.open();
            if ( returnedFileName != null )
            {
                try
                {
                    File file = new File( returnedFileName );
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.action.Action#run()
     */
    public void run()
    {
        FileDialog dialog = new FileDialog( window.getShell(), SWT.OPEN | SWT.MULTI );
        dialog.setText( Messages.getString( "OpenFileAction.Open_File" ) ); //$NON-NLS-1$
        dialog.setFilterPath( filterPath );
        dialog.open();
        String[] names = dialog.getFileNames();

        if ( names != null )
        {
            filterPath = dialog.getFilterPath();

            int numberOfFilesNotFound = 0;
            StringBuffer notFound = new StringBuffer();
            IWorkbenchPage page = window.getActivePage();
            for ( String name : names )
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.