List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor
public StringFieldEditor(String name, String labelText, Composite parent)
From source file:org.csstudio.utility.chat.PreferencePage.java
License:Open Source License
/** {@inheritDoc} */ @Override/*from www . j a v a 2s. com*/ protected void createFieldEditors() { final Composite parent = getFieldEditorParent(); addField(new StringFieldEditor(Preferences.CHAT_SERVER, Messages.PreferencesServer, parent)); addField(new StringFieldEditor(Preferences.GROUP, Messages.PreferencesGroup, parent)); }
From source file:org.csstudio.utility.ldap.ui.preference.PreferencePage.java
License:Open Source License
/** * 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.//from w ww . j a v a 2 s .c o m */ @Override public void createFieldEditors() { addField(new StringFieldEditor(LdapPreference.URL.getKeyAsString(), Messages.getString("PreferencePage.URL"), getFieldEditorParent())); //$NON-NLS-1$ addField(new StringFieldEditor(LdapPreference.USER_DN.getKeyAsString(), Messages.getString("PreferencePage.DN"), getFieldEditorParent())); //$NON-NLS-1$ final StringFieldEditor sfeP = new StringFieldEditor(LdapPreference.USER_PASSWORD.getKeyAsString(), Messages.getString("PreferencePage.PASS"), getFieldEditorParent()); //$NON-NLS-1$ sfeP.getTextControl(getFieldEditorParent()).setEchoChar('*'); addField(sfeP); addField(new StringFieldEditor(LdapPreference.SECURITY_PROTOCOL.getKeyAsString(), Messages.getString("PreferencePage.SECURITY_PROTOCOL"), getFieldEditorParent())); //$NON-NLS-1$ addField(new StringFieldEditor(LdapPreference.SECURITY_AUTH.getKeyAsString(), Messages.getString("PreferencePage.SECURITY_AUTHENTICATION"), getFieldEditorParent())); //$NON-NLS-1$ }
From source file:org.csstudio.utility.nameSpaceSearch.preference.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new StringFieldEditor(RECORD.getNodeTypeName(), Messages.getString(Messages.PreferencePage_RECORD_ATTRIBUTE), getFieldEditorParent())); final StringFieldEditor searchRoot = new StringFieldEditor( UNIT.getNodeTypeName() + "=" + UNIT.getUnitTypeValue(), Messages.getString(Messages.PreferencePage_SEARCH_ROOT), getFieldEditorParent()); searchRoot.getTextControl(getFieldEditorParent()) .setToolTipText(Messages.getString(Messages.PreferencePage_SEARCH_ROOT_TOOL_TIP)); addField(searchRoot);/*from w w w . j a v a 2s . co m*/ }
From source file:org.csstudio.utility.screenshot.preference.ScreenshotPreferencePage.java
License:Open Source License
@Override public void createFieldEditors() { Composite parent = getFieldEditorParent(); parent.setLayout(new GridLayout(2, true)); parent.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); // Composite mailServer = createGroup(parent, "ScreenshotPreferencePage.GROUP_MAIL_SERVER"); addField(new StringFieldEditor(ScreenshotPreferenceConstants.MAIL_SERVER, ScreenshotMessages.getString("ScreenshotPreferencePage.MAIL_SERVER_NAME"), parent)); // Composite mailAddress = createGroup(parent, "ScreenshotPreferencePage.GROUP_MAIL_ADDRESS"); addField(new StringFieldEditor(ScreenshotPreferenceConstants.MAIL_ADDRESS_SENDER, ScreenshotMessages.getString("ScreenshotPreferencePage.MAIL_ADDRESS_SENDER"), parent)); // Composite copyMail = createGroup(parent, "ScreenshotPreferencePage.GROUP_COPY_MAIL"); addField(new BooleanFieldEditor(ScreenshotPreferenceConstants.COPY_TO_SENDER, ScreenshotMessages.getString("ScreenshotPreferencePage.COPY_TO_SENDER"), parent)); }
From source file:org.csstudio.utility.tine.ui.perference.PreferencePage.java
License:Open Source License
/** * 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.//from w w w . j a v a 2s.co m */ @Override public void createFieldEditors() { final StringFieldEditor pathSFE = new StringFieldEditor(PreferenceConstants.TINE_CONFIG_PATH, Messages.getString("Tine.PreferencePage.Path"), getFieldEditorParent()); pathSFE.getTextControl(getFieldEditorParent()) .setToolTipText(Messages.getString("Tine.PreferencePage.Path.ToolTip")); addField(pathSFE); //$NON-NLS-1$ }
From source file:org.dafoe.application.preferences.DataBaseSettingsPreferencePage.java
License:Open Source License
/** * 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.//from www . j a v a 2 s . c o m */ public void createFieldEditors() { fieldEditorDbName = new StringFieldEditor("", "DataBaseName:", getFieldEditorParent()); fieldEditorUserName = new StringFieldEditor("", "UserName:", getFieldEditorParent()); fieldEditorPassword = new StringFieldEditor("", "Password:", getFieldEditorParent()); /*addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, "&Directory preference:", getFieldEditorParent())); addField( new BooleanFieldEditor( PreferenceConstants.P_BOOLEAN, "&An example of a boolean preference", getFieldEditorParent())); addField(new RadioGroupFieldEditor( PreferenceConstants.P_CHOICE, "An example of a multiple-choice preference", 1, new String[][] { { "&Choice 1", "choice1" }, { "C&hoice 2", "choice2" } }, getFieldEditorParent())); addField( new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:", getFieldEditorParent())); */ addField(fieldEditorDbName); addField(fieldEditorUserName); addField(fieldEditorPassword); /* Composite generalComposite = new Composite(getFieldEditorParent(), SWT.NONE); GridLayout generalLayout = new GridLayout(); generalLayout.numColumns = 2; generalComposite.setLayout(generalLayout); GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); gridData.horizontalIndent = 40; Label label = new Label(generalComposite, SWT.NULL); label.setText("Password :"); //$NON-NLS-1$ label.setLayoutData(gridData); Text txtPassWord= new Text(generalComposite, SWT.BORDER); gridData = new GridData(GridData.FILL_HORIZONTAL); txtPassWord.setLayoutData(gridData); txtPassWord.setEditable(true); txtPassWord.setEnabled(true); txtPassWord.setEchoChar('*'); txtPassWord.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); */ }
From source file:org.dawb.common.ui.preferences.TangoPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { mockMode = new BooleanFieldEditor(CommonUIPreferenceConstants.MOCK_SESSION, "Mock Connection", getFieldEditorParent());/*from www . ja va 2s . c om*/ addField(mockMode); mockMode.setPreferenceName(CommonUIPreferenceConstants.MOCK_SESSION); serverEd = new StringFieldEditor(CommonUIPreferenceConstants.SERVER_NAME, "Database Name", getFieldEditorParent()); serverEd.setEmptyStringAllowed(false); addField(serverEd); portEd = new IntegerFieldEditor(CommonUIPreferenceConstants.SERVER_PORT, "Database Port", getFieldEditorParent()); portEd.setEmptyStringAllowed(false); addField(portEd); beamlineName = new StringFieldEditor(CommonUIPreferenceConstants.BEAMLINE_NAME, "Beamline Name", getFieldEditorParent()); beamlineName.setEmptyStringAllowed(false); addField(beamlineName); specSessionName = new StringFieldEditor(CommonUIPreferenceConstants.SPEC_NAME, "Spec Session Name", getFieldEditorParent()); specSessionName.setEmptyStringAllowed(false); addField(specSessionName); setValid(true); }
From source file:org.dawb.common.ui.views.monitor.MonitorPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { formatFieldEditor = new StringFieldEditor(CommonUIPreferenceConstants.DASHBOARD_FORMAT, "Dashboard number format", getFieldEditorParent()); addField(formatFieldEditor);//from w w w . ja va 2s .co m final BooleanFieldEditor showBounds = new BooleanFieldEditor(CommonUIPreferenceConstants.DASHBOARD_BOUNDS, "Show bounds", getFieldEditorParent()); addField(showBounds); final BooleanFieldEditor showDes = new BooleanFieldEditor(CommonUIPreferenceConstants.DASHBOARD_DESCRIPTION, "Show description", getFieldEditorParent()); addField(showDes); }
From source file:org.dawb.tango.extensions.editors.preferences.CalibrationPreferences.java
License:Open Source License
@Override protected void createFieldEditors() { editors = new ArrayList<StringFieldEditor>(7); this.use = new BooleanFieldEditor(CalibrationConstants.USE, "Use calibration", getFieldEditorParent()); addField(use);//from w w w . j a v a 2 s .c o m StringFieldEditor expr = new StringFieldEditor(CalibrationConstants.EXPR, "Calibration Expression", getFieldEditorParent()); expr.getLabelControl(getFieldEditorParent()).setToolTipText( "Expression to use in calibration, the variable p is used for pixel value and p0 for the first pixel."); addField(expr); editors.add(expr); expr.getTextControl(getFieldEditorParent()) .setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE)); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); addField(new LabelFieldEditor("Coefficients:", getFieldEditorParent())); StringFieldEditor a = new StringFieldEditor(CalibrationConstants.A, "a", getFieldEditorParent()); a.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient a used in the calibration expression."); addField(a); editors.add(a); StringFieldEditor b = new StringFieldEditor(CalibrationConstants.B, "b", getFieldEditorParent()); b.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient b used in the calibration expression."); addField(b); editors.add(b); StringFieldEditor c = new StringFieldEditor(CalibrationConstants.C, "c", getFieldEditorParent()); c.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient c used in the calibration expression."); addField(c); editors.add(c); StringFieldEditor d = new StringFieldEditor(CalibrationConstants.D, "d", getFieldEditorParent()); d.getLabelControl(getFieldEditorParent()) .setToolTipText("Coefficient d used in the calibration expression."); addField(d); editors.add(d); updateEnabled(Activator.getDefault().getPreferenceStore().getBoolean(CalibrationConstants.USE)); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL); addField(new LabelFieldEditor("", getFieldEditorParent())); addField(new StringFieldEditor(CalibrationConstants.LABEL, "X-axis label", getFieldEditorParent())); }
From source file:org.dawb.tango.extensions.editors.preferences.SharedPreferences.java
License:Open Source License
@Override protected void createFieldEditors() { {//from www . j a v a 2 s. co m final IntegerFieldEditor monFreq = new IntegerFieldEditor(SharedConstants.MON_FREQ, "Monitor Frequency in ms", getFieldEditorParent()); monFreq.setValidRange(500, 10000); monFreq.getLabelControl(getFieldEditorParent()).setToolTipText( "The frequency to go to the shared memory and attempt to read it. If the memory has not changed since the last read, nothing will happen."); addField(monFreq); } { final IntegerFieldEditor histSize = new IntegerFieldEditor(SharedConstants.HISTORY_SIZE, "History size", getFieldEditorParent()); histSize.setValidRange(5, 10000); histSize.getLabelControl(getFieldEditorParent()) .setToolTipText("The history size when the system is in history mode."); addField(histSize); } { final IntegerFieldEditor chunkIndex = new IntegerFieldEditor(SharedConstants.CHUNK_INDEX, "Chunk Index", getFieldEditorParent()); chunkIndex.setValidRange(0, 999); chunkIndex.getLabelControl(getFieldEditorParent()).setToolTipText( "The chunk index when reading chunks of spectra to add to the history. This is a 0 based index, if set to more than the chunk size, the chunk size - 1 will be used."); addField(chunkIndex); } { addField(new LabelFieldEditor(" ", getFieldEditorParent())); final LabelFieldEditor label = new LabelFieldEditor("Advanced Options", getFieldEditorParent()); label.getLabelControl(getFieldEditorParent()).setToolTipText( "Advanced options below may also need the spec shared memory variable to be changed or the macro altered or tango reconfigured, use with caution."); addField(label); } { final IntegerFieldEditor chunkSize = new IntegerFieldEditor(SharedConstants.CHUNK_SIZE, "Chunk Size", getFieldEditorParent()); chunkSize.setValidRange(1, 1000); chunkSize.getLabelControl(getFieldEditorParent()) .setToolTipText("The size of the rows in the shared memory to read when updating."); addField(chunkSize); } { final StringFieldEditor tangoAddress = new StringFieldEditor(SharedConstants.SPEC_SHARED, "Spec Tango Uri", getFieldEditorParent()); tangoAddress.getLabelControl(getFieldEditorParent()) .setToolTipText("Change this URI only if you are able to match it with the tango server."); addField(tangoAddress); } }