Class DefaultPreferenceSetting
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
-
- All Implemented Interfaces:
PreferenceSetting
- Direct Known Subclasses:
DefaultTabPreferenceSetting
public abstract class DefaultPreferenceSetting extends java.lang.Object implements PreferenceSetting
Abstract base class forPreferenceSetting
implementations. Handles the flag that indicates if a PreferenceSetting is and expert option or not.- Since:
- 4968
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
isExpert
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultPreferenceSetting()
Constructs a new DefaultPreferenceSetting.protected
DefaultPreferenceSetting(boolean isExpert)
Constructs a new DefaultPreferenceSetting.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isExpert()
Called to know if the preferences tab has only to be displayed in expert mode.protected static void
saveBoolean(java.lang.String prefName, javax.swing.JCheckBox cb)
Saves state from aJCheckBox
to a boolean preference.protected static void
saveDouble(java.lang.String prefName, javax.swing.JTextField tf)
Saves text from aJTextField
to a double preference.protected static void
saveInt(java.lang.String prefName, javax.swing.JTextField tf)
Saves text from aJTextField
to an integer preference.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.preferences.PreferenceSetting
addGui, ok
-
-
-
-
Field Detail
-
isExpert
private final boolean isExpert
-
-
Constructor Detail
-
DefaultPreferenceSetting
protected DefaultPreferenceSetting()
Constructs a new DefaultPreferenceSetting. (Not an expert option by default.)
-
DefaultPreferenceSetting
protected DefaultPreferenceSetting(boolean isExpert)
Constructs a new DefaultPreferenceSetting.- Parameters:
isExpert
- true, if it is an expert option
-
-
Method Detail
-
isExpert
public boolean isExpert()
Description copied from interface:PreferenceSetting
Called to know if the preferences tab has only to be displayed in expert mode.- Specified by:
isExpert
in interfacePreferenceSetting
- Returns:
- true if the tab has only to be displayed in expert mode, false otherwise.
-
saveBoolean
protected static void saveBoolean(java.lang.String prefName, javax.swing.JCheckBox cb)
Saves state from aJCheckBox
to a boolean preference.- Parameters:
prefName
- preference namecb
- check box- Since:
- 13050
-
saveDouble
protected static void saveDouble(java.lang.String prefName, javax.swing.JTextField tf)
Saves text from aJTextField
to a double preference.- Parameters:
prefName
- preference nametf
- text field- Since:
- 13050
-
saveInt
protected static void saveInt(java.lang.String prefName, javax.swing.JTextField tf)
Saves text from aJTextField
to an integer preference.- Parameters:
prefName
- preference nametf
- text field- Since:
- 13050
-
-