List of usage examples for org.eclipse.jface.preference ScaleFieldEditor ScaleFieldEditor
public ScaleFieldEditor(String name, String labelText, Composite parent, int min, int max, int increment, int pageIncrement)
From source file:com.litrik.eclipse.xps.preferences.XPSPreferencePage.java
License:Apache License
public void createFieldEditors() { addField(new BooleanFieldEditor(XPSPreferenceConstants.P_JUNIT_ENABLED, JUNIT_ENABLED, getFieldEditorParent()));//w w w .j av a2s .co m // A group for the color preferences Group colorGroup = new Group(getFieldEditorParent(), SWT.NONE); colorGroup.setText(JUNIT_COLOR); // The color when a test run starts final LEDColorFieldEditor startLEDColorFieldEditor = new LEDColorFieldEditor( XPSPreferenceConstants.P_JUNIT_COLOR_START, JUNIT_COLOR_START, colorGroup); addField(startLEDColorFieldEditor); // A preview button final Button previewStartButton = new Button(colorGroup, SWT.NONE); previewStartButton.setText("Preview"); // The color when a test run was successful final LEDColorFieldEditor successLEDColorFieldEditor = new LEDColorFieldEditor( XPSPreferenceConstants.P_JUNIT_COLOR_SUCCESS, JUNIT_COLOR_SUCCESS, colorGroup); addField(successLEDColorFieldEditor); // A preview button final Button previewSuccessButton = new Button(colorGroup, SWT.NONE); previewSuccessButton.setText("Preview"); // The color when a test failed final LEDColorFieldEditor failureLEDColorFieldEditor = new LEDColorFieldEditor( XPSPreferenceConstants.P_JUNIT_COLOR_FAILURE, JUNIT_COLOR_FAILURE, colorGroup); addField(failureLEDColorFieldEditor); // A preview button final Button previewFailureButton = new Button(colorGroup, SWT.NONE); previewFailureButton.setText("Preview"); // The brightness final ScaleFieldEditor brightnessScaleFieldEditor = new ScaleFieldEditor( XPSPreferenceConstants.P_JUNIT_BRIGHTNESS, JUNIT_BRIGHTNESS, colorGroup, 1, 7, 1, 1); addField(brightnessScaleFieldEditor); // Pulsate addField(new BooleanFieldEditor(XPSPreferenceConstants.P_JUNIT_PULSATE, JUNIT_PULSE, colorGroup)); // Layout the group GridLayout colorGroupLayout = new GridLayout(); colorGroupLayout.numColumns = 3; colorGroup.setLayout(colorGroupLayout); GridData colorGroupGridData = new GridData(GridData.FILL_HORIZONTAL); colorGroupGridData.horizontalSpan = 2; colorGroup.setLayoutData(colorGroupGridData); // A group for the time-out preferences Group timeOutGroup = new Group(getFieldEditorParent(), SWT.NONE); timeOutGroup.setText(JUNIT_TIMEOUT); // The time-out after success addField(new IntegerFieldEditor(XPSPreferenceConstants.P_JUNIT_TIMEOUT_SUCCESS, JUNIT_TIMEOUT_SUCCESS, timeOutGroup, 3)); final Label secondsSuccessLabel = new Label(timeOutGroup, SWT.NONE); secondsSuccessLabel.setText(JUNIT_TIMEOUT_SECONDS); // The time-out after failure addField(new IntegerFieldEditor(XPSPreferenceConstants.P_JUNIT_TIMEOUT_FAILURE, JUNIT_TIMEOUT_FAILURE, timeOutGroup, 3)); final Label secondsFailureLabel = new Label(timeOutGroup, SWT.NONE); secondsFailureLabel.setText(JUNIT_TIMEOUT_SECONDS); // Layout the group GridLayout timeOutGroupLayout = new GridLayout(); timeOutGroupLayout.numColumns = 3; timeOutGroup.setLayout(timeOutGroupLayout); GridData timeOutGroupGridData = new GridData(GridData.FILL_HORIZONTAL); timeOutGroupGridData.horizontalSpan = 2; timeOutGroup.setLayoutData(timeOutGroupGridData); // A group for the LED location preferences Group locationGroup = new Group(getFieldEditorParent(), SWT.NONE); locationGroup.setText(JUNIT_LOCATION); // Fan LEDs final BooleanFieldEditor fansBooleanFieldEditor = new BooleanFieldEditor( XPSPreferenceConstants.P_JUNIT_LOCATION_FANS, JUNIT_LOCATION_FANS, locationGroup); addField(fansBooleanFieldEditor); // Speaker LEDs final BooleanFieldEditor speakersBooleanFieldEditor = new BooleanFieldEditor( XPSPreferenceConstants.P_JUNIT_LOCATION_SPEAKERS, JUNIT_LOCATION_SPEAKERS, locationGroup); addField(speakersBooleanFieldEditor); // Panel back LEDs final BooleanFieldEditor panelBooleanFieldEditor = new BooleanFieldEditor( XPSPreferenceConstants.P_JUNIT_LOCATION_PANEL, JUNIT_LOCATION_PANEL, locationGroup); addField(panelBooleanFieldEditor); // Layout the group GridLayout locationGroupLayout = new GridLayout(); locationGroup.setLayout(locationGroupLayout); GridData locationGroupGridData = new GridData(GridData.FILL_HORIZONTAL); locationGroupGridData.horizontalSpan = 2; locationGroup.setLayoutData(locationGroupGridData); // Let the "Preview" buttons do something previewStartButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent se) { try { LEDs.setLeds(startLEDColorFieldEditor.getCurrentValue(), fansBooleanFieldEditor.getBooleanValue(), speakersBooleanFieldEditor.getBooleanValue(), panelBooleanFieldEditor.getBooleanValue(), brightnessScaleFieldEditor.getScaleControl().getSelection()); } catch (LEDException e) { Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Status.OK, "An unexpected error occurred when setting the XPS LEDs.", e)); } } }); previewSuccessButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent se) { try { LEDs.setLeds(successLEDColorFieldEditor.getCurrentValue(), fansBooleanFieldEditor.getBooleanValue(), speakersBooleanFieldEditor.getBooleanValue(), panelBooleanFieldEditor.getBooleanValue(), brightnessScaleFieldEditor.getScaleControl().getSelection()); } catch (LEDException e) { Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Status.OK, "An unexpected error occurred when setting the XPS LEDs.", e)); } } }); previewFailureButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent se) { try { LEDs.setLeds(failureLEDColorFieldEditor.getCurrentValue(), fansBooleanFieldEditor.getBooleanValue(), speakersBooleanFieldEditor.getBooleanValue(), panelBooleanFieldEditor.getBooleanValue(), brightnessScaleFieldEditor.getScaleControl().getSelection()); } catch (LEDException e) { Activator.getDefault().getLog().log( new Status(IStatus.ERROR, Activator.PLUGIN_ID, Status.OK, LEDException.MESSAGE, e)); } } }); }
From source file:edu.buffalo.cse.green.preferences.GreenPreferencePage.java
License:Open Source License
/** * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() *//*from w ww. j a va2s .c o m*/ public void createFieldEditors() { addField(new BooleanFieldEditor(P_FORCE_DIA_IN_PROJECT, "Create all diagram files in project root", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_AUTOGEN_MAIN, "Generate stubs for public static void main(String[] args)", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_AUTOGEN_SUPER_CONSTR, "Generate stubs for constructors from superclass", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_AUTOGEN_ABST_METHOD, "Generate stubs for inherited abstract methods", 0, getFieldEditorParent())); addField(new StringFieldEditor(P_GRID_SIZE, "Grid Size", 5, getFieldEditorParent())); addField(new BooleanFieldEditor(P_AUTOSAVE, "Save compilation units automatically after code modification", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_DISPLAY_RELATIONSHIP_SUBTYPES, "Show subtype names on relationship arcs", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_MANHATTAN_ROUTING, "Use Manhattan routing", 0, getFieldEditorParent())); addField(new BooleanFieldEditor(P_DISPLAY_INCREMENTAL_EXPLORER_DIA, "Display Incremental Explorer Icons in Diagram Editor", 0, getFieldEditorParent())); addField( new BooleanFieldEditor(P_AUTOARRANGE, "Automatically Arrange Diagrams", 0, getFieldEditorParent())); addField(new ScaleFieldEditor(P_DRAW_LINE_WIDTH, "Relationship Line Width", getFieldEditorParent(), 0, 3, 1, 1)); adjustGridLayout(); }
From source file:edu.washington.cs.cupid.preferences.AdvancedPreferencePage.java
License:Open Source License
@Override public void createFieldEditors() { addField(new BooleanFieldEditor(PreferenceConstants.P_JOB_STATUS_LOGGING, "Enable job status logging", getFieldEditorParent()));// w ww .ja v a2s . c o m addField(new BooleanFieldEditor(PreferenceConstants.P_CACHE_STATUS_LOGGING, "Enable cache status logging (i.e., hits and ejections)", getFieldEditorParent())); addField(new ScaleFieldEditor(PreferenceConstants.P_INSPECTOR_KILL_TIME_SECONDS, "Inspector View cancelation threshold:", getFieldEditorParent(), MINIMUM_CANCELATION_SECONDS, MAXIMUM_CANCELATION_SECONDS, 1, 1)); }
From source file:net.refractions.udig.catalog.internal.wmt.ui.preferences.WMTTilePreferencesPage.java
License:Open Source License
@Override protected void createFieldEditors() { getFieldEditorParent().setLayout(new RowLayout(SWT.VERTICAL)); //region Scale-Factor Group grpScaleFactor = new Group(getFieldEditorParent(), SWT.NONE); grpScaleFactor.setText(Messages.Preferences_ScaleFactor_Title); grpScaleFactor.setLayout(new RowLayout(SWT.VERTICAL)); grpScaleFactor.setLayoutData(new RowData(300, 20)); //region Scale-Component Description Composite cScaleFactorDescription = new Composite(grpScaleFactor, SWT.NONE); cScaleFactorDescription.setLayoutData(new RowData(400, 25)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3;/*from w w w . j a va 2 s .co m*/ gridLayout.makeColumnsEqualWidth = false; cScaleFactorDescription.setLayout(gridLayout); Label lblFast = new Label(cScaleFactorDescription, SWT.HORIZONTAL); lblFast.setText(Messages.Preferences_ScaleFactor_FastRendering); lblFast.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); lblValue = new Label(cScaleFactorDescription, SWT.HORIZONTAL); lblValue.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.FILL_HORIZONTAL)); Label lblQuality = new Label(cScaleFactorDescription, SWT.HORIZONTAL | GridData.FILL_HORIZONTAL); lblQuality.setText(Messages.Preferences_ScaleFactor_HighestQuality); lblQuality.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_END)); //endregion //region Scale-Component ScaleFieldEditor scaleFactorFieldEditor = new ScaleFieldEditor(WMTPreferenceConstants.P_WMT_SCALEFACTOR, "", //$NON-NLS-1$ grpScaleFactor, 1, 100, 1, 5); scaleFactorFieldEditor.getLabelControl(grpScaleFactor).setLayoutData(new RowData()); addField(scaleFactorFieldEditor); sclScaleFactor = scaleFactorFieldEditor.getScaleControl(); sclScaleFactor.setSize(400, 30); sclScaleFactor.setMinimum(0); sclScaleFactor.setMaximum(100); sclScaleFactor.setIncrement(1); sclScaleFactor.setPageIncrement(10); sclScaleFactor.setSelection(50); sclScaleFactor.setLayoutData(new RowData(400, 30)); sclScaleFactor.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent arg0) { } public void widgetSelected(SelectionEvent event) { updateScaleFactorValue(); } }); sclScaleFactor.addListener(SWT.Paint, new Listener() { /** * When the scale-component is painted for the first time, * also update the display of the scale-factor. */ public void handleEvent(Event arg0) { updateScaleFactorValue(); sclScaleFactor.removeListener(SWT.Paint, this); } }); //endregion //region Scale-Component Label Composite cScaleFactorDescriptionValues = new Composite(grpScaleFactor, SWT.NONE); cScaleFactorDescriptionValues.setLayoutData(new RowData(400, 30)); GridLayout gridLayoutTwo = new GridLayout(); gridLayoutTwo.numColumns = 2; gridLayoutTwo.makeColumnsEqualWidth = false; cScaleFactorDescriptionValues.setLayout(gridLayoutTwo); Label lblValue0 = new Label(cScaleFactorDescriptionValues, SWT.HORIZONTAL); lblValue0.setText("0"); //$NON-NLS-1$ lblValue0.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); Label lblValue100 = new Label(cScaleFactorDescriptionValues, SWT.HORIZONTAL | GridData.FILL_HORIZONTAL); lblValue100.setText("100"); //$NON-NLS-1$ lblValue100.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_END)); Label lblScaleFactorExpl = new Label(grpScaleFactor, SWT.HORIZONTAL | SWT.WRAP); lblScaleFactorExpl.setText(Messages.Preferences_ScaleFactor_Description); lblScaleFactorExpl.setLayoutData(new RowData(400, 50)); //endregion //endregion //region Tile-Limit Group grpTileLimit = new Group(getFieldEditorParent(), SWT.NONE); grpTileLimit.setLayout(new RowLayout(SWT.VERTICAL)); grpTileLimit.setText(Messages.Preferences_TileLimit_Title); Composite limitFields = new Composite(grpTileLimit, SWT.NONE); IntegerFieldEditor warningFieldEditor = new IntegerFieldEditor( WMTPreferenceConstants.P_WMT_TILELIMIT_WARNING, Messages.Preferences_TileLimit_Warning, limitFields); addField(warningFieldEditor); IntegerFieldEditor errorFieldEditor = new IntegerFieldEditor(WMTPreferenceConstants.P_WMT_TILELIMIT_ERROR, Messages.Preferences_TileLimit_Error, limitFields); addField(errorFieldEditor); Label lblTileLimitExpl = new Label(grpTileLimit, SWT.HORIZONTAL | SWT.WRAP); lblTileLimitExpl.setText(Messages.Preferences_TileLimit_Description); lblTileLimitExpl.setLayoutData(new RowData(400, 90)); //endregion //region Reset LayoutManagers (they are set to GridLayout when the field is added) grpScaleFactor.setLayout(new RowLayout(SWT.VERTICAL)); cScaleFactorDescription.setLayout(gridLayout); cScaleFactorDescriptionValues.setLayout(gridLayoutTwo); grpScaleFactor.pack(); grpTileLimit.pack(); //endregion }
From source file:net.sf.colorer.eclipse.PreferencePage.java
License:LGPL
public void createFieldEditors() { Composite p = getFieldEditorParent(); createHeader(p);//from w w w.j a v a 2s . co m addField(new BooleanFieldEditor(SPACES_FOR_TABS, Messages.get(SPACES_FOR_TABS), p)); addField(new BooleanFieldEditor(WORD_WRAP, Messages.get(WORD_WRAP), p)); addField(new BooleanFieldEditor(WORD_WRAP_PATCH, Messages.get(WORD_WRAP_PATCH), p)); addField(new BooleanFieldEditor(FULL_BACK, Messages.get(FULL_BACK), p)); addField(new BooleanFieldEditor(HORZ_CROSS, Messages.get(HORZ_CROSS), p)); addField(new BooleanFieldEditor(PROJECTION, Messages.get(PROJECTION), p)); String[][] arrPairs = new String[4][2]; arrPairs[0][0] = Messages.get("PAIRS_NO"); arrPairs[0][1] = "PAIRS_NO"; arrPairs[1][0] = Messages.get("PAIRS_XOR"); arrPairs[1][1] = "PAIRS_XOR"; arrPairs[2][0] = Messages.get("PAIRS_OUTLINE"); arrPairs[2][1] = "PAIRS_OUTLINE"; arrPairs[3][0] = Messages.get("PAIRS_OUTLINE2"); arrPairs[3][1] = "PAIRS_OUTLINE2"; addField(new RadioGroupFieldEditor(PAIRS_MATCH, Messages.get(PAIRS_MATCH), 1, arrPairs, p)); new Label(p, 0).setText(Messages.get(HRD_SET)); hrdSets = new Combo(p, SWT.DROP_DOWN | SWT.READ_ONLY); ParserFactory pf = ColorerPlugin.getDefaultPF(); hrdSetsList = ColorerPlugin.getDefault().getHRDList(); for (int idx = 0; idx < hrdSetsList.size(); idx++) { String hrd_name = (String) hrdSetsList.elementAt(idx); String hrd_descr = pf.getHRDescription("rgb", hrd_name); hrdSets.add(hrd_descr); if (getPreferenceStore().getString(HRD_SET).equals(hrd_name)) { hrdSets.select(hrdSets.getItemCount() - 1); } } hrdSets.setVisibleItemCount(10); addField(new BooleanFieldEditor(USE_BACK, Messages.get(USE_BACK), p)); ScaleFieldEditor back_scale = new ScaleFieldEditor(BACK_SCALE, Messages.get(BACK_SCALE), p, 0, 10, 1, 5); addField(back_scale); }
From source file:org.cs3.pdt.graphicalviews.preferences.MainPreferencePage.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.//w ww.j a v a 2s .c o m */ @Override public void createFieldEditors() { addField(new ScaleFieldEditor(LAYOUT_COMPACTNESS, "Layout Compactness", getFieldEditorParent(), 0, 900, 100, 100)); addField(new RefreshModeFieldEditor(getFieldEditorParent())); }
From source file:org.eclipse.actf.ai.voice.preferences.VoicePreferencePage.java
License:Open Source License
public void createFieldEditors() { final RadioGroupFieldEditor rgfe; String[][] labelAndIds = TTSRegistry.getLabelAndIds(); addField(rgfe = new RadioGroupFieldEditor(IVoice.PREF_ENGINE, Messages.voice_engine, 1, labelAndIds, getFieldEditorParent()));/*from w ww . j av a 2 s . co m*/ Composite c = rgfe.getRadioBoxControl(getFieldEditorParent()); for (int i = 0; i < labelAndIds.length; i++) { if (labelAndIds[i][1].length() == 0) { c.getChildren()[i].setEnabled(false); } } final ScaleFieldEditor speedEditor; addField(speedEditor = new ScaleFieldEditor(IVoice.PREF_SPEED, Messages.voice_speed, getFieldEditorParent(), IVoice.SPEED_MIN, IVoice.SPEED_MAX, 5, 25)); Composite comp = new Composite(getFieldEditorParent(), SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = layout.marginWidth = 0; comp.setLayout(layout); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END); gd.horizontalSpan = speedEditor.getNumberOfControls(); comp.setLayoutData(gd); Button testButton = new Button(comp, SWT.NONE); testButton.setText(Messages.voice_test); testButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { voice.setSpeed(speedEditor.getScaleControl().getSelection()); voice.speak(SAMPLE_TEXT, false); } }); }
From source file:org.eclipse.cdt.debug.ui.memory.floatingpoint.FPRenderingPreferencePage.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 va2 s . com @Override public void createFieldEditors() { addField(new BooleanFieldEditor(FPRenderingPreferenceConstants.MEM_USE_GLOBAL_TEXT, "Use Global Te&xt Color", getFieldEditorParent())); //$NON-NLS-1$ addField(new ColorFieldEditor(FPRenderingPreferenceConstants.MEM_COLOR_TEXT, "&Text Color:", //$NON-NLS-1$ getFieldEditorParent())); addField(new ScaleFieldEditor(FPRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, "Brighten Alternate Cells", getFieldEditorParent(), 0, 8, 1, 1)); //$NON-NLS-1$ addField(new BooleanFieldEditor(FPRenderingPreferenceConstants.MEM_USE_GLOBAL_BACKGROUND, "Use Global B&ackground Color", getFieldEditorParent())); //$NON-NLS-1$ addField(new ColorFieldEditor(FPRenderingPreferenceConstants.MEM_COLOR_BACKGROUND, "&Background Color:", //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorFieldEditor(FPRenderingPreferenceConstants.MEM_COLOR_CHANGED, "&Changed Color:", //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorFieldEditor(FPRenderingPreferenceConstants.MEM_COLOR_EDIT, "&Edit Color:", //$NON-NLS-1$ getFieldEditorParent())); addField(new BooleanFieldEditor(FPRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION, "Use Global Se&lection Color", getFieldEditorParent())); //$NON-NLS-1$ addField(new ColorFieldEditor(FPRenderingPreferenceConstants.MEM_COLOR_SELECTION, "&Selection Color:", //$NON-NLS-1$ getFieldEditorParent())); addField(new RadioGroupFieldEditor(FPRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE, "Edit Buffer", 1, //$NON-NLS-1$ new String[][] { { "Save on E&nter, Cancel on Focus Lost", "saveOnEnterCancelOnFocusLost" }, //$NON-NLS-1$ //$NON-NLS-2$ { "Save on Enter or Focus L&ost", "saveOnEnterOrFocusLost" } }, //$NON-NLS-1$//$NON-NLS-2$ getFieldEditorParent())); addField(new ScaleFieldEditor(FPRenderingPreferenceConstants.MEM_HISTORY_TRAILS_COUNT, "History &Trail Levels", getFieldEditorParent(), 1, 10, 1, 1)); //$NON-NLS-1$ }
From source file:org.eclipse.cdt.debug.ui.memory.traditional.TraditionalRenderingPreferencePage.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 av a 2s . c o m */ @Override public void createFieldEditors() { addField(new BooleanFieldEditor(TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_TEXT, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_UseGlobalTextColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_TEXT, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_TextColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ScaleFieldEditor(TraditionalRenderingPreferenceConstants.MEM_LIGHTEN_DARKEN_ALTERNATE_CELLS, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_BrightenAlternateCells"), //$NON-NLS-1$ getFieldEditorParent(), 0, 8, 1, 1)); addField(new BooleanFieldEditor( TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_BACKGROUND, TraditionalRenderingMessages .getString("TraditionalRenderingPreferencePage_UseGlobalBackgroundColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_BACKGROUND, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_BackgroundColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorAndEffectFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED, TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOLD, TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_ITALIC, TraditionalRenderingPreferenceConstants.MEM_COLOR_CHANGED_BOX, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_ChangedColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorAndEffectFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT, TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOLD, TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_ITALIC, TraditionalRenderingPreferenceConstants.MEM_COLOR_EDIT_BOX, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_EditColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new BooleanFieldEditor( TraditionalRenderingPreferenceConstants.MEM_USE_GLOBAL_SELECTION, TraditionalRenderingMessages .getString("TraditionalRenderingPreferencePage_UseGlobalSelectionColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new ColorFieldEditor(TraditionalRenderingPreferenceConstants.MEM_COLOR_SELECTION, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_SelectionColor"), //$NON-NLS-1$ getFieldEditorParent())); addField(new RadioGroupFieldEditor(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_EditBuffer"), 1, //$NON-NLS-1$ new String[][] { { TraditionalRenderingMessages .getString("TraditionalRenderingPreferencePage_SaveOnEnterCancelOnFocusLost"), //$NON-NLS-1$ "saveOnEnterCancelOnFocusLost" }, //$NON-NLS-1$ { TraditionalRenderingMessages .getString("TraditionalRenderingPreferencePage_SaveOnEnterOrFocusLost"), //$NON-NLS-1$ "saveOnEnterOrFocusLost" } }, //$NON-NLS-1$ getFieldEditorParent())); addField(new ScaleFieldEditor(TraditionalRenderingPreferenceConstants.MEM_HISTORY_TRAILS_COUNT, TraditionalRenderingMessages.getString("TraditionalRenderingPreferencePage_HistoryTrailLevels"), //$NON-NLS-1$ getFieldEditorParent(), 1, 10, 1, 1)); }
From source file:org.eclipse.papyrus.diagram.common.groups.preferences.OpacityGroup.java
License:Open Source License
/** * Creates the content./*ww w .j av a 2 s .c o m*/ * * @param parent * the parent */ public void createContent(Composite parent) { Group visibilityGroup = new Group(parent, SWT.SCROLL_PAGE); /* * TODO Refactor layout (help component at the end of the line) */ visibilityGroup.setLayout(new GridLayout()); visibilityGroup.setText("Opacity of the compartment"); ScaleFieldEditor alphaEditor = new ScaleFieldEditor(preferenceName, "Opacity", visibilityGroup, 0, 255, 5, 20); alphaEditor.setPage(dialogPage); addFieldEditor(alphaEditor); HelpComponentFactory.createHelpComponent(visibilityGroup, new FormToolkit(parent.getDisplay()), "Set to min to make the compartment totally transparent"); }