Java Code Examples for org.eclipse.jface.preference.StringFieldEditor#setEmptyStringAllowed()

The following examples show how to use org.eclipse.jface.preference.StringFieldEditor#setEmptyStringAllowed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EsbPreferencePage.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
    StringFieldEditor localRestServiceUri = new StringFieldEditor(Activator.REST_URI_PREFERENCE,
            Messages.EsbPreferencePage_DEFAULT_REST_ENDPOINT_URI, getFieldEditorParent());
    localRestServiceUri.setEmptyStringAllowed(false);
    addField(localRestServiceUri);

    StringFieldEditor defaultServiceNamespace = new StringFieldEditor(Activator.DEFAULT_SL_NAMESPACE_PREF,
            Messages.EsbPreferencePage_SL_NAMESPACE, getFieldEditorParent());
    defaultServiceNamespace.setEmptyStringAllowed(false);
    addField(defaultServiceNamespace);
    
    BooleanFieldEditor ignoreSLStudio = new BooleanFieldEditor(Activator.IGNORE_SL_STUDIO,
            Messages.EsbPreferencePage_IGNORE_SL_STUDIO, getFieldEditorParent());
    addField(ignoreSLStudio);
}
 
Example 2
Source File: AnalysisPreferencesPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  FileFieldEditor executable = new FileFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EXECUTABLE,
      "Maven Executable", 
      true, parent);
  executable.setEmptyStringAllowed(false);

  BooleanFieldEditor systemjava = new BooleanFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_SYSTEMJAVA,
      "Use System JAVA_HOME",
      BooleanFieldEditor.SEPARATE_LABEL, parent);

  final DirectoryFieldEditor javahome = new DirectoryFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_JAVAHOME,
      "JAVA_HOME", parent);

  StringFieldEditor effectivepom = new StringFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EFFECTIVEPOM,
      "Maven Effective POM command", parent);
  effectivepom.setEmptyStringAllowed(false);

  addField(executable);
  addField(systemjava);
  addField(javahome);
  addField(effectivepom);
}
 
Example 3
Source File: AnalysisPreferencesPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  FileFieldEditor executable = new FileFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EXECUTABLE,
      "Maven Executable", 
      true, parent);
  executable.setEmptyStringAllowed(false);

  BooleanFieldEditor systemjava = new BooleanFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_SYSTEMJAVA,
      "Use System JAVA_HOME",
      BooleanFieldEditor.SEPARATE_LABEL, parent);

  final DirectoryFieldEditor javahome = new DirectoryFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_JAVAHOME,
      "JAVA_HOME", parent);

  StringFieldEditor effectivepom = new StringFieldEditor(
      AnalysisPreferenceIds.MVN_ANALYSIS_EFFECTIVEPOM,
      "Maven Effective POM command", parent);
  effectivepom.setEmptyStringAllowed(false);

  addField(executable);
  addField(systemjava);
  addField(javahome);
  addField(effectivepom);
}
 
Example 4
Source File: PreferencesPage.java    From JReFrameworker with MIT License 5 votes vote down vote up
@Override
protected void createFieldEditors() {
	StringFieldEditor mergeRenamingPrefixStringField = new StringFieldEditor(JReFrameworkerPreferences.MERGE_RENAMING_PREFIX, "&" + MERGE_RENAME_PREFIX_DESCRIPTION, getFieldEditorParent());
	// class files do not have a defined max length, see http://stackoverflow.com/a/695959/475329
	// but if long prefixes becomes a problem use the setTextLimit(int) method to limit input length
	mergeRenamingPrefixStringField.setEmptyStringAllowed(false);
	String mergeRenamingPrefix = JReFrameworkerPreferences.getMergeRenamingPrefix();
	if(mergeRenamingPrefix == null || mergeRenamingPrefix.equals("")){
		mergeRenamingPrefixStringField.setStringValue(JReFrameworkerPreferences.MERGE_RENAMING_PREFIX_DEFAULT);
	}
	addField(mergeRenamingPrefixStringField);
	addField(new BooleanFieldEditor(JReFrameworkerPreferences.VERBOSE_LOGGING, "&" + VERBOSE_LOGGING_DESCRIPTION, getFieldEditorParent()));
}
 
Example 5
Source File: CommentBlocksPreferences.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
    final Composite p = getFieldEditorParent();
    multiBlock = new StringFieldEditor(MULTI_BLOCK_COMMENT_CHAR, "Multi-block char (ctrl+4):", 2, p);
    multiBlock.getTextControl(p).setTextLimit(1);
    multiBlock.setEmptyStringAllowed(false);
    addField(multiBlock);

    addField(new BooleanFieldEditor(MULTI_BLOCK_COMMENT_SHOW_ONLY_CLASS_NAME,
            "In a class name, create block only with class name above of class?", p));
    addField(new BooleanFieldEditor(MULTI_BLOCK_COMMENT_SHOW_ONLY_FUNCTION_NAME,
            "In a function name, create block only with function name above of function?", p));

    labelMulti = new Label(p, SWT.NONE);

    singleBlock = new StringFieldEditor(SINGLE_BLOCK_COMMENT_CHAR, "Single-block char (ctrl+shift+4):", 2, p);
    singleBlock.setEmptyStringAllowed(false);
    singleBlock.getTextControl(p).setTextLimit(1);
    addField(singleBlock);

    alignSingle = new BooleanFieldEditor(SINGLE_BLOCK_COMMENT_ALIGN_RIGHT,
            "Align text in single-block to the right?", p);
    addField(alignSingle);
    labelSingle = new Label(p, SWT.NONE);

    IPreferenceStore store = getPreferenceStore();
    setLabelFont(p, labelSingle);
    setLabelFont(p, labelMulti);

    updateMulti(store.getString(MULTI_BLOCK_COMMENT_CHAR));
    updateSingle(store.getString(SINGLE_BLOCK_COMMENT_CHAR), store.getBoolean(SINGLE_BLOCK_COMMENT_ALIGN_RIGHT));
}