本文整理匯總了Java中org.eclipse.jface.preference.ComboFieldEditor類的典型用法代碼示例。如果您正苦於以下問題:Java ComboFieldEditor類的具體用法?Java ComboFieldEditor怎麽用?Java ComboFieldEditor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ComboFieldEditor類屬於org.eclipse.jface.preference包,在下文中一共展示了ComboFieldEditor類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors ()
{
final List<String> tzs = Arrays.asList ( TimeZone.getAvailableIDs () );
Collections.sort ( tzs );
final String[][] entries = new String[tzs.size ()][2];
int i = 0;
for ( final String id : tzs )
{
entries[i][0] = id;
entries[i][1] = id;
i += 1;
}
final FieldEditor field = new ComboFieldEditor ( "timeZone", Messages.TimeZonePreferencePage_TimeZone_Label, entries, getFieldEditorParent () ); //$NON-NLS-1$
addField ( field );
}
示例2: createComboBox
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
private void createComboBox(BashEditorValidationPreferenceConstants constant, Composite parent) {
String name = constant.getId();
String labelText = constant.getLabelText();
/* @formatter:off */
String[][] entryNamesAndValues =
new String[][] {
getLabelAndValue(BashEditorValidationErrorLevel.ERROR),
getLabelAndValue(BashEditorValidationErrorLevel.WARNING),
getLabelAndValue(BashEditorValidationErrorLevel.INFO)
};
/* @formatter:on */
Composite composite = new Composite(parent, SWT.NONE);
ComboFieldEditor comboFieldEditor = new ComboFieldEditor(name, labelText, entryNamesAndValues, composite);
addField(comboFieldEditor);
}
示例3: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
addField( new ComboFieldEditor(PG_EDIT_PREF.PERSPECTIVE_CHANGING_STATUS,
Messages.generalPrefPage_perspective_changing_status, new String[][] {
{Messages.prespective_change_status_always, MessageDialogWithToggle.ALWAYS},
{Messages.prespective_change_status_never, MessageDialogWithToggle.NEVER},
{Messages.prespective_change_status_ask, MessageDialogWithToggle.PROMPT}},
getFieldEditorParent()));
addField( new ComboFieldEditor(PG_EDIT_PREF.EDITOR_UPDATE_ACTION,
Messages.ProjectEditorPrefPage_action_type, new String[][] {
{Messages.ProjectEditorPrefPage_action_update, PG_EDIT_PREF.UPDATE},
{Messages.ProjectEditorPrefPage_action_reset, PG_EDIT_PREF.RESET},
{Messages.ProjectEditorPrefPage_action_no_action, PG_EDIT_PREF.NO_ACTION}},
getFieldEditorParent()));
}
示例4: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
/** Creates the field editors. */
@Override
public void createFieldEditors() {
Composite parent = getFieldEditorParent();
Group frame = new Group(parent, SWT.NONE);
frame.setText("Stylesheets");
GridDataFactory.fillDefaults().indent(0, 6).grab(true, false).span(2, 1).applyTo(frame);
GridLayoutFactory.fillDefaults().numColumns(3).margins(6, 6).applyTo(frame);
Composite internal = new Composite(frame, SWT.NONE);
GridDataFactory.fillDefaults().indent(0, 4).grab(true, false).applyTo(internal);
GridLayoutFactory.fillDefaults().numColumns(3).applyTo(internal);
// Github Syntax support
addField(new BooleanFieldEditor(EDITOR_GITHUB_SYNTAX, "Support Github Syntax", internal));
// Multi-Markdown support
addField(new BooleanFieldEditor(EDITOR_MULTIMARKDOWN_METADATA, "Support Multi-Markdown Metadata", internal));
// Browser CSS
addField(new ComboFieldEditor(EDITOR_CSS_DEFAULT, "Default Stylesheet", builtins(), internal));
addField(new FileFieldEditor(EDITOR_CSS_CUSTOM, "Custom Stylesheet", internal));
}
示例5: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
// separator
Label label = new Label(getFieldEditorParent(), SWT.NONE);
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
// beep fields
String[][] typeOfBeepTriggers = { { "Do Not Beep", "NONE" },
{ "Parameter First Out-of-Limit Value", "FIRST" },
{ "Parameter Each Out-of-Limit Value", "EACH" } };
triggerBeep = new ComboFieldEditor("trigerBeep", "Beep on event:",
typeOfBeepTriggers, getFieldEditorParent());
addField(triggerBeep);
beepWarning = new BooleanFieldEditor("beepWarning", "Beep on Warning",
getFieldEditorParent());
addField(beepWarning);
beepCritical = new BooleanFieldEditor("beepCritical",
"Beep on Critical", getFieldEditorParent());
addField(beepCritical);
}
示例6: updateFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的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);
}
}
示例7: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
addField(new ComboFieldEditor(PreferenceKeys.SEEK_OUTPUT_TYPE, local.getString("seekOutType"),
SEEK_OUTPUT_TYPES, getFieldEditorParent()));
addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_COMPUTER_COLOR,
local.getString("seekGraphCompCol"), getFieldEditorParent()));
addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_MANY_COLOR,
local.getString("seekGraphManyCol"), getFieldEditorParent()));
addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_RATED_COLOR,
local.getString("seekGraphRatCol"), getFieldEditorParent()));
addField(new ColorFieldEditor(PreferenceKeys.SEEK_GRAPH_UNRATED_COLOR,
local.getString("seekGraphUnratCol"), getFieldEditorParent()));
}
示例8: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(PreferenceKeys.RESULTS_FADE_AWAY_MODE,
local.getString("resFedAw"), getFieldEditorParent()));
addField(new ComboFieldEditor(PreferenceKeys.RESULTS_ANIMATION_DELAY,
local.getString("resAnDel"), RESULTS_ANIMATION_DELAY_OPTIONS,
getFieldEditorParent()));
addField(new ComboFieldEditor(PreferenceKeys.RESULTS_WIDTH_PERCENTAGE,
local.getString("resPreSz"), RESULTS_PERCENTAGE,
getFieldEditorParent()));
addField(new ColorFieldEditor(PreferenceKeys.RESULTS_COLOR,
local.getString("resCol"), getFieldEditorParent()));
addField(new FontFieldEditor(PreferenceKeys.RESULTS_FONT,
local.getString("resFnt"), getFieldEditorParent()));
}
示例9: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的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() {
addField(new ComboFieldEditor(JSS_COMPATIBILITY_VERSION, Messages.StudioPreferencePage_versionLabel, JRXmlWriterHelper.getVersions(),
getFieldEditorParent()));
addField(new BooleanFieldEditor(JSS_COMPATIBILITY_SHOW_DIALOG, Messages.StudioPreferencePage_showCompDialog,
getFieldEditorParent()));
Label label = new Label(getFieldEditorParent(), SWT.WRAP);
label.setText(Messages.StudioPreferencePage_message1);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
label.setLayoutData(gd);
label = new Label(getFieldEditorParent(), SWT.WRAP);
label.setText(Messages.StudioPreferencePage_message2);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
label.setLayoutData(gd);
}
示例10: createFilterSelector
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
/**
* createFilterSelector
*
* @param parent
*/
protected void createFilterSelector(Composite parent)
{
// @formatter:off
ComboFieldEditor fieldEditor = new ComboFieldEditor(
com.aptana.editor.common.contentassist.IPreferenceConstants.CONTENT_ASSIST_USER_AGENT_FILTER_TYPE,
Messages.ContentAssistPreferencePage_ProposalFilterTypeLabel,
new String[][]
{
{ Messages.ContentAssistPreferencePage_NoFilterLabel, UserAgentFilterType.NO_FILTER.getText() },
{ Messages.ContentAssistPreferencePage_OneOrMoreFilterLabel, UserAgentFilterType.ONE_OR_MORE.getText() },
{ Messages.ContentAssistPreferencePage_AllFilterLabel, UserAgentFilterType.ALL.getText() }
},
parent
);
addField(fieldEditor);
// @formatter:on
// We only want to enable this field editor for workspace-specific settings.
// Since the UI will not draw anything unless we have at least one field-editor in this page, we have to add it
// and disable it for project-specific.
fieldEditor.setEnabled(!isProjectPreferencePage(), parent);
}
示例11: addDefaultSortColumnEditor
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
protected void addDefaultSortColumnEditor(List<String> ids) {
String entryNamesAndValues[][] = new String[ids.size()+1][2];
entryNamesAndValues[0][0] = "";
entryNamesAndValues[0][1] = P_MERGE_EDITOR_SORT_COLUMN_NONE;
for(int i=0; i<ids.size(); i++) {
String id = ids.get(i);
entryNamesAndValues[i+1][0] = id; // should be a pretty name
entryNamesAndValues[i+1][1] = id; // should be the internal id
}
addField(new ComboFieldEditor(
P_MERGE_EDITOR_SORT_COLUMN,
"Default sort column",
entryNamesAndValues,
getFieldEditorParent()));
}
示例12: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
public void createFieldEditors() {
final Level[] logLevels = new Level[] { Level.OFF, Level.ERROR,
Level.WARN, Level.INFO, Level.DEBUG, Level.TRACE };
final String[][] values = new String[logLevels.length][2];
for (int i = 0; i < logLevels.length; i++) {
// constructor of ComboFieldEditor expects a two-dimensional
// array with label-value pairs.
values[i][0] = logLevels[i].toString();
values[i][1] = logLevels[i].toString();
}
final ComboFieldEditor editor = new ComboFieldEditor(
ConsoleImpl.KEY, "Log level:", values,
this.getFieldEditorParent());
this.addField(editor);
}
示例13: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
protected void createFieldEditors() {
String[][] entryNamesAndValues = new String[][] {
new String[] { "clean all", EGradleJUnitTestTasksType.CLEAN_ALL.getId() },
new String[] { "clean tests only", EGradleJUnitTestTasksType.CLEAN_ONLY_TESTS.getId() },
new String[] { "do nothing", EGradleJUnitTestTasksType.CLEAN_NOTHING.getId() } };
/* @formatter:on */
gradleCallTypeRadioButton = new ComboFieldEditor(P_TEST_TASKS.getId(), "Before test execution", entryNamesAndValues,
getFieldEditorParent());
addField(gradleCallTypeRadioButton);
SWTFactory.createLabel(getFieldEditorParent(), "(This will be used by all test launch configurations)", 2);
}
示例14: createFieldEditors
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
/**
* Creates the JVM Options Preferece page field editors.
*
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
@Override
public void createFieldEditors() {
this.setAllVMs();
this.addField(new ComboFieldEditor(PREF_JRE, JVM_JAVAVM_LABEL, this.jvmNamesAndValues, this.getFieldEditorParent()));
this.addField(new JVMOptionEditor(PREF_JVM_OPTIONS, JVM_OPTIONS_LABEL, this.getFieldEditorParent()));
this.addField(new PathFieldEditor(PREF_LIBPATH, JVM_LIBRARYPATH_LABEL, this.getFieldEditorParent()));
}
示例15: createFieldEditor
import org.eclipse.jface.preference.ComboFieldEditor; //導入依賴的package包/類
@Override
public FieldEditor createFieldEditor(Composite parent) {
String[][] entryNamesAndValues = new String[values.size()][2];
for (int i = 0; i < values.size(); ++i) {
entryNamesAndValues[i][0] = values.get(i).getDisplayName();
entryNamesAndValues[i][1] = values.get(i).getId();
}
return new ComboFieldEditor(this.getKey(), this.getDescription(), entryNamesAndValues, parent);
}