List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor
public StringFieldEditor(String name, String labelText, Composite parent)
From source file:org.apache.forrest.repository.daisy.preferences.DaisyPreferences.java
License:Apache 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 av a 2 s .c o m public void createFieldEditors() { addField(new StringFieldEditor(REPOSITORY_URL, "&Repository Location: http://", getFieldEditorParent())); addField(new StringFieldEditor(REPOSITORY_PORT, "&Repository Port:", getFieldEditorParent())); addField(new StringFieldEditor(REPOSITORY_USERNAME, "&Repository Username:", getFieldEditorParent())); addField(new StringFieldEditor(REPOSITORY_PASSWORD, "&Repository Password:", getFieldEditorParent())); }
From source file:org.apache.opennlp.caseditor.sentdetect.SentenceDetectorPreferencePage.java
License:Apache License
@Override protected void createFieldEditors() { StringFieldEditor modelPath = new StringFieldEditor(OpenNLPPreferenceConstants.SENTENCE_DETECTOR_MODEL_PATH, "Model Path", getFieldEditorParent()); addField(modelPath);/*from w w w . j ava 2s .com*/ TypeListFieldEditor paragraphType = new TypeListFieldEditor(OpenNLPPreferenceConstants.PARAGRAPH_TYPE, "Paragraph Types", ts, getFieldEditorParent()); addField(paragraphType); TypeListFieldEditor exclusionType = new TypeListFieldEditor(OpenNLPPreferenceConstants.SENT_EXCLUSION_TYPE, "Exclusion Types", ts, getFieldEditorParent()); addField(exclusionType); }
From source file:org.apache.opennlp.caseditor.tokenize.TokenizerPreferencePage.java
License:Apache License
@Override protected void createFieldEditors() { // TODO: Need to set a default value String[][] namesAndValues = new String[][] { new String[] { "Statistical", OpenNLPPreferenceConstants.TOKENIZER_ALGO_STATISTICAL }, new String[] { "Whitespace", OpenNLPPreferenceConstants.TOKENIZER_ALGO_WHITESPACE }, new String[] { "Simple", OpenNLPPreferenceConstants.TOKENIZER_ALGO_SIMPLE } }; ComboFieldEditor algorithmCombo = new ComboFieldEditor(OpenNLPPreferenceConstants.TOKENIZER_ALGORITHM, "Algorithm", namesAndValues, getFieldEditorParent()); addField(algorithmCombo);/* ww w. j a v a 2s .c o m*/ // Activate only if statistical is selected .. how to do that? StringFieldEditor modelPath = new StringFieldEditor(OpenNLPPreferenceConstants.TOKENIZER_MODEL_PATH, "Model Path", getFieldEditorParent()); addField(modelPath); }
From source file:org.aw20.mongoworkbench.eclipse.pref.MPrefPage.java
License:Open Source License
public void createFieldEditors() { // addField( new StringFieldEditor( BATCH_SIZE, "Default 'limit' size:", getFieldEditorParent() ) ); addField(new StringFieldEditor(PREF_MAX_FIND_RESULTS, "Maximum number of items shown in the Document List View:", getFieldEditorParent())); // addField( new BooleanFieldEditor( PREF_REMEMBER_LAST_LOCATION, "Remember last location", getFieldEditorParent() ) ); /*//from ww w. j av a 2 s.co m * addField( new StringFieldEditor( PORT, "Port:", getFieldEditorParent() ) ); * * addField( new BooleanFieldEditor( RUN_ON_STARTUP, RUN_ON_STARTUP, getFieldEditorParent() ) ); */ /* * addField( new BooleanFieldEditor( PreferenceConstants.P_BOOLEAN, "&An example of a boolean preference", getFieldEditorParent())); */ /* * addField( new DirectoryFieldEditor(PreferenceConstants.P_PATH, "&Directory 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())); */ }
From source file:org.axdt.common.preferences.fields.StringField.java
License:Open Source License
public FieldEditor createFieldEditor(Composite comp) { return new StringFieldEditor(key, desc, comp); }
From source file:org.batmass.xxd.process.supplier.heatmap.ui.preferences.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new StringFieldEditor(PreferenceSupplier.P_MY_PREF, "How is it?", getFieldEditorParent())); }
From source file:org.bbaw.pdr.ae.errorreport.MailSettingsPage.java
License:Open Source License
@Override public final void createFieldEditors() { addField(new StringFieldEditor("MAIL_SMTP_HOST_NAME", "SMTP Host Name:", getFieldEditorParent())); addField(new StringFieldEditor("MAIL_SMTP_AUTH_USER", "SMTP User Name:", getFieldEditorParent())); // addField(new StringFieldEditor("MAIL_SMTP_AUTH_PWD", // "SMTP User Password:", // getFieldEditorParent())); addField(new StringFieldEditor("MAIL_ADRESS_SENDER", "Sender Email Adress:", getFieldEditorParent())); }
From source file:org.bbaw.pdr.ae.repositoryconnection.preferences.RepositoryPage.java
License:Open Source License
@Override public final void createFieldEditors() { addField(new StringFieldEditor("REPOSITORY_NAME", NLMessages.getString("Preference_name_of_repository"), //$NON-NLS-1$ getFieldEditorParent()));//from w w w. j a v a2 s . co m Label repositoryURL = new Label(getFieldEditorParent(), SWT.NONE); repositoryURL.setText(NLMessages.getString("Preference_repository_url")); _repositoryURLText = new Text(getFieldEditorParent(), SWT.BORDER | SWT.NO_BACKGROUND | SWT.READ_ONLY | SWT.LEFT_TO_RIGHT); _repositoryURLText.setText(CommonActivator.getDefault().getPreferenceStore().getString("REPOSITORY_URL")); //$NON-NLS-1$ //$NON-NLS-2$ Label repo = new Label(getFieldEditorParent(), SWT.NONE); repo.setText(NLMessages.getString("Preference_instance_id")); _repoID = new Text(getFieldEditorParent(), SWT.BORDER | SWT.NO_BACKGROUND | SWT.READ_ONLY); _repoID.setText("" + CommonActivator.getDefault().getPreferenceStore().getInt("REPOSITORY_ID")); //$NON-NLS-1$ //$NON-NLS-2$ Label project = new Label(getFieldEditorParent(), SWT.NONE); project.setText(NLMessages.getString("Preference_project_id")); _projectID = new Text(getFieldEditorParent(), SWT.BORDER | SWT.NO_BACKGROUND | SWT.READ_ONLY); _projectID.setText("" + CommonActivator.getDefault().getPreferenceStore().getInt("PROJECT_ID")); //$NON-NLS-1$ //$NON-NLS-2$ Label lastUpdate = new Label(getFieldEditorParent(), SWT.NONE); lastUpdate.setText(NLMessages.getString("Preference_last_update")); Text lastUpdateT = new Text(getFieldEditorParent(), SWT.BORDER | SWT.NO_BACKGROUND | SWT.READ_ONLY); try { lastUpdateT.setText(AEConstants.ADMINDATE_FORMAT.format(_idService.getUpdateTimeStamp())); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } //$NON-NLS-1$ //$NON-NLS-2$ }
From source file:org.bbaw.pdr.ae.view.identifiers.internal.IdentifierPage.java
License:Open Source License
@Override public final void createFieldEditors() { addField(new BooleanFieldEditor("IDENTIFIER_PND", //$NON-NLS-1$ NLMessages.getString("Preference_pnd_name"), getFieldEditorParent())); addField(new StringFieldEditor("IDENTIFIER_PND_URL", NLMessages.getString("Preference_pnd_url"), //$NON-NLS-1$ getFieldEditorParent()));/* ww w.j av a 2 s . c om*/ addField(new BooleanFieldEditor("IDENTIFIER_LCCN", //$NON-NLS-1$ NLMessages.getString("Preference_lccn_name"), getFieldEditorParent())); addField(new StringFieldEditor("IDENTIFIER_LCCN_URL", NLMessages.getString("Preference_lccn_url"), //$NON-NLS-1$ getFieldEditorParent())); addField(new BooleanFieldEditor("IDENTIFIER_VIAF", //$NON-NLS-1$ NLMessages.getString("Preference_viaf_name"), getFieldEditorParent())); addField(new StringFieldEditor("IDENTIFIER_VIAF_URL", NLMessages.getString("Preference_viaf_url"), //$NON-NLS-1$ getFieldEditorParent())); addField(new BooleanFieldEditor("IDENTIFIER_ICCU", //$NON-NLS-1$ NLMessages.getString("Preference_iccu_name"), getFieldEditorParent())); addField(new StringFieldEditor("IDENTIFIER_ICCU_URL", NLMessages.getString("Preference_iccu_url"), //$NON-NLS-1$ getFieldEditorParent())); }
From source file:org.bc.eclipse.hadoop.debug.JavaRetryConnectTab.java
License:Open Source License
/** * Update the argument area to show the selected connector's arguments *//*from w w w. j av a 2 s .c o m*/ private void handleConnectorComboModified() { int index = fConnectorCombo.getSelectionIndex(); if ((index < 0) || (index >= fConnectors.length)) { return; } IVMConnector vm = fConnectors[index]; if (vm.equals(fConnector)) { return; // selection did not change } fConnector = vm; try { fArgumentMap = vm.getDefaultArguments(); } catch (CoreException e) { JDIDebugUIPlugin.statusDialog(LauncherMessages.JavaConnectTab_Unable_to_display_connection_arguments__2, e.getStatus()); return; } // Dispose of any current child widgets in the tab holder area Control[] children = fArgumentComposite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].dispose(); } fFieldEditorMap.clear(); PreferenceStore store = new PreferenceStore(); // create editors Iterator<String> keys = vm.getArgumentOrder().iterator(); while (keys.hasNext()) { String key = keys.next(); Connector.Argument arg = fArgumentMap.get(key); FieldEditor field = null; if (arg instanceof Connector.IntegerArgument) { store.setDefault(arg.name(), ((Connector.IntegerArgument) arg).intValue()); field = new IntegerFieldEditor(arg.name(), arg.label(), fArgumentComposite); } else if (arg instanceof Connector.SelectedArgument) { List<String> choices = ((Connector.SelectedArgument) arg).choices(); String[][] namesAndValues = new String[choices.size()][2]; Iterator<String> iter = choices.iterator(); int count = 0; while (iter.hasNext()) { String choice = iter.next(); namesAndValues[count][0] = choice; namesAndValues[count][1] = choice; count++; } store.setDefault(arg.name(), arg.value()); field = new ComboFieldEditor(arg.name(), arg.label(), namesAndValues, fArgumentComposite); } else if (arg instanceof Connector.StringArgument) { store.setDefault(arg.name(), arg.value()); field = new StringFieldEditor(arg.name(), arg.label(), fArgumentComposite); } else if (arg instanceof Connector.BooleanArgument) { store.setDefault(arg.name(), ((Connector.BooleanArgument) arg).booleanValue()); field = new BooleanFieldEditor(arg.name(), arg.label(), fArgumentComposite); } if (field != null) { field.setPreferenceStore(store); field.loadDefault(); field.setPropertyChangeListener(this); fFieldEditorMap.put(key, field); } } fArgumentComposite.getParent().getParent().layout(); fArgumentComposite.layout(true); updateLaunchConfigurationDialog(); }