Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.DirectoryDialog


      final int attrIdx = ((FolderDescription) f.getDescription()).getCardDescription().getAttributList().indexOf(a1);

      // Keep previous dialog -> Keep memory of last directory
      if (_dd == null)
        {
        _dd = new DirectoryDialog(parent);
        }

      final String fndir = _dd.open();

      final List<DeltaMMFile> lstDelta = new LinkedList<DeltaMMFile>();
View Full Code Here


                @Override
                protected Object openDialogBox(Control cellEditorWindow)
                  {
                  if (_dd == null)
                    {
                    _dd = new DirectoryDialog(cellEditorWindow.getShell());
                    }

                  return _dd.open();
                  }
              };
View Full Code Here

    dirButton.setImage(folderIcon);
    dirButton.setToolTipText("Select document Folder");
    dirButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        DirectoryDialog dlg = new DirectoryDialog(getShell());
        dlg.setFilterPath(inputDirectoryText.getText());
        dlg.setText("Input Directory");
        dlg.setMessage("Select a directory with input document files.");
        String dir = dlg.open();
        if (dir != null) {
          documentList = new ArrayList<DocumentData>();
          File directory = new File(dir);

          System.out.println("dir :" + dir);

          String[] files = directory.list();

          for (String filePath : files) {
            DocumentData documentData = new DocumentData(new File(directory
                    + System.getProperty("file.separator") + filePath));
            documentList.add(documentData);
          }
          inputDirectoryText.setText(dir);
          tableViewer.setInput(documentList);
          tableViewer.refresh();
        }
      }
    });

    inputDirectoryText = new Text(this, SWT.SINGLE | SWT.BORDER);
    FormData inputDirectoryTextData = new FormData();
    // inputDirectoryTextData.width = 150;
    inputDirectoryTextData.left = new FormAttachment(directoryLabel, 10);
    inputDirectoryTextData.top = new FormAttachment(directoryLabel, 0, SWT.CENTER);
    inputDirectoryTextData.right = new FormAttachment(dirButton, -12);
    inputDirectoryText.setLayoutData(inputDirectoryTextData);
    inputDirectoryText.setText("");

    inputDirectoryText.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        // without that listener, the text fields forget the
        // last change when leaving with tab! don't know why!
        // we also MUST call getText() otherwise the changes in
        // the field are lost (what is this???!!)
        Text t = (Text) e.widget;
        t.getText();
        // updateViewer(t.getText());
      }
    });

    // GUI Definitions for Test Data Selection Components

    testDataLabel = new Label(this, SWT.NONE);
    FormData testDataLabelData = new FormData();
    testDataLabelData.left = new FormAttachment(0, 10);
    // testDataLabelData.right = new FormAttachment(100, -12);
    testDataLabelData.top = new FormAttachment(directoryLabel, 15);
    testDataLabel.setLayoutData(testDataLabelData);
    testDataLabel.setText("Test Data:");

    testDataButton = new Button(this, SWT.PUSH | SWT.CENTER);
    FormData testDataButtonData = new FormData();
    testDataButtonData.width = 25;
    testDataButtonData.height = 25;
    testDataButtonData.top = new FormAttachment(testDataLabel, 0, SWT.CENTER);
    testDataButtonData.right = new FormAttachment(100, -10);
    testDataButton.setLayoutData(testDataButtonData);
    folderIcon = getImage("folder");
    testDataButton.setImage(folderIcon);
    testDataButton.setToolTipText("Select the folder containing the test files");

    testDataButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent event) {
        DirectoryDialog dlg2 = new DirectoryDialog(getShell());
        dlg2.setFilterPath(testDirectoryText.getText());
        dlg2.setText("Location of the test files");
        String dir = dlg2.open();
        if (dir != null) {
          testDirectoryText.setText(dir);
        }
      }
    });
View Full Code Here

      Image folderIcon = getImage("folder");
      dirButton.setImage(folderIcon);
      dirButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
          DirectoryDialog dlg = new DirectoryDialog(getShell());
          dlg.setFilterPath(inputDirectoryText.getText());
          dlg.setText("Input Directory");
          dlg.setMessage("Select a directory with input XMI files for the learning algorithms.");
          String dir = dlg.open();
          if (dir != null) {
            inputDirectoryText.setText(dir);
          }
        }
      });

      label4 = new Label(this, SWT.NONE);
      FormData label4LData = new FormData();
      label4LData.left = new FormAttachment(0, 1000, 12);
      label4LData.top = new FormAttachment(0, 1000, 44);
      label4LData.width = 109;
      label4.setLayoutData(label4LData);
      label4.setText("Additional Data:");

      additionalDirectoryText = new Text(this, SWT.SINGLE | SWT.BORDER);
      FormData additionalDirectoryTexLData = new FormData();
      additionalDirectoryTexLData.width = 300;
      additionalDirectoryTexLData.left = new FormAttachment(0, 1000, 126);
      additionalDirectoryTexLData.top = new FormAttachment(0, 1000, 44);
      additionalDirectoryTexLData.right = new FormAttachment(1000, 1000, -110);
      additionalDirectoryText.setLayoutData(additionalDirectoryTexLData);
      additionalDirectoryText.setText("");
      additionalDirectoryText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          // without that listener, the text fields forget the
          // last change when leaving with tab! don't know why!
          // we also MUST call getText() otherwise the changes in
          // the field are lost (what is this???!!)
          Text t = (Text) e.widget;
          t.getText();
        }
      });

      additionalButton = new Button(this, SWT.PUSH | SWT.CENTER);
      FormData additionalButtoLData = new FormData();
      additionalButtoLData.width = 25;
      additionalButtoLData.height = 25;
      additionalButtoLData.top = new FormAttachment(0, 1000, 42);
      additionalButtoLData.right = new FormAttachment(1000, 1000, -80);
      additionalButton.setLayoutData(additionalButtoLData);
      folderIcon = getImage("folder");
      additionalButton.setImage(folderIcon);
      additionalButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
          DirectoryDialog dlg = new DirectoryDialog(getShell());
          dlg.setFilterPath(inputDirectoryText.getText());
          dlg.setText("Additional Directory");
          dlg.setMessage("Select a directory with input additional XMI files for the learning algorithms.");
          String dir = dlg.open();
          if (dir != null) {
            additionalDirectoryText.setText(dir);
          }
        }
      });

      label5 = new Label(this, SWT.NONE);
      FormData label5LData = new FormData();
      label5LData.left = new FormAttachment(0, 1000, 12);
      label5LData.top = new FormAttachment(0, 1000, 44 + 24);
      label5LData.width = 109;
      label5.setLayoutData(label5LData);
      label5.setText("Test Data:");

      testDirectoryText = new Text(this, SWT.SINGLE | SWT.BORDER);
      FormData testDirectoryTexLData = new FormData();
      testDirectoryTexLData.width = 300;
      testDirectoryTexLData.left = new FormAttachment(0, 1000, 126);
      testDirectoryTexLData.top = new FormAttachment(0, 1000, 44 + 24);
      testDirectoryTexLData.right = new FormAttachment(1000, 1000, -110);
      testDirectoryText.setLayoutData(testDirectoryTexLData);
      testDirectoryText.setText("");
      testDirectoryText.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          // without that listener, the text fields forget the
          // last change when leaving with tab! don't know why!
          // we also MUST call getText() otherwise the changes in
          // the field are lost (what is this???!!)
          Text t = (Text) e.widget;
          t.getText();
        }
      });
      testDirectoryText.setEnabled(false);
     
     
      testButton = new Button(this, SWT.PUSH | SWT.CENTER);
      FormData testButtoLData = new FormData();
      testButtoLData.width = 25;
      testButtoLData.height = 25;
      testButtoLData.top = new FormAttachment(0, 1000, 42 + 24);
      testButtoLData.right = new FormAttachment(1000, 1000, -80);
      testButton.setLayoutData(testButtoLData);
      folderIcon = getImage("folder");
      testButton.setImage(folderIcon);
      testButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
          DirectoryDialog dlg = new DirectoryDialog(getShell());
          dlg.setFilterPath(inputDirectoryText.getText());
          dlg.setText("Test Directory");
          dlg.setMessage("Select a directory with input test XMI files.");
          String dir = dlg.open();
          if (dir != null) {
            testDirectoryText.setText(dir);
          }
        }
      });
View Full Code Here

      Image folderIcon = getImage("folder");
      dirButton.setImage(folderIcon);
      dirButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent event) {
          DirectoryDialog dlg = new DirectoryDialog(getShell());
          dlg.setFilterPath(inputDirectoryText.getText());
          dlg.setText("Input Directory");
          dlg.setMessage("Select a directory with input XMI files.");
          String dir = dlg.open();
          if (dir != null) {
            inputDirectoryText.setText(dir);
          }
        }
      });
View Full Code Here

  /**
   * Open the file selection dialog, and add the return locations.
   */
  protected void add() {
    DirectoryDialog dialog = new DirectoryDialog(fLocationsViewer.getControl().getShell());
    dialog.setMessage("Select directory to search into");
    String result = dialog.open();
    if (result != null) {
      final File file = new File(result);
      if (this.folders == null)
        this.folders = new ArrayList();
      if (file != null && file.isDirectory()) {
View Full Code Here

    Button btnAdd = new Button(btnPanel, SWT.NONE);
    btnAdd.setText(Messages.getString("RemovableStorageDialog.BtnAdd")); //$NON-NLS-1$
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        DirectoryDialog libraryPathDialog = new DirectoryDialog(getShell());
        libraryPathDialog.open();
       
        String result = libraryPathDialog.getFilterPath();
        if ((result != null) &&
            (!result.isEmpty())) {
          dirList.add(result);
          fillList();
        }
View Full Code Here

    Button btnBrowse = new Button(container, SWT.PUSH);
    btnBrowse.setText(Messages.getString("PlaylistExportWizard.Browse")); //$NON-NLS-1$
    btnBrowse.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        if (btnDirectoryMode.getSelection()) {
          DirectoryDialog pathDialog = new DirectoryDialog(getShell());
          pathDialog.open();
          teDest.setText(pathDialog.getFilterPath());
        } else {
          FileDialog filepathDialog = new FileDialog(getShell(), SWT.SAVE);
          String[] filters = { "*.zip" }; //$NON-NLS-1$
          filepathDialog.setFilterExtensions(filters);
          filepathDialog.open();
View Full Code Here

    btnAddPath.setText(Messages.getString("FirstRunWizardLibraryPage.BtnAddPath")); //$NON-NLS-1$
    btnAddPath.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
    btnAddPath.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        setPageComplete(false);
        libraryPathDialog = new DirectoryDialog(getShell());
        libraryPathDialog.open();
        String result = libraryPathDialog.getFilterPath();
       
        if ((result != null) &&
            (!result.isEmpty())) {
View Full Code Here

        dialog.setBlockOnOpen(true);
        dialog.open();

        updateHadoopDirLabelFromPreferences();
      } else if (e.getSource() == browse) {
        DirectoryDialog dialog = new DirectoryDialog(this.getShell());
        dialog.setMessage("Select a hadoop installation, containing hadoop-X-core.jar");
        dialog.setText("Select Hadoop Installation Directory");
        String directory = dialog.open();

        if (directory != null) {
          location.setText(directory);

          if (!validateHadoopLocation()) {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.DirectoryDialog

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.