本文整理匯總了Java中org.eclipse.jface.preference.IntegerFieldEditor.setPreferenceStore方法的典型用法代碼示例。如果您正苦於以下問題:Java IntegerFieldEditor.setPreferenceStore方法的具體用法?Java IntegerFieldEditor.setPreferenceStore怎麽用?Java IntegerFieldEditor.setPreferenceStore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.IntegerFieldEditor
的用法示例。
在下文中一共展示了IntegerFieldEditor.setPreferenceStore方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBacklogField
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
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);
}
示例2: createReadBufferField
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
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);
}
示例3: createReadWaitField
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
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);
}
示例4: createIntegerFieldEditor
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
private IntegerFieldEditor createIntegerFieldEditor(String propertyName, String label, Composite parent) {
IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor(propertyName, label, parent, 2);
integerFieldEditor.setPreferenceStore(PREFERENCE_STORE);
integerFieldEditor.load();
integerFieldEditor.setValidRange(0, 23);
integerFieldEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
return integerFieldEditor;
}
示例5: initBeaconInterval
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
private IntegerFieldEditor initBeaconInterval(Composite parent) {
IntegerFieldEditor editor =
new IntegerFieldEditor(BEACON_PREFERENCE, Messages.PreferencesNetwork_BEACON_INTERVAL, parent); //$NON-NLS-1$
editor.setValidRange(1, Integer.MAX_VALUE);
editor.setPreferenceStore(getPreferenceStore());
getPreferenceStore().setDefault(BEACON_PREFERENCE, UDPMulticastBeacon.DEFAULT_INTERVAL);
return editor;
}
示例6: createFieldEditors
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
/**
* Creates the preference page fields.
*/
protected void createFieldEditors() {
Composite rootControl = getFieldEditorParent();
// Create the controls.
BooleanFieldEditor escapeValueStrings = new BooleanFieldEditor(IPreferences.HANDLE_ESCAPED_VALUES,
"Handle escapes for \" and \\ in value strings", rootControl);
escapeValueStrings.setPreferenceStore(getPreferenceStore());
addField(escapeValueStrings);
IntegerFieldEditor historySize = new IntegerFieldEditor(IPreferences.BUILD_HISTORY_SIZE, "Build history size:",
rootControl);
historySize.setPreferenceStore(getPreferenceStore());
historySize.setValidRange(1, 100);
addField(historySize);
RadioGroupFieldEditor autoSaveField = new RadioGroupFieldEditor(IPreferences.AUTO_SAVE,
"Save all modified files before building", 1,
new String[][] { { IPreferences.AUTO_SAVE_NEVER, IPreferences.AUTO_SAVE_NEVER },
{ IPreferences.AUTO_SAVE_ALWAYS, IPreferences.AUTO_SAVE_ALWAYS },
{ IPreferences.AUTO_SAVE_ASK, IPreferences.AUTO_SAVE_ASK }, },
rootControl, true);
autoSaveField.setPreferenceStore(getPreferenceStore());
addField(autoSaveField);
int lineSepLength = LineSeparator.values().length;
String[][] lineSepNames = new String[lineSepLength][2];
for(int i=0;i<lineSepLength;i++) {
lineSepNames[i][0] = LineSeparator.values()[i].getName();
lineSepNames[i][1] = LineSeparator.values()[i].name();
}
RadioGroupFieldEditor lineSeparatorField = new RadioGroupFieldEditor(IPreferences.LINE_SEPARATOR,
"Line separator", 1, lineSepNames, rootControl, true);
lineSeparatorField.setPreferenceStore(getPreferenceStore());
addField(lineSeparatorField);
int listSepModeLength = ListSeparateMode.values().length;
String[][] listSepModeNames = new String[listSepModeLength][2];
for(int i=0;i<listSepModeLength;i++) {
listSepModeNames[i][0] = ListSeparateMode.values()[i].getName();
listSepModeNames[i][1] = ListSeparateMode.values()[i].name();
}
RadioGroupFieldEditor listSepModeField = new RadioGroupFieldEditor(IPreferences.LIST_SEPARATE_MODE,
"List separate mode", 1, listSepModeNames, rootControl, true);
listSepModeField.setPreferenceStore(getPreferenceStore());
addField(listSepModeField);
int tagFormatLength = TagFormat.values().length;
String[][] tagFormatNames = new String[tagFormatLength][2];
for(int i=0;i<tagFormatLength;i++) {
tagFormatNames[i][0] = TagFormat.values()[i].getName();
tagFormatNames[i][1] = TagFormat.values()[i].name();
}
RadioGroupFieldEditor tagFormatField = new RadioGroupFieldEditor(IPreferences.TAG_FORMAT,
"TAG format", 1, tagFormatNames, rootControl, true);
tagFormatField.setPreferenceStore(getPreferenceStore());
addField(tagFormatField);
}
示例7: createUI_10_Notes
import org.eclipse.jface.preference.IntegerFieldEditor; //導入方法依賴的package包/類
private void createUI_10_Notes(final Composite parent) {
_groupNotesImport = new Group(parent, SWT.NONE);
_groupNotesImport.setText(Messages.prefPage_tcx_group_importNotes);
GridDataFactory.fillDefaults().grab(true, false).applyTo(_groupNotesImport);
{
// label: description
final Label label = new Label(_groupNotesImport, SWT.NONE);
GridDataFactory.fillDefaults().span(2, 1).applyTo(label);
label.setText(Messages.prefPage_tcx_label_importNotes);
// check: import into title field
_editBool_ImportIntoTitle = new BooleanFieldEditor2(
IPreferences.IS_IMPORT_INTO_TITLE_FIELD,
Messages.prefPage_tcx_check_importIntoTitleField,
_groupNotesImport);
_editBool_ImportIntoTitle.fillIntoGrid(_groupNotesImport, 2);
_editBool_ImportIntoTitle.setPreferenceStore(_prefStore);
_editBool_ImportIntoTitle.load();
addField(_editBool_ImportIntoTitle);
/*
* setPropertyChangeListener() is occupied by the pref page when the field is added to
* the page with addField
*/
final Button chkImportIntoTitle = _editBool_ImportIntoTitle.getChangeControl(_groupNotesImport);
chkImportIntoTitle.addSelectionListener(_defaultSelectionListener);
// container: title
final Composite containerTitle = new Composite(_groupNotesImport, SWT.NONE);
GridDataFactory.fillDefaults().span(2, 1).grab(true, false).indent(15, 0).applyTo(containerTitle);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerTitle);
{
// radio: import all
_rdoImportAll = new Button(containerTitle, SWT.RADIO);
GridDataFactory.fillDefaults().span(2, 1).applyTo(_rdoImportAll);
_rdoImportAll.setText(Messages.prefPage_tcx_radio_importIntoTitleAll);
_rdoImportAll.addSelectionListener(_defaultSelectionListener);
// radio: import truncated
_rdoImportTruncated = new Button(containerTitle, SWT.RADIO);
_rdoImportTruncated.setText(Messages.prefPage_tcx_radio_importIntoTitleTruncated);
_rdoImportTruncated.addSelectionListener(_defaultSelectionListener);
// editor: number of characters
_containerCharacter = new Composite(containerTitle, SWT.NONE);
{
_editInt_TruncatedNotes = new IntegerFieldEditor(
IPreferences.NUMBER_OF_TITLE_CHARACTERS,
UI.EMPTY_STRING,
_containerCharacter);
_editInt_TruncatedNotes.setValidRange(10, 1000);
_editInt_TruncatedNotes.fillIntoGrid(_containerCharacter, 2);
_editInt_TruncatedNotes.setPreferenceStore(_prefStore);
_editInt_TruncatedNotes.load();
UI.setFieldWidth(_containerCharacter, _editInt_TruncatedNotes, UI.DEFAULT_FIELD_WIDTH);
addField(_editInt_TruncatedNotes);
}
}
// check: import into description field
_editBool_ImportIntoDescription = new BooleanFieldEditor(
IPreferences.IS_IMPORT_INTO_DESCRIPTION_FIELD,
Messages.prefPage_tcx_check_importIntoDescriptionField,
_groupNotesImport);
_editBool_ImportIntoDescription.fillIntoGrid(_groupNotesImport, 2);
_editBool_ImportIntoDescription.setPreferenceStore(_prefStore);
_editBool_ImportIntoDescription.load();
addField(_editBool_ImportIntoDescription);
}
// add layout to the group
final GridLayout regionalLayout = (GridLayout) _groupNotesImport.getLayout();
regionalLayout.marginWidth = 5;
regionalLayout.marginHeight = 5;
}