@@ -0,0 +1,3282 @@
+/* ******************************************************************************%0A * Copyright (c) 2014 - 2016 Fabian Prasser.%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A * %0A * Contributors:%0A * Fabian Prasser - initial API and implementation%0A * ****************************************************************************%0A */%0Apackage de.linearbits.examples;%0A%0Aimport de.linearbits.preferences.PreferenceBoolean;%0Aimport de.linearbits.preferences.PreferenceDouble;%0Aimport de.linearbits.preferences.PreferenceInteger;%0Aimport de.linearbits.preferences.PreferenceSelection;%0Aimport de.linearbits.preferences.PreferencesDialog;%0A%0A/**%0A * This class implements a dialog for editing project properties.%0A *%0A * @author Fabian Prasser%0A */%0Apublic class PreferencesExample %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        %0A        // Create dialog%0A        PreferencesDialog dialog = new PreferencesDialog(null, %22Example%22, %22Example%22);%0A        createTab(dialog);%0A        dialog.open();%0A    %7D%0A%0A    /**%0A     * Create a tab%0A     * @param window%0A     */%0A    private static void createTab(PreferencesDialog window) %7B%0A%0A        window.addCategory(%22Category%22); %0A        %0A        window.addGroup(%22Group1%22); %0A        %0A        window.addPreference(new PreferenceInteger(%22IntegerPreference%22, 1, 10, 10) %7B %0A            protected Integer getValue() %7B return 1; %7D%0A            protected void setValue(Object t) %7B /*(Integer)t)*/ %7D%0A        %7D);%0A        %0A        window.addPreference(new PreferenceSelection(%22SelectionPreference%22, new String%5B%5D%7B%22Option1%22, %22Option2%22%7D) %7B%0A            protected String getValue() %7B return %22Option1%22; %7D%0A            protected void setValue(Object arg0) %7B /*(String)arg0*/ %7D%0A        %7D);%0A%0A        window.addGroup(%22Group2%22);%0A%0A        window.addPreference(new PreferenceDouble(%22DoublePreference%22, 1.0e-12, 1d, 1.0e-6) %7B%0A            protected Double getValue() %7B return 1d; %7D%0A            protected void setValue(Object t) %7B /*(Double)t*/ %7D%0A        %7D);%0A%0A        window.addPreference(new PreferenceInteger(%22IntegerPreference%22, 1, 10, 10) %7B %0A            protected Integer getValue() %7B return 1; %7D%0A            protected void setValue(Object t) %7B /*(Integer)t)*/ %7D%0A        %7D);%0A        window.addPreference(new PreferenceInteger(%22IntegerPreference%22, 1, 10, 10) %7B %0A            protected Integer getValue() %7B return 1; %7D%0A            protected void setValue(Object t) %7B /*(Integer)t)*/ %7D%0A        %7D);%0A        %0A        window.addPreference(new PreferenceInteger(%22IntegerPreference%22, 1, 10, 10) %7B %0A            protected Integer getValue() %7B return 1; %7D%0A            protected void setValue(Object t) %7B /*(Integer)t)*/ %7D%0A        %7D);%0A        %0A        window.addPreference(new PreferenceInteger(%22IntegerPreference%22, 1, 10, 10) %7B %0A            protected Integer getValue() %7B return 1; %7D%0A            protected void setValue(Object t) %7B /*(Integer)t)*/ %7D%0A        %7D);%0A        %0A        window.addPreference(new PreferenceBoolean(%22BooleanPreference%22, false) %7B%0A            protected Boolean getValue() %7B return true; %7D%0A            protected void setValue(Object t) %7B /*(Boolean)t*/%7D%0A        %7D);%0A        %0A    %7D%0A%7D%0A

Add example