20 package net.sf.gridarta.gui.dialog.prefs;
22 import java.awt.Component;
23 import java.awt.GridBagLayout;
25 import javax.swing.Box;
26 import javax.swing.JComponent;
27 import javax.swing.JFileChooser;
28 import javax.swing.JPanel;
29 import javax.swing.border.Border;
30 import javax.swing.border.CompoundBorder;
31 import javax.swing.border.TitledBorder;
35 import net.
sf.japi.swing.action.ActionBuilder;
36 import net.
sf.japi.swing.action.ActionBuilderFactory;
37 import net.
sf.japi.swing.prefs.AbstractPrefs;
38 import org.jetbrains.annotations.NotNull;
56 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
89 setListLabelIcon(ACTION_BUILDER.getIcon(
"prefsApp.icon"));
92 add(Box.createVerticalGlue());
137 final JComponent panel =
new JPanel(
new GridBagLayout());
141 serverField =
new JFileField(
this,
"optionsAppServer", null,
new File(appPreferencesModel.
getServer()), JFileChooser.FILES_ONLY);
144 clientField =
new JFileField(
this,
"optionsAppClient", null,
new File(appPreferencesModel.
getClient()), JFileChooser.FILES_ONLY);
147 editorField =
new JFileField(
this,
"optionsAppEditor", null,
new File(appPreferencesModel.
getEditor()), JFileChooser.FILES_ONLY);
String getClient()
Returns the client setting.
Graphical User Interface of Gridarta.
JFileField editorField
TextField for external editor executable.
A component for selecting files.
JFileField clientField
TextField for client executable.
static void setEditor(@NotNull final CharSequence editor)
Sets the editor setting.
static Border createTitledBorder(@NotNull final String titleKey)
Creates a titled border.
static final ActionBuilder ACTION_BUILDER
Action Builder.
Preferences Module for application preferences.
void addComponent(@NotNull final Component component)
Adds a component to the container.
Maintains the application preferences state.
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 void setClient(@NotNull final CharSequence client)
Sets the client setting.
String getClientDefault()
Returns the client setting's default value.
String getEditor()
Returns the editor setting.
JFileField serverField
TextField for server executable.
void setFile(@NotNull final File file)
Sets the currently selected file.
Helper class for preference panes.
String getEditorDefault()
Returns the editor setting's default value.
static void setServer(@NotNull final CharSequence server)
Sets the server setting.
AppPreferences(@NotNull final AppPreferencesModel appPreferencesModel)
Creates a new instance.
Utility class for ActionBuilder related functions.
final AppPreferencesModel appPreferencesModel
The model.
Border DIALOG_BORDER
The Border object to be used when creating dialogs.
Component createAppPanel()
Creates the sub-panel with the external applications.
static final long serialVersionUID
The serial version UID.
static JLabel newLabel(@NotNull final ActionBuilder actionBuilder, @NotNull final String key)
Creates a new JLabel from a resource key.
File getFile()
Returns the currently selected file.
String getServer()
Returns the server setting.
String getServerDefault()
Returns the server setting's default value.
Defines common UI constants used in different dialogs.