org.eclipse.jface.preference.RadioGroupFieldEditor Java Examples

The following examples show how to use org.eclipse.jface.preference.RadioGroupFieldEditor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DartPreferencePage.java    From dartboard with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Called when changes to the property fields of the page are made.
 *
 * This method performs a validity check on the fields.
 */
@Override
public void propertyChange(PropertyChangeEvent event) {
	if (event.getSource() instanceof RadioGroupFieldEditor) {
		flutterEnabledRadio.store();
		if (getPreferenceStore().getBoolean(GlobalConstants.P_FLUTTER_ENABLED)) {
			dartSDKLocationEditor.setEnabled(false);
			flutterSDKLocationFieldEditor.setEnabled(true);
		} else {
			dartSDKLocationEditor.setEnabled(true);
			flutterSDKLocationFieldEditor.setEnabled(false);
		}

	}
	super.propertyChange(event);
}
 
Example #2
Source File: LoggerConfigPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
	Composite parent = getFieldEditorParent();
	BooleanFieldEditor logConsole = new BooleanFieldEditor(
			LoggerPreference.LOG_CONSOLE, "Show log console",
			getFieldEditorParent());
	addField(logConsole);
	String[][] logLevel = new String[][] {
			{ "All", LoggerPreference.LEVEL_ALL },
			{ "Information", LoggerPreference.LEVEL_INFO },
			{ "Warnings", LoggerPreference.LEVEL_WARN },
			{ "Errors", LoggerPreference.LEVEL_ERROR } };
	RadioGroupFieldEditor logRadios = new RadioGroupFieldEditor(
			LoggerPreference.LOG_LEVEL, "Log-Level:", 1, logLevel, parent,
			true);
	addField(logRadios);
}
 
Example #3
Source File: Ablauf.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors(){
	addField(new RadioGroupFieldEditor(Preferences.ABL_LANGUAGE, Messages.Ablauf_preferredLang,
		1, new String[][] {
			{
				Messages.Ablauf_german, "d" //$NON-NLS-1$
			}, {
				Messages.Ablauf_french, "f" //$NON-NLS-1$
			}, {
				Messages.Ablauf_italian, Messages.Ablauf_24
			}
		}, getFieldEditorParent()));
		
	addField(new IntegerFieldEditor(Preferences.ABL_CACHELIFETIME,
		Messages.Ablauf_cachelifetime, getFieldEditorParent()));
	
	addField(new IntegerFieldEditor(Preferences.ABL_HEARTRATE, Messages.Ablauf_heartrate,
		getFieldEditorParent()));
	
}
 
Example #4
Source File: PyCodeStylePreferencesPage.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 */
@Override
public void createFieldEditors() {
    Composite p = getFieldEditorParent();

    useLocalsAndAttrsCamelCase = new RadioGroupFieldEditor(USE_LOCALS_AND_ATTRS_CAMELCASE,
            "Locals and attributes format (used for assign quick-assist)?", 1, LOCALS_LABEL_AND_VALUE, p, true);
    addField(useLocalsAndAttrsCamelCase);

    useMethodsFormat = new RadioGroupFieldEditor(USE_METHODS_FORMAT,
            "Methods format (used for generate properties refactoring)", 1, LABEL_AND_VALUE, p, true);
    addField(useMethodsFormat);

    labelLocalsFormat = new Label(p, SWT.NONE);

    labelMethodsFormat = new Label(p, SWT.NONE);
    updateLabelLocalsAndAttrs(useLocalsAndAttrsCamelCase());
    updateLabelMethods(useMethodsCamelCase());

}
 
Example #5
Source File: MoosePreferencePage.java    From ice with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
	addField(new DirectoryFieldEditor("PATH", "&Directory preference:",
			getFieldEditorParent()));
	addField(new BooleanFieldEditor("BOOLEAN_VALUE",
			"&An example of a boolean preference", getFieldEditorParent()));

	addField(new RadioGroupFieldEditor("CHOICE",
			"An example of a multiple-choice preference", 1,
			new String[][] { { "&Choice 1", "choice1" },
					{ "C&hoice 2", "choice2" } }, getFieldEditorParent()));
	addField(new StringFieldEditor("MySTRING1", "A &text preference:",
			getFieldEditorParent()));
	addField(new StringFieldEditor("MySTRING2", "A &text preference:",
			getFieldEditorParent()));
}
 
Example #6
Source File: NodePreferencesPage.java    From depan with Apache License 2.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  // color: mode
  RadioGroupFieldEditor colorSelect = new RadioGroupFieldEditor(
      NodePreferencesIds.NODE_COLOR, "...shows...", 3,
      buildNodeColorModeOptions(), parent, true);

  // shape: mode
  RadioGroupFieldEditor shapeSelect = new RadioGroupFieldEditor(
      NodePreferencesIds.NODE_SHAPE, "...shows...", 2, 
      buildNodeShapeModeOptions(), parent, true);

  // size: mode
  RadioGroupFieldEditor sizeSelect = new RadioGroupFieldEditor(
      NodePreferencesIds.NODE_SIZE, "...shows...", 2,
      buildNodeSizeModeOptions(), parent, true);

  // add fields to the page
  addField(colorSelect);
  addField(shapeSelect);
  addField(sizeSelect);
}
 
Example #7
Source File: FoldingPreferences.java    From solidity-ide with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createFieldEditors() {
	Composite parent = getFieldEditorParent();
	
	RadioGroupFieldEditor autoFoldCommentChoice = new RadioGroupFieldEditor(
			ISolidityPreferencesConstants.FOLDING_COMMENT_AUTOFOLD
			, "Auto-fold comments"
			, 1
			, new String[][] {
				 {"None", ISolidityPreferencesConstants.FOLDING_COMMENT_AUTOFOLD_NONE}
				,{"Only header comment", ISolidityPreferencesConstants.FOLDING_COMMENT_AUTOFOLD_HEADER}
				,{"All", ISolidityPreferencesConstants.FOLDING_COMMENT_AUTOFOLD_ALL}
			}
			, parent);
	addField(autoFoldCommentChoice);
	
	IntegerFieldEditor longCommentLineCount = new IntegerFieldEditor(
			ISolidityPreferencesConstants.FOLDING_COMMENT_LINECOUNT
			, "Enable folding for comments exceeding line count"
			, parent);
	addField(longCommentLineCount);
}
 
Example #8
Source File: ColoringPreferencePage.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates the property editing UI components of this page.
 */
protected void createFieldEditors() {
    adjustGridLayout();
    addField(new ColorFieldEditor(ColorManager.DEFAULT, TexlipsePlugin.getResourceString("preferenceColorTextLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.DEFAULT_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.COMMAND, TexlipsePlugin.getResourceString("preferenceColorCommandLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.COMMAND_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.CURLY_BRACKETS, TexlipsePlugin.getResourceString("preferenceColorArgumentLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.CURLY_BRACKETS_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.SQUARE_BRACKETS, TexlipsePlugin.getResourceString("preferenceColorOptionalLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.SQUARE_BRACKETS_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.EQUATION, TexlipsePlugin.getResourceString("preferenceColorMathLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.EQUATION_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.COMMENT, TexlipsePlugin.getResourceString("preferenceColorCommentLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.COMMENT_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.TEX_NUMBER, TexlipsePlugin.getResourceString("preferenceColorNumberLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.TEX_NUMBER_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.TEX_SPECIAL, TexlipsePlugin.getResourceString("preferenceColorSpeLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.TEX_SPECIAL_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
    addField(new ColorFieldEditor(ColorManager.VERBATIM, TexlipsePlugin.getResourceString("preferenceColorVerbatimLabel"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(ColorManager.VERBATIM_STYLE, "", 3, RADIO_STYLE_STRING, getFieldEditorParent()));
}
 
Example #9
Source File: PerspectivesPreferencePage.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {

    RadioGroupFieldEditor switchToPerspective = new RadioGroupFieldEditor(
            ITmfUIPreferences.SWITCH_TO_PERSPECTIVE,
            Messages.PerspectivesPreferencePage_SwitchToPerspectiveGroupText,
            3,
            new String[][] {
                { Messages.PerspectivesPreferencePage_SwitchToPerspectiveAlways, MessageDialogWithToggle.ALWAYS },
                { Messages.PerspectivesPreferencePage_SwitchToPerspectiveNever, MessageDialogWithToggle.NEVER },
                { Messages.PerspectivesPreferencePage_SwitchToPerspectivePrompt, MessageDialogWithToggle.PROMPT }},
            getFieldEditorParent(),
            true);
    addField(switchToPerspective);
}
 
Example #10
Source File: DartPreferencePage.java    From dartboard with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
	Composite parent = getFieldEditorParent();

	String[][] labelAndValues = new String[][] { { "Dart", "false" }, { "Flutter", "true" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

	flutterEnabledRadio = new RadioGroupFieldEditor(
			GlobalConstants.P_FLUTTER_ENABLED,
			Messages.Preference_PluginMode_Label, 2, labelAndValues, parent, true);
	addField(flutterEnabledRadio);

	// Dart SDK location text field/file browser
	dartSDKLocationEditor = new DartSDKLocationFieldEditor(GlobalConstants.P_SDK_LOCATION_DART,
			Messages.Preference_SDKLocation_Dart, parent);
	addField(dartSDKLocationEditor);
	dartSDKLocationEditor.setEnabled(!getPreferenceStore().getBoolean(GlobalConstants.P_FLUTTER_ENABLED));

	dartSDKLocationEditor.addModifyListener(event -> {
		setValid(dartSDKLocationEditor.doCheckState());
	});

	flutterSDKLocationFieldEditor = new FlutterSDKLocationFieldEditor(GlobalConstants.P_SDK_LOCATION_FLUTTER,
			Messages.Preference_SDKLocation_Flutter, parent);
	addField(flutterSDKLocationFieldEditor);
	flutterSDKLocationFieldEditor.setEnabled(getPreferenceStore().getBoolean(GlobalConstants.P_FLUTTER_ENABLED));

	flutterSDKLocationFieldEditor.addModifyListener(event -> {
		setValid(flutterSDKLocationFieldEditor.doCheckState());
	});

	BooleanFieldEditor autoPubSyncEditor = new BooleanFieldEditor(GlobalConstants.P_SYNC_PUB,
			Messages.Preference_PubAutoSync_Label, parent);
	addField(autoPubSyncEditor);
	BooleanFieldEditor useOfflinePub = new BooleanFieldEditor(GlobalConstants.P_OFFLINE_PUB,
			Messages.Preference_PubOffline_Label, parent);
	addField(useOfflinePub);

}
 
Example #11
Source File: UserSettings2.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void createFieldEditors(){
	addField(new RadioGroupFieldEditor(USERSETTINGS2_EXPANDABLE_COMPOSITES,
		Messages.UserSettings2_ExtendableFields, 1, new String[][] {
			{
				ALWAYS_OPEN, USERSETTINGS2_EXPANDABLECOMPOSITE_STATE_OPEN
			}, {
				ALWAYS_CLOSED, USERSETTINGS2_EXPANDABLECOMPOSITE_STATE_CLOSED
			}, {
				REMEMBER_LAST_STATE, USERSETTINGS2_EXPANDABLECOMPOSITE_STATE_REMEMBER_STATE
			}
		
		}, getFieldEditorParent()));
	new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(SWTHelper
		.getFillGridData(2, true, 1, false));
	new Label(getFieldEditorParent(), SWT.NONE).setText(Messages.UserSettings2_FieldsInList);
	addField(new BooleanFieldEditor(Preferences.USR_PATLIST_SHOWPATNR,
		Messages.UserSettings2_PatientNr, getFieldEditorParent()));
	addField(new BooleanFieldEditor(Preferences.USR_PATLIST_SHOWNAME,
		Messages.UserSettings2_PatientName, getFieldEditorParent()));
	addField(new BooleanFieldEditor(Preferences.USR_PATLIST_SHOWFIRSTNAME,
		Messages.UserSettings2_PatientFirstname, getFieldEditorParent()));
	addField(new BooleanFieldEditor(Preferences.USR_PATLIST_SHOWDOB,
		Messages.UserSettings2_Birthdate, getFieldEditorParent()));
	addField(new ComboFieldEditor(Preferences.USR_PATLIST_FOCUSFIELD, "Fokusfeld",
		patlistFocusFields, getFieldEditorParent()));
	new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(SWTHelper
		.getFillGridData(2, true, 1, false));
	new Label(getFieldEditorParent(), SWT.NONE)
		.setText(Messages.UserSettings2_AddidtionalFields);
	addField(new MultilineFieldEditor(Patientenblatt2.CFG_EXTRAFIELDS, StringTool.leer, 5,
		SWT.NONE, true, getFieldEditorParent()));
	
}
 
Example #12
Source File: DocstringsPrefPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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 p = getFieldEditorParent();

    Composite p2 = new Composite(p, 0);
    p2.setLayout(new RowLayout());

    RadioGroupFieldEditor docstringCharEditor = new RadioGroupFieldEditor(P_DOCSTRINGCHARACTER,
            "Docstring character", 1,
            new String[][] { { "Quotation mark (\")", "\"" }, { "Apostrophe (')", "'" } }, p2, true);
    addField(docstringCharEditor);

    RadioGroupFieldEditor docstringStyleEditor = new RadioGroupFieldEditor(P_DOCSTRINGSTYLE, "Docstring style", 1,
            new String[][] { { "Sphinx (:tag name:)", DOCSTRINGSTYLE_SPHINX },
                    { "EpyDoc (@tag name:)", DOCSTRINGSTYLE_EPYDOC },
                    { "Google (name:)", DOCSTRINGSTYLE_GOOGLE }
            },
            p2, true);
    addField(docstringStyleEditor);

    Group typeDoctagGroup = new Group(p2, 0);
    typeDoctagGroup.setText("Type doctag generation (@type x:...)");
    typeDoctagEditor = new RadioGroupFieldEditor(P_TYPETAGGENERATION, "", 1, new String[][] {
            { "&Always", TYPETAG_GENERATION_ALWAYS }, { "&Never", TYPETAG_GENERATION_NEVER },
            { "&Custom", TYPETAG_GENERATION_CUSTOM } }, typeDoctagGroup);

    addField(typeDoctagEditor);
    addField(new ParameterNamePrefixListEditor(P_DONT_GENERATE_TYPETAGS, "Don't create for parameters with prefix",
            typeDoctagGroup));
}
 
Example #13
Source File: MendeleyPreferencePage.java    From slr-toolkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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() {
	// only a radiobutto is needed to remember the state of your mendeley login
	addField(new RadioGroupFieldEditor(PreferenceConstants.P_MENDELEY, 
			"Activate Mendeley Integration", 
			1, 
			new String[][]{{"&No", "mendeley_off"}, {"&Yes", "mendeley_on"}
			}, getFieldEditorParent()));
	{
		Composite composite = getFieldEditorParent();
		
	}
	
}
 
Example #14
Source File: LabelPreferencesPage.java    From depan with Apache License 2.0 5 votes vote down vote up
@Override
protected void createFieldEditors() {
  Composite parent = getFieldEditorParent();

  // label positions.
  RadioGroupFieldEditor position = new RadioGroupFieldEditor(
      LabelPreferencesIds.LABEL_POSITION,
      "Label position", 3, new String[][] {
          // first line of 3 elements
          {"North-west", LabelPosition.NW.toString()},
          {"North", LabelPosition.N.toString()},
          {"North-east", LabelPosition.NE.toString()},
          // second line
          {"West", LabelPosition.W.toString()},
          {"Center", LabelPosition.CENTER.toString()},
          {"East", LabelPosition.E.toString()},
          // third line
          {"South-west", LabelPosition.SW.toString()},
          {"South", LabelPosition.S.toString()},
          {"South-east", LabelPosition.SE.toString()},
          // last line
          {"Inside, as node shape", LabelPosition.INSIDE.toString()},
          {"No labels", LabelPosition.NOLABEL.toString()},
          {"Only if selected", LabelPosition.IFSELECTED.toString()}
      },
      parent, true);

  addField(position);
}
 
Example #15
Source File: TmfTimestampFormatPage.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent event) {
    Object source = event.getSource();
    Object value = event.getNewValue();
    if (source instanceof RadioGroupFieldEditor && value instanceof String &&
            !(value.equals(fChangedProperty) && source.equals(fProperty)))
    {
        fProperty = ((RadioGroupFieldEditor) source).getPreferenceName();
        fChangedProperty = (String) value;
        refresh();
    }
}
 
Example #16
Source File: UpdateCheckerPreferencePage.java    From developer-studio with Apache License 2.0 4 votes vote down vote up
@Override
protected void createFieldEditors() {
	
	
	fieldEditorParent = getFieldEditorParent();
	boolean isSchedulingEnabled = false;
	addBlankSeparator(fieldEditorParent);
	setSeparator(fieldEditorParent);
	addField(new BooleanFieldEditor(PreferenceConstants.ENABLE_AUTOMATIC_UPDATES, "Check for updates Automatically",
			fieldEditorParent));
	setSeparator(fieldEditorParent);

	boolean isUpdatesEnabled = preferenceStore.getBoolean(PreferenceConstants.ENABLE_AUTOMATIC_UPDATES);

	enableDisableSet = new Composite(fieldEditorParent, SWT.LEFT);

	addBlankSeparator(enableDisableSet);
	updateSchedulingRadioBttn = new RadioGroupFieldEditor(PreferenceConstants.UPDATE_RUNNING_CONFIGURATION,
			"Automatic Updates Scheduling", 1,
			new String[][] { { PreferenceConstants.RUN_ON_STARTUP, PreferenceConstants.STARTUP },
					{ PreferenceConstants.SCHEDULE_UPDATER, PreferenceConstants.SCHEDULE } },
			enableDisableSet);
	addField(updateSchedulingRadioBttn);
	updateSchedulingRadioBttn.setEnabled(isUpdatesEnabled, enableDisableSet);

	if (preferenceStore.getString(PreferenceConstants.UPDATE_RUNNING_CONFIGURATION)
			.equals(PreferenceConstants.SCHEDULE)) {
		isSchedulingEnabled = true;
	}

	String[][] dayIntervals = { { PreferenceConstants.DAILY, PreferenceConstants.DAILY },
			{ PreferenceConstants.DEFAULT_SUNDAY, PreferenceConstants.DEFAULT_SUNDAY },
			{ PreferenceConstants.EVERY_MONDAY, PreferenceConstants.EVERY_MONDAY },
			{ PreferenceConstants.EVERY_TUESDAY, PreferenceConstants.EVERY_TUESDAY },
			{ PreferenceConstants.EVERY_WEDNESDAY, PreferenceConstants.EVERY_WEDNESDAY },
			{ PreferenceConstants.EVERY_THURSDAY, PreferenceConstants.EVERY_THURSDAY },
			{ PreferenceConstants.EVERY_FRIDAY, PreferenceConstants.EVERY_FRIDAY },
			{ PreferenceConstants.EVERY_SATURDAY, PreferenceConstants.EVERY_SATURDAY } };
	intervalDayEditor = new ComboFieldEditor(PreferenceConstants.UPDATE_DATE_INTERVAL, "Check for updates ",
			dayIntervals, enableDisableSet);
	addField(intervalDayEditor);
	intervalDayEditor.setEnabled(isUpdatesEnabled && isSchedulingEnabled, enableDisableSet);

	String[][] timeIntervals = { { PreferenceConstants.MIDNIGHT, PreferenceConstants.MIDNIGHT },
			{ PreferenceConstants.ONEAM, PreferenceConstants.ONEAM },
			{ PreferenceConstants.TWOAM, PreferenceConstants.TWOAM },
			{ PreferenceConstants.THREEAM, PreferenceConstants.THREEAM },
			{ PreferenceConstants.FOURAM, PreferenceConstants.FOURAM },
			{ PreferenceConstants.FIVEAM, PreferenceConstants.FIVEAM },
			{ PreferenceConstants.SIXAM, PreferenceConstants.SIXAM },
			{ PreferenceConstants.SEVENAM, PreferenceConstants.SEVENAM },
			{ PreferenceConstants.DEFAULT_EIGHT_AM, PreferenceConstants.NINEAM },
			{ PreferenceConstants.TENAM, PreferenceConstants.TENAM },
			{ PreferenceConstants.ELEVENAM, PreferenceConstants.ELEVENAM },
			{ PreferenceConstants.TWELEVENOON, PreferenceConstants.TWELEVENOON },
			{ PreferenceConstants.ONEPM, PreferenceConstants.ONEPM },
			{ PreferenceConstants.TWOPM, PreferenceConstants.TWOPM },
			{ PreferenceConstants.THREEPM, PreferenceConstants.THREEPM },
			{ PreferenceConstants.FOURPM, PreferenceConstants.FOURPM },
			{ PreferenceConstants.FIVEPM, PreferenceConstants.FIVEPM },
			{ PreferenceConstants.SIXPM, PreferenceConstants.SIXPM },
			{ PreferenceConstants.SIXPM, PreferenceConstants.SIXPM },
			{ PreferenceConstants.SEVENPM, PreferenceConstants.SEVENPM },
			{ PreferenceConstants.EIGHTPM, PreferenceConstants.EIGHTPM },
			{ PreferenceConstants.NINEPM, PreferenceConstants.NINEPM },
			{ PreferenceConstants.TENPM, PreferenceConstants.TENPM },
			{ PreferenceConstants.ELEVENPM, PreferenceConstants.ELEVENPM } };
	intervalTimeEditor = new ComboFieldEditor(PreferenceConstants.UPDATE_TIME_INTERVAL, "at", timeIntervals,
			enableDisableSet);
	addField(intervalTimeEditor);
	intervalTimeEditor.setEnabled(isUpdatesEnabled && isSchedulingEnabled, enableDisableSet);

	setSeparator(enableDisableSet);
	addBlankSeparator(enableDisableSet);
	updateInstallationRadioBttn = new RadioGroupFieldEditor(PreferenceConstants.UPDATE_NOTIFICATION_CONFIGURATION,
			"Specify Installation Preference", 1,
			new String[][] { { PreferenceConstants.NOTIFY_ME_IF_UPDATES_AVAILABLE, PreferenceConstants.NOTIFY_ME },
					{ PreferenceConstants.DOWNLOAD_UPDATES, PreferenceConstants.INSTALL_AUTOMATICALLY } },
			enableDisableSet);
	addField(updateInstallationRadioBttn);
	updateInstallationRadioBttn.setEnabled(isUpdatesEnabled, enableDisableSet);

	setSeparator(enableDisableSet);
	addBlankSeparator(enableDisableSet);
	updateSiteURL = new StringFieldEditor(PreferenceConstants.UPDATE_SITE_URL, "Update site:", enableDisableSet);
	releaseSiteURL = new StringFieldEditor(PreferenceConstants.RELESE_SITE_URL, "Release site:", enableDisableSet);
	updateSiteURL.setEnabled(isUpdatesEnabled, enableDisableSet);
	releaseSiteURL.setEnabled(isUpdatesEnabled, enableDisableSet);
	addField(updateSiteURL);
	addField(releaseSiteURL);

	setSeparator(fieldEditorParent);

}
 
Example #17
Source File: FieldAssistPreferencePage.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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
 * 
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 */
protected void createFieldEditors( )
{
	addField( new BooleanFieldEditor( PreferenceConstants.PREF_SHOWREQUIREDFIELDLABELINDICATOR,
			Messages.getString( "ssPreferencesShowRequiredFieldLabelIndicator" ), //$NON-NLS-1$
			getFieldEditorParent( ) ) );

	Group g = new Group( getFieldEditorParent( ), SWT.NONE );
	g.setText( Messages.getString( "ssPreferencesAssistSymbol" ) ); //$NON-NLS-1$
	GridData gd = new GridData( GridData.FILL_HORIZONTAL );
	g.setLayoutData( gd );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION,
			Messages.getString( "ssPreferencesDecoratorVert" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesDecoratorTop" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_TOP
					},
					{
							Messages.getString( "ssPreferencesDecoratorCenter" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_CENTER
					},
					{
							Messages.getString( "ssPreferencesDecoratorBottom" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_VERTICALLOCATION_BOTTOM
					}
			},
			g ) );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION,
			Messages.getString( "ssPreferencesDecoratorHorz" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesDecoratorLeft" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION_LEFT
					},
					{
							Messages.getString( "ssPreferencesDecoratorRight" ), //$NON-NLS-1$
							PreferenceConstants.PREF_DECORATOR_HORIZONTALLOCATION_RIGHT
					}
			},
			g ) );

	IntegerFieldEditor editor = new IntegerFieldEditor( PreferenceConstants.PREF_DECORATOR_MARGINWIDTH,
			Messages.getString( "ssPreferencesDecoratorMargin" ), //$NON-NLS-1$
			g );
	editor.setValidRange( 0, 10 );
	addField( editor );

	g.setLayout( new GridLayout( ) );

	Dialog.applyDialogFont( getFieldEditorParent( ) );
}
 
Example #18
Source File: ContentAssistPreferencePage.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * 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
 * 
	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 */
protected void createFieldEditors( )
{
	CustomKeyRadioGroupFieldEditor rgfe = new CustomKeyRadioGroupFieldEditor( PreferenceConstants.PREF_CONTENTASSISTKEY,
			PreferenceConstants.PREF_CONTENTASSISTKEYCUSTOMKEY,
			Messages.getString( "ssPreferencesContentAssistKey" ), //$NON-NLS-1$
			new String[][]{
					{
							Messages.getString( "ssPreferencesContentAssistKeyCtlSpace" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTKEY1
					},
					{
							Messages.getString( "ssPreferencesContentAssistKeyAsterisk" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTKEY2
					},
					{
							Messages.getString( "ssPreferencesContentAssistKeyAnyKey" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTKEYAUTO
					},
					{
							Messages.getString( "ssPreferencesContentAssistKeyCustom" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTKEYCUSTOM
					}
			},
			getFieldEditorParent( ) );
	addField( rgfe );

	IntegerFieldEditor editor = new IntegerFieldEditor( PreferenceConstants.PREF_CONTENTASSISTDELAY,
			Messages.getString( "ssPreferencesContentAssistDelay" ), //$NON-NLS-1$
			getFieldEditorParent( ) );
	editor.setValidRange( 0, 10000 );
	addField( editor );

	addField( new BooleanFieldEditor( PreferenceConstants.PREF_CONTENTASSISTKEY_PROPAGATE,
			Messages.getString( "ssPreferencesContentAssistKeyPropagate" ), //$NON-NLS-1$
			getFieldEditorParent( ) ) );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_CONTENTASSISTRESULT,
			Messages.getString( "ssPreferencesContentAssistResult" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesContentAssistResultReplace" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTRESULT_REPLACE
					},
					{
							Messages.getString( "ssPreferencesContentAssistResultInsert" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTRESULT_INSERT
					}
			},
			getFieldEditorParent( ) ) );

	addField( new RadioGroupFieldEditor( PreferenceConstants.PREF_CONTENTASSISTFILTER,
			Messages.getString( "ssPreferencesContentAssistFilter" ), //$NON-NLS-1$
			1,
			new String[][]{
					{
							Messages.getString( "ssPreferencesContentAssistFilterCharacter" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTFILTER_CHAR
					},
					{
							Messages.getString( "ssPreferencesContentAssistFilterCumulative" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTFILTER_CUMULATIVE
					},
					{
							Messages.getString( "ssPreferencesContentAssistFilterNone" ), //$NON-NLS-1$
							PreferenceConstants.PREF_CONTENTASSISTFILTER_NONE
					}
			},
			getFieldEditorParent( ) ) );

}
 
Example #19
Source File: TexEditorPreferencePage.java    From texlipse with Eclipse Public License 1.0 4 votes vote down vote up
/**
    * 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() {
       
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_COMPLETION, TexlipsePlugin.getResourceString("preferenceTexCompletion"), getFieldEditorParent()));
       String completionMessage = TexlipsePlugin.getResourceString("preferenceTexCompletionDelay").replaceFirst("%1", "" + MIN_COMPLETION_DELAY).replaceFirst("%2", "" + MAX_COMPLETION_DELAY);
       IntegerFieldEditor completionDelay = new IntegerFieldEditor(TexlipseProperties.TEX_COMPLETION_DELAY, completionMessage, getFieldEditorParent());
       completionDelay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       completionDelay.setValidRange(MIN_COMPLETION_DELAY, MAX_COMPLETION_DELAY);
       addField(completionDelay);
       //TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       
       // auto \item completion
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_ITEM_COMPLETION,
               TexlipsePlugin.getResourceString("preferenceTexItemCompletion"),
               getFieldEditorParent()));
       Label itemLabel = new Label(getFieldEditorParent(), SWT.LEFT | SWT.WRAP);
       itemLabel.setText(TexlipsePlugin.getResourceString("preferenceTexItemCompletionText"));        
       //TexlipsePreferencePage.addSpacer(getFieldEditorParent());
               
       // auto parsing
       addField(new BooleanFieldEditor(TexlipseProperties.AUTO_PARSING,
               TexlipsePlugin.getResourceString("preferenceAutoParsing"),
               getFieldEditorParent()));
       String autoParsingMessage = TexlipsePlugin.getResourceString(
               "preferenceAutoParsingDelay").replaceFirst("%1",
               "" + MIN_AUTO_DELAY).replaceFirst("%2", "" + MAX_AUTO_DELAY);
       IntegerFieldEditor autoDelay = new IntegerFieldEditor(TexlipseProperties.AUTO_PARSING_DELAY,
               autoParsingMessage, getFieldEditorParent());
       autoDelay.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       autoDelay.setValidRange(MIN_AUTO_DELAY, MAX_AUTO_DELAY);
       addField(autoDelay);
       
       // Check for missing sections
       addField(new BooleanFieldEditor(TexlipseProperties.SECTION_CHECK,
               TexlipsePlugin.getResourceString("preferenceSectionCheck"),
               getFieldEditorParent()));

       // Mark occurences (references and environments)
       addField(new BooleanFieldEditor(TexlipseProperties.TEX_EDITOR_ANNOTATATIONS,
               TexlipsePlugin.getResourceString("preferencesEditorHighlighting"),
               getFieldEditorParent()));
       
       TexlipsePreferencePage.addSpacer(getFieldEditorParent());
       
       // word wrapping
       Group group = new Group(getFieldEditorParent(), SWT.NONE);
       group.setText(TexlipsePlugin.getResourceString("preferenceWrapping"));
       group.setLayout(new GridLayout());
       GridData layData = new GridData(GridData.FILL_HORIZONTAL);
       layData.horizontalSpan = 2;
       group.setLayoutData(layData);
       
       Composite wordWrapParent = getFieldEditorParent(group);

       // default on/off wrapping
       addField(new BooleanFieldEditor(TexlipseProperties.WORDWRAP_DEFAULT, TexlipsePlugin.getResourceString("preferenceWrappingDefault"), wordWrapParent));
       TexlipsePreferencePage.addSpacer(wordWrapParent);
       
       String message = TexlipsePlugin.getResourceString("preferenceWrapLineLength").replaceFirst("%1", ""+MIN_WRAP_LENGTH).replaceFirst("%2", ""+MAX_WRAP_LENGTH);
       IntegerFieldEditor wordWrapLength = new IntegerFieldEditor(TexlipseProperties.WORDWRAP_LENGTH, message, wordWrapParent);
       wordWrapLength.setValidateStrategy(IntegerFieldEditor.VALIDATE_ON_KEY_STROKE);
       wordWrapLength.setValidRange(MIN_WRAP_LENGTH, MAX_WRAP_LENGTH);
       addField(wordWrapLength);
       
       IWorkbenchHelpSystem helpsystem = workbench.getHelpSystem();
       helpsystem.setHelp(wordWrapLength.getTextControl(wordWrapParent), TexlipseHelpIds.WRAP_LENGTH);
       
       //WorkbenchHelp.setHelp(wordWrapLength.getTextControl(wordWrapParent), TexlipseHelpIds.WRAP_LENGTH);
       
       TexlipsePreferencePage.addSpacer(wordWrapParent);
       Label label = new Label(wordWrapParent, SWT.LEFT | SWT.WRAP);
       label.setText(TexlipsePlugin.getResourceString("preferenceWrapSoftWarning"));
       GridData lgl = new GridData(GridData.FILL_HORIZONTAL);
       lgl.horizontalSpan = 2;
       label.setLayoutData(lgl);
       addField(new RadioGroupFieldEditor(TexlipseProperties.WORDWRAP_TYPE, TexlipsePlugin.getResourceString("preferenceWrapType"), 1, 
                                          new String[][] {//{ TexlipsePlugin.getResourceString("preferenceWrapNoneLabel"), TexlipseProperties.WORDWRAP_TYPE_NONE },
                                                          { TexlipsePlugin.getResourceString("preferenceWrapSoftLabel"), TexlipseProperties.WORDWRAP_TYPE_SOFT }, 
                                                          { TexlipsePlugin.getResourceString("preferenceWrapHardLabel"), TexlipseProperties.WORDWRAP_TYPE_HARD }},
                                                          getFieldEditorParent(group)));
   }
 
Example #20
Source File: KbdMacroPreferencePage.java    From e4macs with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 */
@Override
protected void createFieldEditors() {
	Composite parent = getFieldEditorParent();
	addField(
		new LabelFieldEditor(
			EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroDir"),  											 //$NON-NLS-1$
			parent));
	
	parent = getFieldEditorParent();
	directoryEditor = new DirectoryFieldEditor(
			EmacsPlusPreferenceConstants.P_KBD_MACRO_DIRECTORY,
			EmacsPlusUtils.EMPTY_STR,
			parent);
	addField(directoryEditor);
	addSpace();
	
	parent = getFieldEditorParent();
	radioEditor = new RadioGroupFieldEditor(EmacsPlusPreferenceConstants.P_KBD_MACRO_AUTO_LOAD,
			EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroLoad"), 1, new String[][] { 						 //$NON-NLS-1 
					{ EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroAll"), LoadState.ALL.toString() },		 //$NON-NLS-1 
					{ EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroNone"), LoadState.NONE.toString() },  	 //$NON-NLS-1 
					{ EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroSelected"), LoadState.SOME.toString() } }, //$NON-NLS-1 
					parent, true);
	addField(radioEditor);
	
	parent = getFieldEditorParent();
	loadParent = parent;
	loadButton = new ButtonFieldEditor(loadParent, EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroLoadButton"), //$NON-NLS-1$
			new SelectionAdapter() {
               public void widgetSelected(SelectionEvent evt) {
               	// save the current state
               	KbdMacroPreferencePage.this.performApply();
               	// load the kbd macros
               	KbdMacroSupport.getInstance().autoLoadMacros();
               }
           });
	addField(loadButton);
	
	parent = getFieldEditorParent();
	someListParent = parent;
	someListEditor = new KbdMacroListEditor(
			EmacsPlusPreferenceConstants.P_KBD_MACRO_NAME_LOAD,
			EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroLoadName"), 										 //$NON-NLS-1$
			EmacsPlusActivator.getString("EmacsPlusPref_KbdMacroAddTitle"), 										 //$NON-NLS-1$
			someListParent, directoryEditor);
	addField(someListEditor);
	
	// enable/disable the list editor based on the auto load state preference
	String currentValue = (getPreferenceStore().getString(EmacsPlusPreferenceConstants.P_KBD_MACRO_AUTO_LOAD)); 
	setSomeListEnabled(currentValue);
	setLoadButtonEnabled(currentValue);
}
 
Example #21
Source File: TmfTimestampFormatPage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {

    // Overall preference page layout
    GridLayout gl = new GridLayout();
    gl.marginHeight = 0;
    gl.marginWidth = 0;
    parent.setLayout(gl);
    fPage = new Composite(parent, SWT.NONE);
    fPage.setLayout(new GridLayout());
    fPage.setLayoutData(new GridData(
            GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL));

    // Example section
    fExampleSection = new Composite(fPage, SWT.NONE);
    fExampleSection.setLayout(new GridLayout(2, false));
    fExampleSection.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label patternLabel = new Label(fExampleSection, SWT.HORIZONTAL);
    patternLabel.setText("Current Format: "); //$NON-NLS-1$
    fPatternDisplay = new Text(fExampleSection, SWT.BORDER | SWT.READ_ONLY);
    fPatternDisplay.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label exampleLabel = new Label(fExampleSection, SWT.NONE);
    exampleLabel.setText("Sample Display: "); //$NON-NLS-1$
    fExampleDisplay = new Text(fExampleSection, SWT.BORDER | SWT.READ_ONLY);
    fExampleDisplay.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label separator = new Label(fPage, SWT.SEPARATOR | SWT.HORIZONTAL | SWT.SHADOW_NONE);
    separator.setLayoutData(
            new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));

    // Time Zones
    String[][] timeZoneIntervals = new String[timeZones.length][2];
    timeZoneIntervals[0][0] = timeZones[0];
    timeZoneIntervals[0][1] = fPreferenceStore.getDefaultString(ITmfTimePreferencesConstants.TIME_ZONE);
    for (int i = 1; i < timeZones.length; i++) {
        TimeZone tz = null;
        try {
            tz = TimeZone.getTimeZone(timeZones[i]);
            timeZoneIntervals[i][0] = tz.getDisplayName();
            timeZoneIntervals[i][1] = tz.getID();
        } catch (NullPointerException e) {
            Activator.getDefault().logError("TimeZone " + timeZones[i] + " does not exist.", e); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }

    fCombo = new ComboFieldEditor(ITmfTimePreferencesConstants.TIME_ZONE, "Time Zone", timeZoneIntervals, fPage); //$NON-NLS-1$
    fCombo.setPreferenceStore(fPreferenceStore);
    fCombo.load();
    fCombo.setPropertyChangeListener(this);

    // Date and Time section
    fDateTimeFields = new RadioGroupFieldEditor(
            ITmfTimePreferencesConstants.DATIME, "Date and Time format", 3, fDateTimeFormats, fPage, true); //$NON-NLS-1$
    fDateTimeFields.setPreferenceStore(fPreferenceStore);
    fDateTimeFields.load();
    fDateTimeFields.setPropertyChangeListener(this);

    // Sub-second section
    fSSecFields = new RadioGroupFieldEditor(
            ITmfTimePreferencesConstants.SUBSEC, "Sub-second format", 3, fSubSecondFormats, fPage, true); //$NON-NLS-1$
    fSSecFields.setPreferenceStore(fPreferenceStore);
    fSSecFields.load();
    fSSecFields.setPropertyChangeListener(this);

    // Separators section
    fDateFieldDelim = new RadioGroupFieldEditor(
            ITmfTimePreferencesConstants.DATE_DELIMITER, "Date delimiter", 5, fDateTimeDelimiters, fPage, true); //$NON-NLS-1$
    fDateFieldDelim.setPreferenceStore(fPreferenceStore);
    fDateFieldDelim.load();
    fDateFieldDelim.setPropertyChangeListener(this);

    fTimeFieldDelim = new RadioGroupFieldEditor(
            ITmfTimePreferencesConstants.TIME_DELIMITER, "Time delimiter", 5, fDateTimeDelimiters, fPage, true); //$NON-NLS-1$
    fTimeFieldDelim.setPreferenceStore(fPreferenceStore);
    fTimeFieldDelim.load();
    fTimeFieldDelim.setPropertyChangeListener(this);

    fSSecFieldDelim = new RadioGroupFieldEditor(
            ITmfTimePreferencesConstants.SSEC_DELIMITER, "Sub-Second Delimiter", 5, fSubSecondDelimiters, fPage, true); //$NON-NLS-1$
    fSSecFieldDelim.setPreferenceStore(fPreferenceStore);
    fSSecFieldDelim.load();
    fSSecFieldDelim.setPropertyChangeListener(this);

    refresh();
    return fPage;
}
 
Example #22
Source File: LabSettings.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void createFieldEditors(){
	addField(new BooleanFieldEditor(Preferences.LABSETTINGS_CFG_SHOW_MANDANT_ORDERS_ONLY,
		Messages.LabSettings_showOrdersActiveMandant, getFieldEditorParent()));
	
	addField(new RadioGroupFieldEditor(Preferences.LABSETTINGS_CFG_LABNEW_HEARTRATE,
		Messages.LabSettings_frequencyNewLabvalues, 3, new String[][] {
			{
				Messages.LabSettings_normal, "1" //$NON-NLS-1$
			}, {
				Messages.LabSettings_medium, "2" //$NON-NLS-1$
			}, {
				Messages.LabSettings_slow, "3" //$NON-NLS-1$
			}
		}, getFieldEditorParent()));
		
	addField(new BooleanFieldEditor(Preferences.LABSETTINGS_CFG_LOCAL_REFVALUES,
		Messages.LabSettings_useLocalLabRefValues, getFieldEditorParent()));
	
	Composite area = new Composite(getFieldEditorParent(), SWT.NONE);
	area.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	area.setLayout(new GridLayout(2, false));
	Label lblKeepUnseen = new Label(area, SWT.NONE);
	lblKeepUnseen.setText(Messages.LabSettings_showNewLabvaluesDays);
	txtKeepUnseen = new Text(area, SWT.BORDER);
	txtKeepUnseen.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
	txtKeepUnseen.setText(daysKeepUnseen);
	
	Button btnValidateMappings = new Button(area, SWT.PUSH);
	btnValidateMappings.setText(Messages.LabSettings_validateMappings);
	btnValidateMappings.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e){
			Query<LabMapping> query = new Query<LabMapping>(LabMapping.class);
			query.add(LabMapping.FLD_ID, Query.NOT_EQUAL, LabMapping.VERSIONID); //$NON-NLS-1$
			List<LabMapping> mappings = query.execute();
			int countDeleted = 0;
			for (LabMapping labMapping : mappings) {
				if (!labMapping.isMappingValid()) {
					countDeleted++;
					labMapping.delete();
				}
			}
			MessageDialog.openInformation(getShell(), Messages.LabSettings_validateMappings,
				MessageFormat.format(Messages.LabSettings_validateMappingsResult,
					countDeleted));
		}
	});
	// dummy lbl
	new Label(area, SWT.NONE);
}
 
Example #23
Source File: ControlPreferencePage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected void createFieldEditors() {

    StringFieldEditor tracingGroup = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, Messages.TraceControl_TracingGroupPreference, getFieldEditorParent());
    addField(tracingGroup);

    BooleanFieldEditor logCommand = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, Messages.TraceControl_LoggingPreference, getFieldEditorParent());
    addField(logCommand);

    StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent());
    addField(logfile);

    fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent());
    addField(fIsAppend);

    fVerboseLevel = new RadioGroupFieldEditor (
            ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF,
            Messages.TraceControl_VerboseLevelsPreference,
            4,
            new String[][] {
                {
                    Messages.TraceControl_VerboseLevelNonePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE,
                },
                {
                    Messages.TraceControl_VerboseLevelVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE
                },
                {
                    Messages.TraceControl_VerboseLevelVeryVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE
                },
                {
                    Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference,
                    ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE
                }
            },
            getFieldEditorParent(),
            true);

    addField(fVerboseLevel);

    Boolean enabled = ControlPreferences.getInstance().isLoggingEnabled();
    fVerboseLevel.setEnabled(enabled, getFieldEditorParent());
    fIsAppend.setEnabled(enabled, getFieldEditorParent());
    logfile.setEnabled(false, getFieldEditorParent());

}
 
Example #24
Source File: BonitaAppearancePreferencePage.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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() {

    createTitleBar(Messages.BonitaPreferenceDialog_appearance, Pics.getImage(PicsConstants.preferenceAppearance), false);

    final Label coolBarLabel = new Label(getFieldEditorParent(), SWT.NONE);
    coolBarLabel.setText(Messages.defaultCoolbarAppearance);

    final Composite radioComposite = new Composite(getFieldEditorParent(), SWT.NONE);
    radioComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    radioFiled = new RadioGroupFieldEditor(BonitaCoolBarPreferenceConstant.COOLBAR_DEFAULT_SIZE, "", 3, new String[][] {
            { Messages.normal, BonitaCoolBarPreferenceConstant.NORMAL },
            { Messages.small, BonitaCoolBarPreferenceConstant.SMALL } }, radioComposite);

    radioComposite.setLayout(new GridLayout(3, false));
    radioFiled.getLabelControl(radioComposite).dispose();
    radioFiled.getRadioBoxControl(radioComposite).setLayoutData(GridDataFactory.fillDefaults().create());

    addField(radioFiled);

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    final Label separator = new Label(getFieldEditorParent(), SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());

    new Label(getFieldEditorParent(), SWT.NONE);
    new Label(getFieldEditorParent(), SWT.NONE);

    createPreferenceEditorContributions(APPEARANCE_CONTRIBUTOR_ID);

}