本文整理匯總了Java中org.eclipse.jface.preference.StringFieldEditor類的典型用法代碼示例。如果您正苦於以下問題:Java StringFieldEditor類的具體用法?Java StringFieldEditor怎麽用?Java StringFieldEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StringFieldEditor類屬於org.eclipse.jface.preference包,在下文中一共展示了StringFieldEditor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(PREF.PGDUMP_SWITCH,
Messages.generalPrefPage_pg_dump_switch, getFieldEditorParent()));
addField(new FileFieldEditor(PREF.PGDUMP_EXE_PATH,
Messages.generalPrefPage_pg_dump_executable, getFieldEditorParent()){
@Override
protected boolean checkState() {
return true;
}
});
addField(new StringFieldEditor(PREF.PGDUMP_CUSTOM_PARAMS,
Messages.generalPrefPage_pg_dump_custom_parameters, getFieldEditorParent()));
addField(new BooleanFieldEditor(PREF.FORCE_SHOW_CONSOLE,
Messages.generalPrefPage_show_console_when_program_write_to_console, getFieldEditorParent()));
addField(new BooleanFieldEditor(PREF.NO_PRIVILEGES,
Messages.dbUpdatePrefPage_ignore_privileges,
getFieldEditorParent()));
}
示例2: checkState
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* Check if all fields are valid
*
*/
private void checkState() {
if(editorList != null){
int size = editorList.size();
for(int i=0; i<size; i++){
FieldEditor fieldEditor = editorList.get(i);
if(StringUtils.isNotBlank(((StringFieldEditor)fieldEditor).getErrorMessage())){
setErrorMessage(((StringFieldEditor)fieldEditor).getErrorMessage());
setValid(false);
break;
}else{
setValid(true);
}
}
}
}
示例3: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* {@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);
}
示例4: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* {@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);
}
示例5: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
addField(new DirectoryFieldEditor(PreferenceConstants.TIMER_FILE_PATH,
"Timer output directory:", getFieldEditorParent()));
addField(new StringFieldEditor(PreferenceConstants.TIMER_FILE, "Filename:", getFieldEditorParent()));
addField(new SpacerFieldEditor(getFieldEditorParent()));
addField(new LabelFieldEditor("Default Timer Settings", getFieldEditorParent()));
StringFieldEditor hoursField = new StringFieldEditor(PreferenceConstants.TIMER_HOUR_DEFAULT, "Hour(s):", getFieldEditorParent());
hoursField.setTextLimit(2);
addField(hoursField);
StringFieldEditor minsField = new StringFieldEditor(PreferenceConstants.TIMER_MINUTES_DEFAULT, "Minutes:", getFieldEditorParent());
minsField.setTextLimit(2);
addField(minsField);
StringFieldEditor secField = new StringFieldEditor(PreferenceConstants.TIMER_SECONDS_DEFAULT, "Seconds:", getFieldEditorParent());
secField.setTextLimit(2);
addField(secField);
}
示例6: createPollChangesIntervalGroup
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
private void createPollChangesIntervalGroup(Composite composite) {
Composite groupComposite = new Composite(composite, SWT.LEFT);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
groupComposite.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = true;
groupComposite.setLayoutData(gd);
pollChangesInterval = new IntegerFieldEditor(POLL_CHANGES_INTERVAL_PREF, "Poll changes interval (seconds)",
groupComposite);
pollChangesInterval.setTextLimit(Integer.toString(MAX_POLL_CHANGES_INTERVAL).length());
pollChangesInterval.setErrorMessage("The workspace save interval should be between 30 and 9999.");
pollChangesInterval.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
pollChangesInterval.setValidRange(MIN_POLL_CHANGES_INTERVAL, MAX_POLL_CHANGES_INTERVAL);
pollChangesInterval.setPropertyChangeListener(event -> {
if (event.getProperty().equals(FieldEditor.IS_VALID)) {
setValid(pollChangesInterval.isValid());
}
});
addField(pollChangesInterval);
}
示例7: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
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);
}
示例8: updateFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
@Override
protected void updateFieldEditors() {
super.updateFieldEditors();
// update editor states if needed
if (this.isPageEnabled()) {
Composite parent = this.getFieldEditorParent();
BooleanFieldEditor bundle = this.getField(Preferences.BUNDLE(DEFAULT_PROFILE_NAME));
StringFieldEditor bundlesDirectory = this.getField(Preferences.BUNDLES_DIRECTORY(DEFAULT_PROFILE_NAME));
ComboFieldEditor module = this.getField(Preferences.MODULE_KIND(DEFAULT_PROFILE_NAME));
if (bundle.getBooleanValue()) {
getPreferenceStore().setValue(Preferences.MODULE_KIND(currentProfile), "none");
module.load();
}
module.setEnabled(!bundle.getBooleanValue(), parent);
bundlesDirectory.setEnabled(bundle.getBooleanValue(), parent);
BooleanFieldEditor declaration = this.getField(Preferences.DECLARATION(DEFAULT_PROFILE_NAME));
StringFieldEditor declarationDirectory = this
.getField(Preferences.DECLARATION_DIRECTORY(DEFAULT_PROFILE_NAME));
declarationDirectory.setEnabled(declaration.getBooleanValue(), parent);
}
}
示例9: createWithValidation
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
private StringFieldEditor createWithValidation() {
final Validation validation = this.optionalValidation.get();
final StringFieldEditor stringFieldEditor = new StringFieldEditor(name, labelText, parent) {
@Override
protected boolean checkState() {
if (!validation.getCondition().test(getStringValue())) {
setErrorMessage(validation.getMessage());
showErrorMessage();
return false;
}
return super.checkState();
}
};
return stringFieldEditor;
}
示例10: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
LabelFieldEditor userHomeDir = new LabelFieldEditor(
"NONE",
WordUtils
.wrap(local.getString("speechAns"), 70),
getFieldEditorParent());
addField(userHomeDir);
final StringFieldEditor speechProcessName = new StringFieldEditor(
PreferenceKeys.SPEECH_PROCESS_NAME, local.getString("speechPrcN"),
getFieldEditorParent());
addField(speechProcessName);
labelButtonFieldEditor = new LabelButtonFieldEditor(
"NONE",
local.getString("testSet"),
getFieldEditorParent(), local.getString("test"), new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SoundService.getInstance().textToSpeech(
local.getString("speechStpCrct"));
}
});
addField(labelButtonFieldEditor);
}
示例11: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
LabelFieldEditor userHomeDir = new LabelFieldEditor(
"NONE",
WordUtils
.wrap(local.getString("soundP1"),
70), getFieldEditorParent());
addField(userHomeDir);
final StringFieldEditor soundProcessName = new StringFieldEditor(
PreferenceKeys.SOUND_PROCESS_NAME, local.getString("soundP2"),
getFieldEditorParent());
addField(soundProcessName);
labelButtonFieldEditor = new LabelButtonFieldEditor(
"NONE",
local.getString("soundP3"),
getFieldEditorParent(), local.getString("test"), new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SoundService.getInstance().initSoundPlayer();
SoundService.getInstance().playSound("win");
}
});
addField(labelButtonFieldEditor);
}
示例12: createTabMetadata
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
private void createTabMetadata(CTabFolder tabFolder) {
CTabItem ptab = new CTabItem(tabFolder, SWT.NONE);
ptab.setText(Messages.PDFExporterPreferencePage_38);
Composite sc = new Composite(tabFolder, SWT.NONE);
ptab.setControl(sc);
addField(new StringFieldEditor(PdfExporterConfiguration.PROPERTY_METADATA_TITLE,
Messages.PDFExporterPreferencePage_39, sc));
addField(new StringFieldEditor(PdfExporterConfiguration.PROPERTY_METADATA_AUTHOR,
Messages.PDFExporterPreferencePage_40, sc));
addField(new StringFieldEditor(PdfExporterConfiguration.PROPERTY_METADATA_SUBJECT,
Messages.PDFExporterPreferencePage_41, sc));
addField(new StringFieldEditor(PdfExporterConfiguration.PROPERTY_METADATA_KEYWORDS,
Messages.PDFExporterPreferencePage_42, sc));
addField(new StringFieldEditor(PdfExporterConfiguration.PROPERTY_METADATA_CREATOR,
Messages.PDFExporterPreferencePage_43, sc));
sc.setLayout(new GridLayout(3, false));
}
示例13: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* 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.
*/
public void createFieldEditors() {
Composite parent = getFieldEditorParent();
Group grpPath = createGroup(getFieldEditorParent(), "General path definition");
addField(new DirectoryFieldEditor(PrefKeys.Path.SDK, "&SDK path:", grpPath));
addField(new DirectoryFieldEditor(PrefKeys.Path.COMPILER, "&Compiler path:", grpPath));
addField(new DirectoryFieldEditor(PrefKeys.Path.TOOLS, "&Tools path:", grpPath));
Group grpSerial = createGroup(parent, "General serial port settings");
addField(new StringFieldEditor(PrefKeys.Serial.PORT, "Default port:", grpSerial));
RadioGroupFieldEditor rg1 = new RadioGroupFieldEditor(PrefKeys.Serial.PARITY, "Parity", 6,
PrefKeys.Serial.VPARITY, grpSerial);
addField(rg1);
addField(new RadioGroupFieldEditor(PrefKeys.Serial.DATABITS, "Data bits", 6, PrefKeys.Serial.VDATABITS,
grpSerial));
addField(new RadioGroupFieldEditor(PrefKeys.Serial.STOPBITS, "Stop bits", 2, PrefKeys.Serial.VSTOPBITS,
grpSerial));
}
示例14: createUI_94_Field_RawDataPath
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* field: path to save raw tour data
*/
private void createUI_94_Field_RawDataPath(final Composite parent) {
/*
* editor: raw data path
*/
_rawDataPathEditor = new DirectoryFieldEditor(
ITourbookPreferences.DUMMY_FIELD,
Messages.Pref_People_Label_DefaultDataTransferFilePath,
parent);
_rawDataPathEditor.setEmptyStringAllowed(true);
_rawDataPathEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
final Label lblPath = _rawDataPathEditor.getLabelControl(parent);
lblPath.setToolTipText(Messages.Pref_People_Label_DefaultDataTransferFilePath_Tooltip);
_txtRawDataPath = _rawDataPathEditor.getTextControl(parent);
_txtRawDataPath.addModifyListener(_defaultModifyListener);
}
示例15: createFieldEditors
import org.eclipse.jface.preference.StringFieldEditor; //導入依賴的package包/類
/**
* 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() {
Composite parent = getFieldEditorParent();
String valueString = EnsembleProperties.getProperty(P_TEMPLATE_PLAN_URI_EDITABLE);
if (valueString == null || Boolean.FALSE != Boolean.parseBoolean(valueString)) {
addField(new StringFieldEditor(P_TEMPLATE_PLAN_URI, "Template plan URI", parent));
}
addField(new BooleanFieldEditor(P_CHECK_CUSTODIAN, "Check custodian when saving", parent));
addField(new BooleanFieldEditor(P_CROSS_EDITOR_SELECTIONS, "Share selections across editors", parent));
Label reorderByTimeLabel=new Label(parent, SWT.None);
reorderByTimeLabel.setText("Reorder by time usually uses the start time of an activity \nor activity group unless the duration in hours is longer than large plan item duration.");
GridData reorderByTimeLayout = new GridData();
reorderByTimeLayout.horizontalSpan=2;
reorderByTimeLabel.setLayoutData(reorderByTimeLayout);
IntegerFieldEditor reorderByTimeField=new IntegerFieldEditor(P_WATERFALL_LARGE_ELEMENT_DURATION_IN_HOURS, "", parent);
reorderByTimeField.setLabelText("Large Plan Item Duration");
reorderByTimeField.setEmptyStringAllowed(false);
reorderByTimeField.setValidRange(0, 10000);
addField(reorderByTimeField);
}