Examples of DirectoryFieldEditor


Examples of org.eclipse.jface.preference.DirectoryFieldEditor

    Group cloningGroup = new Group(main, SWT.SHADOW_ETCHED_IN);
    cloningGroup.setText(UIText.GitPreferenceRoot_CloningRepoGroupHeader);
    GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1)
        .applyTo(cloningGroup);
    DirectoryFieldEditor editor = new DirectoryFieldEditor(
        UIPreferences.DEFAULT_REPO_DIR,
        UIText.GitPreferenceRoot_DefaultRepoFolderLabel, cloningGroup) {

      /** The own control is the variableButton */
      private static final int NUMBER_OF_OWN_CONTROLS = 1;

      @Override
      protected boolean doCheckState() {
        String fileName = getTextControl().getText();
        fileName = fileName.trim();
        if (fileName.length() == 0 && isEmptyStringAllowed())
          return true;

        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
        String substitutedFileName;
        try {
          substitutedFileName = manager.performStringSubstitution(fileName);
        } catch (CoreException e) {
          // It's apparently invalid
          return false;
        }

        File file = new File(substitutedFileName);
        // other than the super implementation, we don't
        // require the file to exist
        return !file.exists() || file.isDirectory();
      }

      @Override
      public int getNumberOfControls() {
        return super.getNumberOfControls() + NUMBER_OF_OWN_CONTROLS;
      }

      @Override
      protected void doFillIntoGrid(Composite parent, int numColumns) {
        super.doFillIntoGrid(parent, numColumns - NUMBER_OF_OWN_CONTROLS);
      }

      @Override
      protected void adjustForNumColumns(int numColumns) {
        super.adjustForNumColumns(numColumns - NUMBER_OF_OWN_CONTROLS);
      }

      @Override
      protected void createControl(Composite parent) {
        // setting validate strategy using the setter method is too late
        super.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);

        super.createControl(parent);

        if (HAS_DEBUG_UI)
          addVariablesButton(parent);
      }

      private void addVariablesButton(Composite parent) {
        Button variableButton = new Button(parent, SWT.PUSH);
        variableButton.setText(UIText.GitPreferenceRoot_DefaultRepoFolderVariableButton);

        variableButton.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            org.eclipse.debug.ui.StringVariableSelectionDialog dialog = new org.eclipse.debug.ui.StringVariableSelectionDialog(
                getShell());
            int returnCode = dialog.open();
            if (returnCode == Window.OK)
              setStringValue(dialog.getVariableExpression());
          }
        });
      }
    };
    updateMargins(cloningGroup);
    editor.setEmptyStringAllowed(false);
    editor.getLabelControl(cloningGroup).setToolTipText(
        UIText.GitPreferenceRoot_DefaultRepoFolderTooltip);
    addField(editor);

    Group remoteConnectionsGroup = new Group(main, SWT.SHADOW_ETCHED_IN);
    GridDataFactory.fillDefaults().grab(true, false).span(GROUP_SPAN, 1)
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

  };
  mCodeSourceOptionsCombo = new LabelCombo(composite, "select code", ncol, comboListener);

  mCodeSourceOptionsCombo.mCombo.setItems(codeOptions);

  mTemplateFolderEditor = new DirectoryFieldEditor("temp1", "Custom Template Location:", composite);
  mExampleEditor = new ArduinoSampleSelector(composite, SWT.NONE, "Select Example code.");
  // GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
  // gd.horizontalSpan = ncol;
  // mExampleEditor.setLayoutData(gd);
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

    public MyDirectoryFieldEditor(String name, String labelText, Composite parent) {// , String suffix) {
  if (Platform.getOS().equals(Platform.OS_MACOSX)) {
      theEditor = new FileFieldEditor(name, labelText, parent);
  } else {
      theEditor = new DirectoryFieldEditor(name, labelText, parent);
  }
  // mySuffix = suffix;
    }
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

  if (LibPath.isEmpty()) {
      String libraryPath = Common.getDefaultPrivateLibraryPath();
      new File(libraryPath).mkdirs();
      ArduinoInstancePreferences.setPrivateLibraryPath(libraryPath);
  }
  mArduinoPrivateLibPath = new DirectoryFieldEditor(ArduinoConst.KEY_PRIVATE_LIBRARY_PATH, "Private Library path", parent);
  addField(mArduinoPrivateLibPath);

  LibPath = ArduinoInstancePreferences.getPrivateHardwarePath();
  if (LibPath.isEmpty()) {
      String hardwarePath = Common.getDefaultPrivateHardwarePath();
      new File(hardwarePath).mkdirs();
      ArduinoInstancePreferences.setPrivateHardwarePath(hardwarePath);
  }
  mArduinoPrivateHardwarePath = new DirectoryFieldEditor(ArduinoConst.KEY_PRIVATE_HARDWARE_PATH, "Private hardware path", parent);
  addField(mArduinoPrivateHardwarePath);

  Dialog.applyDialogFont(parent);

  mArduinoIdeVersion = new StringFieldEditor(ArduinoConst.KEY_ARDUINO_IDE_VERSION, "Arduino IDE Version", parent);
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

   
  }
 
  private void addSnippetsSection(Composite parent) {
    Composite composite = createDefaultComposite(parent);
    snippetsPathField = new DirectoryFieldEditor("", "Path to snippets directory", composite);
        snippetsPathField.setStringValue(SNIPPETS_PATH_PROPERTY);
       
   
    try {
      String snippetsPath =
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

    setPreferenceStore(CFMLPlugin.getDefault().getPreferenceStore());
    setDescription("These preferences will allow you to customize the Dictionaries.\n\n");
  }

  protected void createFieldEditors() {
    addField(new DirectoryFieldEditor(CFMLPreferenceConstants.P_DICTIONARIES_PATH, "Dictionary directory", getFieldEditorParent()));
  }
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

       
       
        FilePathComposite.setText("File Paths"); //$NON-NLS-1$
       
        // Snippets
        snippetsPathField = new DirectoryFieldEditor("", "Path to snippets directory", FilePathComposite);
        snippetsPathField.setStringValue(preferenceManager.snippetsPath());

    }
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

    setDescription("These preferences will allow you to customize the what SnipEx servers will be aggregated in your snippet view.\n\n");
    cfmlpm = SnippetPlugin.getDefault().getPreferenceManager();
  }

  protected void createFieldEditors() {
    addField(new DirectoryFieldEditor(CFMLPreferenceConstants.P_SNIPPETS_PATH, "Default snippets directory", getFieldEditorParent()));
    addField(new StringFieldEditor(SnipExPreferenceConstants.P_SNIPEX_URL1,"URL 1",getFieldEditorParent()));
    addField(new StringFieldEditor(SnipExPreferenceConstants.P_SNIPEX_URL2,"URL 2",getFieldEditorParent()));
    addField(new StringFieldEditor(SnipExPreferenceConstants.P_SNIPEX_URL3,"URL 3",getFieldEditorParent()));
    addField(new StringFieldEditor(SnipExPreferenceConstants.P_SNIPEX_URL4,"URL 4",getFieldEditorParent()));
    addField(new StringFieldEditor(SnipExPreferenceConstants.P_SNIPEX_URL5,"URL 5",getFieldEditorParent()));
View Full Code Here

Examples of org.eclipse.jface.preference.DirectoryFieldEditor

    separator.setLayoutData(gridData);
  }
 
  private void addSnippetsSection(Composite parent) {
    Composite composite = createDefaultComposite(parent);
    snippetsPathField = new DirectoryFieldEditor("", "Path to snippets directory", composite);
        snippetsPathField.setStringValue(SNIPPETS_PATH_PROPERTY);
       
   
    try {
      String snippetsPath =
View Full Code Here

Examples of ptolemy.backtrack.eclipse.plugin.widgets.DirectoryFieldEditor

                        + "classes, and packages where the classes are in. A prefix "
                        + "may be added to existing package declarations at the time "
                        + "of refactoring.");

        Composite currentComposite = _newComposite(composite);
        _root = new DirectoryFieldEditor(PreferenceConstants.BACKTRACK_ROOT,
                "&Root of refactoring:", currentComposite, true);

        GridData gridData = new GridData();
        gridData.widthHint = 0;
        gridData.horizontalAlignment = SWT.FILL;
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.