Examples of DirectoryDialog


Examples of org.eclipse.swt.widgets.DirectoryDialog

      GridData locationBrowseButtonData = new GridData(SWT.FILL, SWT.CENTER, false, false);
      locationBrowseButton.setLayoutData(locationBrowseButtonData);
      locationBrowseButton.setText("Browse...");
      locationBrowseButton.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          DirectoryDialog dialog = new DirectoryDialog(getShell());
          dialog.setText("Select Location");

          String path = locationCombo.getText();
          if(path.length() == 0) {
            path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toPortableString();
          }
          dialog.setFilterPath(path);

          String selectedDir = dialog.open();
          if(selectedDir != null) {
            locationCombo.setText(selectedDir);
            useDefaultWorkspaceLocationButton.setSelection(false);
            dialogChanged();
          }
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

        btnBrowseFolder.setText("Browse");

        btnBrowseFolder.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                DirectoryDialog dialog = new DirectoryDialog(getShell());
                String path = dialog.open();
                if (path != null)
                    txtFolderPath.setText(path);
            }
        });

        updateEnablement();
        validate();

        Listener listener = new Listener() {
            public void handleEvent(Event event) {
                jar = btnJar.getSelection();
                jarPath = txtJarPath.getText();

                folder = btnFolder.getSelection();
                folderPath = txtFolderPath.getText();

                updateEnablement();
                validate();
            }
        };

        txtJarPath.addListener(SWT.Modify, listener);
        btnJar.addListener(SWT.Selection, listener);
        txtFolderPath.addListener(SWT.Modify, listener);
        btnFolder.addListener(SWT.Selection, listener);

        btnBrowseJar.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
                dialog.setFilterExtensions(new String[] {
                    "*.jar"
                });
                dialog.setFilterNames(new String[] {
                    "JAR Files"
                });
                String path = dialog.open();
                if (path != null)
                    txtJarPath.setText(path);
            }
        });
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

            }
        });
        btnBrowse.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                DirectoryDialog dialog = new DirectoryDialog(group.getShell());
                dialog.setMessage("Choose a directory for the project contents:");
                String directoryName = txtLocation.getText().trim();
                if (directoryName == null || directoryName.length() == 0) {
                    String previous = JavaPlugin.getDefault().getDialogSettings().get(DIALOGSTORE_LAST_EXTERNAL_LOC);
                    if (previous != null)
                        directoryName = previous;
                }

                assert (directoryName != null);

                if (directoryName.length() > 0) {
                    File path = new File(directoryName);
                    if (path.exists())
                        dialog.setFilterPath(directoryName);
                }

                String selected = dialog.open();
                if (selected != null) {
                    IPath path = new Path(selected);
                    if (projectName != null && !projectName.equals(path.lastSegment()))
                        selected = path.append(projectName).toString();
                    txtLocation.setText(selected);
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

        final Button btnBrowse = new Button(this, SWT.NONE);
        btnBrowse.setText("Browse");
        btnBrowse.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent e) {
                final DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.NULL);
                final String path = dialog.open();
                if (path != null) {
                    text.setText(path);
                }
                notifyListeners();
            }
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

        PerlEditor editor = getEditor();
        IFileEditorInput editorInput = (IFileEditorInput) editor.getEditorInput();
        String filePath = editorInput.getFile().getLocation().makeAbsolute().toString();

        // Display directory dialog
        DirectoryDialog directoryDialog =
            new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                SWT.SAVE);
        directoryDialog.setText("Select Output Directory");
        directoryDialog.setMessage("HTML Export...");

        directoryDialog.setFilterPath(lastSelectedDir);

        String outputDir = directoryDialog.open();
        if (outputDir == null) return;
       
        lastSelectedDir = outputDir;

        // Export options
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

{
    public static void loadFile(Shell shell, Text text, String msg, boolean isDirectory)
    {
        if (isDirectory)
        {
            DirectoryDialog dialog = new DirectoryDialog(shell, SWT.NONE);
            dialog.setMessage(msg);
            String value = dialog.open();
            if (value != null)
            {
                text.setText(value);
            }
        }
        else
        {
            FileDialog dialog = new FileDialog(shell, SWT.NONE);
            dialog.setText(msg);
            String value = dialog.open();
            if (value != null)
            {
                text.setText(value);
            }
        }
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

    }

    private void add()
    {
        Shell shell = SigilUI.getActiveWorkbenchShell();
        DirectoryDialog dialog = new DirectoryDialog(shell);
        String dir = dialog.open();
        if (dir != null)
        {
            Install install = new Install(UUID.randomUUID().toString(), dir);
            if (install.getType() == null)
            {
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

      setTitle("Edit Library Path");
    }

    fPathDialogField = new StringButtonDialogField(new IStringButtonAdapter() {
      public void changeControlPressed(DialogField field) {
        DirectoryDialog dialog = new DirectoryDialog(getShell());
        dialog.setFilterPath(fPathDialogField.getText());
        dialog.setText("Select the library path");
        dialog.setMessage("Please select the path which represent the PEAR library.");
        String newPath = dialog.open();
        if (newPath != null) {
          fPathDialogField.setText(newPath);
          doValidation();
        }
      }
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

    });
   
    Button browse = SWTUtil.createButton(this, Messages.LHttpdRuntimeComposite_Browse);
    browse.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent se) {
        DirectoryDialog dialog = new DirectoryDialog(LHttpdRuntimeComposite.this.getShell());
        dialog.setMessage(Messages.LHttpdRuntimeComposite_SelectApacheXamppInstallDir);
        dialog.setFilterPath(installDir.getText());
        String selectedDirectory = dialog.open();
        if (selectedDirectory != null)
          installDir.setText(selectedDirectory);
      }
    });
   
    installLabel = new Label(this, SWT.RIGHT);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalIndent = 10;
    installLabel.setLayoutData(data);
   
    install = SWTUtil.createButton(this, Messages.LHttpdRuntimeComposite_Install);
    install.setEnabled(false);
    install.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent se) {
        String license = null;
        try {
          license = ir.getLicense(new NullProgressMonitor());
        } catch (CoreException e) {
          PEXServerPlugin.logError("Error getting license", e); //$NON-NLS-1$
        }
        TaskModel taskModel = new TaskModel();
        taskModel.putObject(LicenseWizardFragment.LICENSE, license);
        TaskWizard wizard2 = new TaskWizard(Messages.LHttpdRuntimeComposite_TitleDownloadAndInstall, new WizardFragment() {
          protected void createChildFragments(List<WizardFragment> list) {
            list.add(new LicenseWizardFragment());
          }
        }, taskModel);
       
        WizardDialog dialog2 = new WizardDialog(getShell(), wizard2);
        if (dialog2.open() == Window.CANCEL)
          return;
       
        DirectoryDialog dialog = new DirectoryDialog(LHttpdRuntimeComposite.this.getShell());
        dialog.setMessage(Messages.LHttpdRuntimeComposite_SelectXamppInstallDir);
        dialog.setFilterPath(installDir.getText());
        String selectedDirectory = dialog.open();
        if (selectedDirectory != null) {
          final IPath installPath = new Path(selectedDirectory);
          installRuntimeJob = new Job(Messages.LHttpdRuntimeComposite_TaskInstallingRuntime) {
            public boolean belongsTo(Object family) {
              return PEXServerUiPlugin.PLUGIN_ID.equals(family);
View Full Code Here

Examples of org.eclipse.swt.widgets.DirectoryDialog

    configuration.setAttribute(TestabilityConstants.CONFIGURATION_ATTR_RUN_ON_BUILD,
        false);
  }

  private void setUpBrowseFolderDialog() {
    DirectoryDialog directoryDialog = new DirectoryDialog(getControl().getShell());
    String folder = directoryDialog.open();
    if (folder != null && folder.length() > 0) {
      reportFolderText.setText(folder);
      setTabDirty();
    }
  }
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.