20 package net.sf.gridarta.gui.dialog.prefs;
22 import java.awt.Component;
23 import java.awt.GridBagLayout;
24 import java.util.prefs.Preferences;
25 import javax.swing.AbstractButton;
26 import javax.swing.Box;
27 import javax.swing.JCheckBox;
28 import javax.swing.JComponent;
29 import javax.swing.JPanel;
30 import javax.swing.border.Border;
31 import javax.swing.border.CompoundBorder;
32 import javax.swing.border.TitledBorder;
36 import net.
sf.japi.swing.action.ActionBuilder;
37 import net.
sf.japi.swing.action.ActionBuilderFactory;
38 import net.
sf.japi.swing.prefs.AbstractPrefs;
39 import org.jetbrains.annotations.NotNull;
68 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
87 setListLabelIcon(ACTION_BUILDER.getIcon(
"prefsDev.icon"));
90 add(Box.createVerticalGlue());
105 PREFERENCES.putBoolean(PREFERENCES_SYSTEM_EXIT, systemExit.isSelected());
110 systemExit.setSelected(PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT));
115 systemExit.setSelected(
true);
120 return !(systemExit.isSelected() == PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT));
129 final JComponent panel =
new JPanel(
new GridBagLayout());
133 systemExit =
new JCheckBox(ACTION_BUILDER.createAction(
false,
"optionsSystemExit"));
134 systemExit.setSelected(PREFERENCES.getBoolean(PREFERENCES_SYSTEM_EXIT, PREFERENCES_SYSTEM_EXIT_DEFAULT));
Graphical User Interface of Gridarta.
static final ActionBuilder ACTION_BUILDER
Action Builder.
AbstractButton systemExit
Use System.exit() for exiting the program.
void addComponent(@NotNull final Component component)
Adds a component to the container.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Base package of all Gridarta classes.
static final long serialVersionUID
The serial version UID.
DevPreferences()
Creates a new instance.
Interface used as preferences location.
static Border createTitledBorder(@NotNull final String titleKey)
Creates a titled border.
Preferences Module for developer preferences.
Helper class for preference panes.
Utility class for ActionBuilder related functions.
static final boolean PREFERENCES_SYSTEM_EXIT_DEFAULT
Preferences default value for using System.exit().
Border DIALOG_BORDER
The Border object to be used when creating dialogs.
static final String PREFERENCES_SYSTEM_EXIT
Preferences key for using System.exit().
Component createMiscPanel()
Creates the sub-panel with the misc settings.
static final Preferences PREFERENCES
Preferences.
Defines common UI constants used in different dialogs.