 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.prefs;
22 import java.awt.Component;
23 import java.awt.GridBagLayout;
24 import java.util.HashMap;
26 import java.util.Map.Entry;
27 import javax.swing.AbstractButton;
28 import javax.swing.Box;
29 import javax.swing.JCheckBox;
30 import javax.swing.JComponent;
31 import javax.swing.JPanel;
32 import javax.swing.border.Border;
33 import javax.swing.border.CompoundBorder;
34 import javax.swing.border.TitledBorder;
40 import net.
sf.japi.swing.action.ActionBuilder;
41 import net.
sf.japi.swing.action.ActionBuilderFactory;
42 import net.
sf.japi.swing.prefs.AbstractPrefs;
43 import org.jetbrains.annotations.NotNull;
61 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
78 private final Map<Validator<?, ?, ?>, JCheckBox>
checkBoxes =
new HashMap<>();
96 setListLabelIcon(
ACTION_BUILDER.getIcon(
"prefsMapValidator.icon"));
100 add(Box.createVerticalGlue());
115 entry.getKey().setEnabled(entry.getValue().isSelected());
123 entry.getValue().setSelected(entry.getKey().isEnabled());
131 entry.getValue().setSelected(entry.getKey().isDefaultEnabled());
139 if (entry.getValue().isSelected() != entry.getKey().isEnabled()) {
152 final JComponent panel =
new JPanel(
new GridBagLayout());
165 final JComponent panel =
new JPanel(
new GridBagLayout());
Helper class for preference panes.
Base package of all Gridarta classes.
Defines common UI constants used in different dialogs.
static final long serialVersionUID
The serial version UID.
Super-interface for validators.
Graphical User Interface of Gridarta.
final Map< Validator<?, ?, ?>, JCheckBox > checkBoxes
Checkboxes to enabled the individual validator checks.
Preferences Module for map validator preferences.
MapValidatorPreferences(@NotNull final DelegatingMapValidator<?, ?, ?> validators, final boolean autoDefault)
Creates a new instance.
This package contains the framework for validating maps.
Implements the auto-validator for map validation.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
Component createValidatorsPanel()
Creates the sub-panel with the validators information.
static void setEnabled(final boolean enabled)
Set whether the auto-validator is enabled.
final DelegatingMapValidator<?, ?, ?> validators
The delegating validator that contains all the validators.
static Border createTitledBorder(final String titleKey)
Creates a titled border.
static boolean isEnabled()
Returns whether the auto-validator is enabled.
Utility class for ActionBuilder related functions.
A Map Validator that delegates to other MapValidators.
Component createValidationPanel()
Creates the sub-panel with the generic validation settings.
static final ActionBuilder ACTION_BUILDER
Action Builder to create Actions.
final boolean autoDefault
Whether the auto-validator is enabled by default.
final AbstractButton autoValidate
Check box to set whether map files should be really checked.
Border DIALOG_BORDER
The Border object to be used when creating dialogs.
void addComponent(@NotNull final Component component)
Adds a component to the container.