Package org.eclipse.swt.widgets

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


  protected void handleFileLocationButtonSelected() {
    if (shell != null && locationField != null) {
      FileDialog fileDialog = new FileDialog(shell, SWT.NONE);
      fileDialog.setFileName(locationField.getText());
      String text = fileDialog.open();
      if (text != null) {
        locationField.setText(text);
      }
    }
View Full Code Here


        }
        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

      @Override
      public void run() {
        FileDialog dialog = new FileDialog(view.getSite().getShell(),
            SWT.OPEN);
        dialog.setFilterExtensions(new String[]{"*.json"});
        String result = dialog.open();
        if (result != null) {
          try {
            String jsonText = IOUtils.readFile(new File(result));
            JSONObject jsonObj = new JSONObject(jsonText);
            col.insert(JSONUtils.toDBObject(jsonObj));
View Full Code Here

        InputDialog dialog = new InputDialog(view.getSite().getShell(),
            getCaption("collection.renameColl"),
            getCaption("collection.msg.newCollName"),
            col.getName(), new RequiredInputValidator(
                getCaption("collection.msg.inputCollName")));
        if (dialog.open() == InputDialog.OK) {
          try {
            col.rename(dialog.getValue());
          } catch (MongoException ex) {
            UIUtils.openErrorDialog(view.getSite().getShell(),
                ex.toString());
View Full Code Here

    scriptField = new StringButtonDialogField(new IStringButtonAdapter() {
      @Override
      public void changeControlPressed(DialogField field) {
        FileDialog dialog = new FileDialog(getShell());
        String path = dialog.open();
        if (path != null) {
          scriptField.setText(path);
        }
      }
    });
View Full Code Here

        dialog.setText("Select PLT file");
        dialog.setFileName(s);
        dialog.setFilterPath(s);
        dialog.setFilterNames(new String[] { "Dialyzer PLT file (*.plt)", "Any File" });
        dialog.setFilterExtensions(new String[] { "*.plt", "*.*" });
        final String result = dialog.open();
        return result;
    }

    private void changeSelectedPLTFiles() {
        final IStructuredSelection selection = (IStructuredSelection) fPLTTableViewer
View Full Code Here

        }
        final FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
        dialog.setText("Select file with external modules");
        dialog.setFileName(last);
        dialog.setFilterExtensions(new String[] { "*.erlidex" });
        final String result = dialog.open();
        if (result == null) {
            return;
        }
        externalModules.setText(result);
    }
View Full Code Here

        }
        final FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
        dialog.setText("Select file with external include files");
        dialog.setFileName(last);
        dialog.setFilterExtensions(new String[] { "*.erlidex" });
        final String result = dialog.open();
        if (result == null) {
            return;
        }
        externalIncludes.setText(result);
    }
View Full Code Here

    public void run() {

        final FileDialog fd = new FileDialog(shell, SWT.SAVE);
        fd.setText("Select directory to export your HTML reports");
        fd.setFilterExtensions(new String[] { "*.*" });
        final String path = fd.open();

        log.info(path);
        if (path == null) {
            return;
        }
View Full Code Here

        final FileDialog fileChooser = new FileDialog(getShell(), SWT.SAVE);
        fileChooser.setText("Save image file");
        fileChooser.setFilterPath(currentDir);
        fileChooser.setFilterExtensions(new String[] { "*.jpg;*.png" });
        fileChooser.setFilterNames(new String[] { "Image file " + " (jpeg, png)" });
        final String filename = fileChooser.open();
        if (filename != null) {
            final ImageLoader imageLoader = new ImageLoader();
            imageLoader.data = new ImageData[] { sourceImage.getImageData() };
            final Path p = new Path(filename);
            if (p.getFileExtension() == "jpg") {
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.