Java Code Examples for org.eclipse.jface.preference.StringFieldEditor

The following examples show how to use org.eclipse.jface.preference.StringFieldEditor. These examples are extracted from open source projects. 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
/**
 * {@inheritDoc}
 */
@Override
protected void createFieldEditors() {
	hostname = new StringFieldEditor(HACPreferenceConstants.P_HOSTNAME_URL, PreferencePage.Label.HOSTNAME_URL_INPUT_TEXT,
			getFieldEditorParent());
	username = new StringFieldEditor(HACPreferenceConstants.P_USERNAME, PreferencePage.Label.USERNAME_INPUT_TEXT,
			getFieldEditorParent());
	password = new StringFieldEditor(HACPreferenceConstants.P_PASSWORD, PreferencePage.Label.PASSWORD_INPUT_TEXT,
			getFieldEditorParent()) {
		@Override
		protected void doFillIntoGrid(final Composite parent, final int numColumns) {
			super.doFillIntoGrid(parent, numColumns);
			getTextControl().setEchoChar('*');
		}
	};
	timeout = new IntegerFieldEditor(HACPreferenceConstants.P_TIMEOUT, PreferencePage.Label.TIMEOUT_INPUT_TEXT,
			getFieldEditorParent());

	addField(hostname);
	addField(username);
	addField(password);
	addField(timeout);
}
 
Example 2
/**
 * {@inheritDoc}
 */
@Override
protected void createFieldEditors() {
	copyrightContent = new MultiLineStringFieldEditor(CopyrightPreferenceConstants.COPYRIGHT_CONTENT,
			LABELS.COPYRIGHT_CONTENTS, getFieldEditorParent());
	firstLine = new StringFieldEditor(CopyrightPreferenceConstants.COPYRIGHT_FIRST_LINE,
			LABELS.COPYRIGHT_FIRST_LINE, FIELD_WIDTH, getFieldEditorParent());
	linePrefix = new StringFieldEditor(CopyrightPreferenceConstants.COPYRIGHT_LINE_PREFIX,
			LABELS.COPYRIGHT_LINE_PREFIX, FIELD_WIDTH, getFieldEditorParent());
	lastLine = new StringFieldEditor(CopyrightPreferenceConstants.COPYRIGHT_LAST_LINE, LABELS.COPYRIGHT_LAST_LINE,
			FIELD_WIDTH, getFieldEditorParent());
	addField(copyrightContent);
	addField(firstLine);
	addField(linePrefix);
	addField(lastLine);
}
 
Example 3
Source Project: tlaplus   Source File: SpecPropertyPage.java    License: MIT License 6 votes vote down vote up
public void createFieldEditors(Composite composite) {
	// TODO change root file
	rootFileEditor = new StringFieldEditor(
			IPreferenceConstants.P_PROJECT_ROOT_FILE,
			"Specification root module", composite);
	addEditor(rootFileEditor);
	rootFileEditor.getTextControl(composite).setEditable(false);

	StringFieldEditor pcalParamEditor = new StringFieldEditor(
			IPreferenceConstants.PCAL_CAL_PARAMS, "PlusCal call arguments",
			composite);
	addEditor(pcalParamEditor);

	directorySizeEditor = new StringFieldEditor(
			"DoesNotExistIsIrrelevant",
			"Size of .toolbox directory in kbytes", composite);
	addEditor(directorySizeEditor);
	directorySizeEditor.getTextControl(composite).setEditable(false);

	libraryPathComposite = new LibraryPathComposite(this);

}
 
Example 4
Source Project: tesb-studio-se   Source File: EsbPreferencePage.java    License: 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 5
Source Project: ice   Source File: MoosePreferencePage.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
	addField(new DirectoryFieldEditor("PATH", "&Directory preference:",
			getFieldEditorParent()));
	addField(new BooleanFieldEditor("BOOLEAN_VALUE",
			"&An example of a boolean preference", getFieldEditorParent()));

	addField(new RadioGroupFieldEditor("CHOICE",
			"An example of a multiple-choice preference", 1,
			new String[][] { { "&Choice 1", "choice1" },
					{ "C&hoice 2", "choice2" } }, getFieldEditorParent()));
	addField(new StringFieldEditor("MySTRING1", "A &text preference:",
			getFieldEditorParent()));
	addField(new StringFieldEditor("MySTRING2", "A &text preference:",
			getFieldEditorParent()));
}
 
Example 6
Source Project: uima-uimaj   Source File: PreferencePage.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void createFieldEditors() {
  addField(new BooleanFieldEditor(P_JCAS, "&Automatically run JCasGen when Types change",
          getFieldEditorParent()));

  addField(new BooleanFieldEditor(P_JCAS_LIMIT_TO_PROJECT_SCOPE, "&Limit JCasGen to types defined in this project",
      getFieldEditorParent()));

  addField(new BooleanFieldEditor(P_SHOW_FULLY_QUALIFIED_NAMES, "&Show fully qualified names",
          getFieldEditorParent()));

  addField(new IntegerFieldEditor(P_XML_TAB_SPACES, "&XML indentation", getFieldEditorParent()));

  addField(new StringFieldEditor(P_VNS_HOST, "&Vinci Name Service Host IP address",
          getFieldEditorParent()));

  addField(new StringFieldEditor(P_VNS_PORT, "Vinci NameService &Port number",
          getFieldEditorParent()));
}
 
Example 7
@Override
protected void createFieldEditors(){
	Label expl = new Label(getFieldEditorParent(), SWT.WRAP);
	expl.setText(Messages.TextTemplatePreferences_ExplanationLine1
		+ Messages.TextTemplatePreferences_ExplanationLine2
		+ Messages.TextTemplatePreferences_ExplanationLine3);
	expl.setLayoutData(SWTHelper.getFillGridData(2, true, 1, false));
	addField(new StringFieldEditor(SUFFIX_STATION, SUFFIX_FOR_THIS_STATION,
		getFieldEditorParent()));
	/*
	 * IExtensionRegistry exr = Platform.getExtensionRegistry(); IExtensionPoint exp =
	 * exr.getExtensionPoint("ch.elexis.documentTemplates"); if (exp != null) { IExtension[]
	 * extensions = exp.getExtensions(); for (IExtension ex : extensions) {
	 * IConfigurationElement[] elems = ex.getConfigurationElements(); for (IConfigurationElement
	 * el : elems) { String n=el.getAttribute("name"); addField(new StringFieldEditor(BRANCH+n,
	 * n, getFieldEditorParent())); } }
	 * 
	 * }
	 */
}
 
Example 8
Source Project: olca-app   Source File: IoPreferencePage.java    License: Mozilla Public License 2.0 6 votes vote down vote up
private void createIlcdNetworkContents(Composite parent) {
	Group section = new Group(parent, SWT.SHADOW_OUT);
	section.setText(M.ILCDNetworkSettings);
	StringFieldEditor urlEditor = new StringFieldEditor(
			IoPreference.ILCD_URL, M.URL, section);
	addField(urlEditor);
	StringFieldEditor userEditor = new StringFieldEditor(
			IoPreference.ILCD_USER, M.User, section);
	addField(userEditor);
	StringFieldEditor passwordEditor = new StringFieldEditor(
			IoPreference.ILCD_PASSWORD, M.Password, section);
	passwordEditor.getTextControl(section).setEchoChar('*');
	addField(passwordEditor);
	UI.gridLayout(section, 2);
	UI.gridData(section, true, false);
}
 
Example 9
Source Project: MergeProcessor   Source File: RenamingPreferencePage.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void createFieldEditors() {
	final StringFieldEditor urlField = new StringFieldEditor(RENAME_DATABASE_URL,
			Messages.RenamingPreferencePage_databaseUrl, getFieldEditorParent());
	textUrl = urlField.getTextControl(getFieldEditorParent());
	addField(urlField);

	final StringFieldEditor userField = new StringFieldEditor(RENAME_DATABASE_USER,
			Messages.RenamingPreferencePage_databaseUserId, getFieldEditorParent());
	addField(userField);
	textUser = userField.getTextControl(getFieldEditorParent());

	final StringFieldEditor passwordField = new StringFieldEditor(RENAME_DATABASE_PASSWORD,
			Messages.RenamingPreferencePage_databasePassword, getFieldEditorParent());
	passwordField.getTextControl(getFieldEditorParent()).setEchoChar('*');
	textPassword = passwordField.getTextControl(getFieldEditorParent());
	addField(passwordField);

	final Button buttonCheckDbConnection = new Button(getFieldEditorParent(), SWT.NONE);
	GridDataFactory.swtDefaults().span(2, 1).align(SWT.RIGHT, SWT.CENTER).applyTo(buttonCheckDbConnection);
	buttonCheckDbConnection.setText(Messages.RenamingPreferencePage_buttonValidateConnection);
	buttonCheckDbConnection.addListener(SWT.Selection, e -> checkDbConnection());

	labelRenameDatabaseCopy = new Label(getFieldEditorParent(), SWT.NONE);
	labelRenameDatabaseCopy.setText("H2 Database is copied to");

	linkRenameDatabaseCopy = new Link(getFieldEditorParent(), SWT.NONE);
	linkRenameDatabaseCopy.setText("<a>C:\\dev\\mp\\rename2.mv.db</a>");
	linkRenameDatabaseCopy.addListener(SWT.Selection, e -> openDirectoryForLocalH2DatabaseCopy());

	showRenameCopyIfRequired();
}
 
Example 10
/**
 * {@inheritDoc}
 */
@Override
protected void createFieldEditors() {
	addField(new FileFieldEditor(ECLIPSE_APPLICATION_PATH,
			Messages.EclipseWorkspaceStartPeferencePage_applicationPath, getFieldEditorParent()));
	final StringFieldEditor parameters = new StringFieldEditor(ECLIPSE_APPLICATION_PARAMETERS,
			Messages.EclipseWorkspaceStartPeferencePage_parameters, 44, getFieldEditorParent());
	addField(parameters);
}
 
Example 11
Source Project: neoscada   Source File: ImportPreferencePage.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.
 */
@Override
public void createFieldEditors ()
{
    final IntegerFieldEditor fieldEditor = new IntegerFieldEditor ( PreferenceConstants.P_DEFAULT_CHUNK_SIZE, "&Default chunk size:", getFieldEditorParent () );
    fieldEditor.setEmptyStringAllowed ( false );
    fieldEditor.setValidRange ( 1, Integer.MAX_VALUE );
    fieldEditor.setValidateStrategy ( StringFieldEditor.VALIDATE_ON_KEY_STROKE );

    addField ( fieldEditor );
}
 
Example 12
protected void createCompilerSettings(Composite parent) {
	Composite composite = createGroupComposite(parent, "Solc compiler");
	compilerPathFieldEditor = new FileFieldEditor(COMPILER_PATH, "Path to solc", composite);
	addField(compilerPathFieldEditor);
	addField(new BooleanFieldEditor(COMPILER_ENABLED, "Enable solidity compiler", composite));
	addField(new BooleanFieldEditor(COMPILER_OUTPUT_BIN, "Enable solidity bin output", composite));
	addField(new BooleanFieldEditor(COMPILER_OUTPUT_ASM, "Enable solidity asm output", composite));
	addField(new BooleanFieldEditor(COMPILER_OUTPUT_ABI, "Enable solidity abi output", composite));
	addField(new StringFieldEditor(COMPILER_OUTPUT_PATH, "Compiler output path", composite));
}
 
Example 13
/**
 * {@inheritDoc}
 */
@Override
public void propertyChange(final PropertyChangeEvent event) {
	// not allowing blank fields on Preference page
	if (PreferencePage.Validation.EVENT_FIELD_EDITOR_VALUE.equals(event.getProperty())) {
		if (event.getSource() instanceof StringFieldEditor) {
			if (checkIfEmpty() && validateTimeout() && validateUrl()) {
				super.performApply();
				super.propertyChange(event);
				setValid(true);
			}
		}
	}
}
 
Example 14
Source Project: tlaplus   Source File: TLA2TeXPreferencePage.java    License: MIT License 5 votes vote down vote up
protected void createFieldEditors() {
	if (Platform.getOS().equals(Platform.OS_MACOSX)) {
		addField(new BooleanFieldEditor(
				ITLA2TeXPreferenceConstants.HAVE_OS_OPEN_PDF,
				"Have your OS open PDFs", getFieldEditorParent()));
	} else {
		addField(new BooleanFieldEditor(
				ITLA2TeXPreferenceConstants.EMBEDDED_VIEWER,
				"&Use built-in PDF viewer", getFieldEditorParent()));
	}
	
	// Preference to regenerate PDF upon spec save?
	addField(new BooleanFieldEditor(
			ITLA2TeXPreferenceConstants.AUTO_REGENERATE, "&Regenerate pretty-printed PDF on spec save (takes effect once spec re-opened).",
			getFieldEditorParent()));

	addField(new BooleanFieldEditor(
			ITLA2TeXPreferenceConstants.SHADE_COMMENTS, "&Shade comments",
			getFieldEditorParent()));
       addField(new BooleanFieldEditor(
               ITLA2TeXPreferenceConstants.NO_PCAL_SHADE, "&Do not shade PlusCal code",
               getFieldEditorParent()));
	addField(new BooleanFieldEditor(
			ITLA2TeXPreferenceConstants.NUMBER_LINES, "&Number lines",
			getFieldEditorParent()));
	addField(new StringFieldEditor(
			ITLA2TeXPreferenceConstants.DOT_COMMAND,
			"&Specify dot command", getFieldEditorParent()));
	addField(new StringFieldEditor(
			ITLA2TeXPreferenceConstants.LATEX_COMMAND,
			"&Specify pdflatex command", getFieldEditorParent()));
	addField(new DoubleFieldEditor(ITLA2TeXPreferenceConstants.GRAY_LEVEL,
			"&Specify gray level (between 0.0 and 1.0)",
			getFieldEditorParent(), 0, 1));
}
 
Example 15
protected void addFields(Composite main) {
	addField(new StorageLocationFieldEditor(ExamplesPreferenceConstants.STORAGE_LOCATION, "Storage location:",
			main));
	separator();
	StringFieldEditor remoteLocationEditor = new StringFieldEditor(ExamplesPreferenceConstants.REMOTE_LOCATION,
			"Remote location", main);
	remoteLocationEditor.getTextControl(main).setEditable(false);
	addField(remoteLocationEditor);
	separator();
	StringFieldEditor remoteBranchEditor = new StringFieldEditor(ExamplesPreferenceConstants.REMOTE_BRANCH,
			"Remote branch:", main);
	addField(remoteBranchEditor);
}
 
Example 16
Source Project: LogViewer   Source File: LogViewerPreferences.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void createBacklogField(Composite composite) {
	backlogEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BACKLOG,LogViewerPlugin.getResourceString("preferences.backlog.label.text"),composite); //$NON-NLS-1$
	backlogEditor.setPreferenceStore(doGetPreferenceStore());
	backlogEditor.setPage(this);
	backlogEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_BACKLOG).length());
	backlogEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.backlog.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_BACKLOG)})); //$NON-NLS-1$
	backlogEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	backlogEditor.setValidRange(0,ILogViewerConstants.MAX_BACKLOG);
	backlogEditor.load();
	backlogEditor.setPropertyChangeListener(validityChangeListener);
}
 
Example 17
Source Project: LogViewer   Source File: LogViewerPreferences.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void createReadBufferField(Composite composite) {
	bufferEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_BUFFER,LogViewerPlugin.getResourceString("preferences.buffer.label.text"),composite); //$NON-NLS-1$
	bufferEditor.setPreferenceStore(doGetPreferenceStore());
	bufferEditor.setPage(this);
	bufferEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE).length());
	bufferEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.buffer.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_TAIL_BUFFER_SIZE)})); //$NON-NLS-1$
	bufferEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	bufferEditor.setValidRange(0,ILogViewerConstants.MAX_TAIL_BUFFER_SIZE);
	bufferEditor.load();
	bufferEditor.setPropertyChangeListener(validityChangeListener);
}
 
Example 18
Source Project: LogViewer   Source File: LogViewerPreferences.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void createReadWaitField(Composite composite) {
	readWaitEditor = new IntegerFieldEditor(ILogViewerConstants.PREF_READWAIT,LogViewerPlugin.getResourceString("preferences.readwait.label.text"),composite); //$NON-NLS-1$
	readWaitEditor.setPreferenceStore(doGetPreferenceStore());
	readWaitEditor.setPage(this);
	readWaitEditor.setTextLimit(Integer.toString(ILogViewerConstants.MAX_READWAIT_SIZE).length());
	readWaitEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.readwait.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_READWAIT_SIZE)})); //$NON-NLS-1$
	readWaitEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	readWaitEditor.setValidRange(0,ILogViewerConstants.MAX_READWAIT_SIZE);
	readWaitEditor.load();
	readWaitEditor.setPropertyChangeListener(validityChangeListener);
}
 
Example 19
Source Project: LogViewer   Source File: LogViewerPreferences.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void createFilterExtensions(Composite composite) {
	filterExtensionsEditor = new StringFieldEditor(ILogViewerConstants.PREF_FILTER_EXTENSIONS,LogViewerPlugin.getResourceString("preferences.contenteditor.filterextensions.label.text"),composite); //$NON-NLS-1$
	filterExtensionsEditor.setPreferenceStore(doGetPreferenceStore());
	filterExtensionsEditor.setPage(this);
	filterExtensionsEditor.setTextLimit(128);
	//filterExtensionsEditor.setErrorMessage(LogViewerPlugin.getResourceString("preferences.readwait.label.errortext",new Object[]{new Integer(ILogViewerConstants.MAX_READWAIT_SIZE)})); //$NON-NLS-1$
	//filterExtensionsEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
	//filterExtensionsEditor.setValidRange(0,ILogViewerConstants.MAX_READWAIT_SIZE);
	filterExtensionsEditor.load();
	//filterExtensionsEditor.setPropertyChangeListener(validityChangeListener);
}
 
Example 20
Source Project: depan   Source File: AnalysisPreferencesPage.java    License: 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 21
Source Project: depan   Source File: AnalysisPreferencesPage.java    License: 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 22
Source Project: JReFrameworker   Source File: PreferencesPage.java    License: 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 23
@Test
public void testCreateFieldEditor() {
    Display.getDefault().asyncExec(new Runnable() {
        @Override
        public void run() {
            assertEquals(new StringFieldEditor(KEY, DESCRIPTION, parent),
                    pluginPreference.createFieldEditor(parent));
        }
    });
}
 
Example 24
/**
 * Create the Content Assist group and options if there are any for this language/editor.
 * 
 * @param parent
 */
protected Composite createContentAssistOptions(Composite parent)
{
	IPreferenceStore s = getChainedEditorPreferenceStore();

	Label label = new Label(parent, SWT.NONE);
	label.setText(Messages.CommonEditorPreferencePage_OnTypingCharacters);
	label.setLayoutData(GridDataFactory.fillDefaults().span(2, 1).create());

	if (s.contains(com.aptana.editor.common.contentassist.IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS))
	{
		addField(new StringFieldEditor(
				com.aptana.editor.common.contentassist.IPreferenceConstants.COMPLETION_PROPOSAL_ACTIVATION_CHARACTERS,
				Messages.CommonEditorPreferencePage_DisplayProposals, parent));
	}

	if (s.contains(com.aptana.editor.common.contentassist.IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS))
	{
		addField(new StringFieldEditor(
				com.aptana.editor.common.contentassist.IPreferenceConstants.CONTEXT_INFORMATION_ACTIVATION_CHARACTERS,
				Messages.CommonEditorPreferencePage_DisplayContextualInfo, parent));
	}

	if (s.contains(com.aptana.editor.common.contentassist.IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS))
	{
		addField(new StringFieldEditor(
				com.aptana.editor.common.contentassist.IPreferenceConstants.PROPOSAL_TRIGGER_CHARACTERS,
				Messages.CommonEditorPreferencePage_InsertProposal, parent));
	}

	return parent;
}
 
Example 25
Source Project: e4Preferences   Source File: SamplePage.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createFieldEditors()
{
	
	addField(new ComboFieldEditor("prefCombo", "A combo field", new String[][]{{"display1", "value1"},{"display2", "value2"}}, getFieldEditorParent()));

	addField(new ColorFieldEditor("prefColor", "Color for table items : ", getFieldEditorParent()));
	addField(new BooleanFieldEditor("prefBoolean", "A boolean : ", getFieldEditorParent()));
	addField(new StringFieldEditor("prefString", "A string : ", getFieldEditorParent()));
}
 
Example 26
@Override
protected void createFieldEditors()
{
	
	addField(new ComboFieldEditor("prefCombo", "A combo field", new String[][]{{"display1", "value1"},{"display2", "value2"}}, getFieldEditorParent()));

	addField(new ColorFieldEditor("prefColor", "Color for table items : ", getFieldEditorParent()));
	addField(new BooleanFieldEditor("prefBoolean", "A boolean : ", getFieldEditorParent()));
	addField(new StringFieldEditor("prefString", "A string : ", getFieldEditorParent()));
}
 
Example 27
Source Project: Pydev   Source File: FileTypesPreferencesPage.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
    final Composite p = getFieldEditorParent();

    addField(new LabelFieldEditorWith2Cols("Label_Info_File_Preferences1", WrapAndCaseUtils.wrap(
            "These setting are used to know which files should be considered valid internally, and are "
                    + "not used in the file association of those files to the pydev editor.\n\n",
            80), p) {
        @Override
        public String getLabelTextCol1() {
            return "Note:\n\n";
        }
    });

    addField(new LabelFieldEditorWith2Cols(
            "Label_Info_File_Preferences2",
            WrapAndCaseUtils
                    .wrap("After changing those settings, a manual reconfiguration of the interpreter and a manual rebuild "
                            + "of the projects may be needed to update the inner caches that may be affected by those changes.\n\n",
                            80),
            p) {
        @Override
        public String getLabelTextCol1() {
            return "Important:\n\n";
        }
    });

    addField(new StringFieldEditor(FileTypesPreferences.VALID_SOURCE_FILES, "Valid source files (comma-separated):",
            StringFieldEditor.UNLIMITED, p));
    addField(
            new StringFieldEditor(FileTypesPreferences.FIRST_CHOICE_PYTHON_SOURCE_FILE, "Default python extension:",
                    StringFieldEditor.UNLIMITED, p));
}
 
Example 28
@Override
protected void createFieldEditors() {
    super.createFieldEditors();
    addField(new StringFieldEditor(IInterpreterManager.IRONPYTHON_INTERNAL_SHELL_VM_ARGS,
            "Vm arguments for IronPython", getFieldEditorParent()) {
        @Override
        protected void adjustForNumColumns(int numColumns) {
            GridData gd = (GridData) getTextControl().getLayoutData();
            gd.horizontalSpan = numColumns; //We want it in a separate line!
            gd.grabExcessHorizontalSpace = true;

        }
    });
}
 
Example 29
Source Project: Pydev   Source File: CommentBlocksPreferences.java    License: 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));
}
 
Example 30
@Override
protected void createFieldEditors() {
  chatGroup = new Group(getFieldEditorParent(), SWT.NONE);
  chatGroup.setText("Settings for Chat");
  chatGroup.setLayout(new GridLayout(2, false));

  GridData chatGridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
  chatGridData.horizontalSpan = 2;

  chatGroup.setLayoutData(chatGridData);

  useIRCStyleChatLayout =
      new BooleanFieldEditor(
          EclipsePreferenceConstants.USE_IRC_STYLE_CHAT_LAYOUT,
          "Use IRC style for chats",
          chatGroup);

  Composite chatServerGroup = new Composite(chatGroup, SWT.NONE);
  chatServerGroup.setLayout(new GridLayout(2, false));
  chatServerGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  chatserver =
      new StringFieldEditor(
          EclipsePreferenceConstants.CUSTOM_MUC_SERVICE, "Custom chatserver: ", chatServerGroup);

  useCustomChatServer =
      new BooleanFieldEditor(
          EclipsePreferenceConstants.FORCE_CUSTOM_MUC_SERVICE,
          "Always use custom chatserver",
          chatGroup);

  skypeName =
      new StringFieldEditor(
          PreferenceConstants.SKYPE_USERNAME, "Skype name:", getFieldEditorParent());

  addField(useIRCStyleChatLayout);
  addField(chatserver);
  addField(useCustomChatServer);
  addField(skypeName);
}