Class AdvancedPreference
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.advanced.AdvancedPreference
-
- All Implemented Interfaces:
PreferenceSetting
,TabPreferenceSetting
public final class AdvancedPreference extends DefaultTabPreferenceSetting
Advanced preferences, allowing to set preference entries directly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AdvancedPreference.EditBoundariesAction
RequiresLogging.isDebugEnabled()
, otherwise dataset is unloadedstatic class
AdvancedPreference.Factory
Factory used to create a newAdvancedPreference
.private class
AdvancedPreference.ImportProfileAction
private class
AdvancedPreference.ResetPreferencesAction
private static class
AdvancedPreference.UnclearableOsmDataLayer
-
Field Summary
Fields Modifier and Type Field Description private List<PrefEntry>
allData
private Comparator<PrefEntry>
customComparator
private List<PrefEntry>
displayData
private Map<String,String>
profileTypes
private PreferencesTable
table
private JosmTextField
txtFilter
-
Constructor Summary
Constructors Modifier Constructor Description private
AdvancedPreference()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.private void
applyFilter()
private static File[]
askUserForCustomSettingsFiles(boolean saveFileFlag, String title)
private JPopupMenu
buildPopupMenu()
private void
exportSelectedToXML()
String
getHelpContext()
Returns the help context for this preferences settings tab.private JMenu
getProfileMenu()
boolean
isExpert()
Called to know if the preferences tab has only to be displayed in expert mode.boolean
ok()
Called when OK is pressed to save the setting in the preferences file.private List<PrefEntry>
prepareData(Map<String,Setting<?>> loaded, Map<String,Setting<?>> orig, Map<String,Setting<?>> defaults)
private void
readPreferences(Preferences tmpPrefs)
private void
readPreferencesFromXML()
-
Methods inherited from class org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
addSubTab, addSubTab, canBeHidden, createPreferenceTabWithScrollPane, getDescription, getIconName, getSelectedSubTab, getSubTab, getTabPane, getTitle, getTooltip, registerSubTab, selectSubTab
-
Methods inherited from class org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
saveBoolean, saveDouble, saveInt
-
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.TabPreferenceSetting
getIcon
-
-
-
-
Field Detail
-
displayData
private final List<PrefEntry> displayData
-
txtFilter
private JosmTextField txtFilter
-
table
private PreferencesTable table
-
profileTypes
private final Map<String,String> profileTypes
-
customComparator
private final Comparator<PrefEntry> customComparator
-
-
Constructor Detail
-
AdvancedPreference
private AdvancedPreference()
-
-
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
- Overrides:
isExpert
in classDefaultPreferenceSetting
- Returns:
- true if the tab has only to be displayed in expert mode, false otherwise.
-
addGui
public void addGui(PreferenceTabbedPane gui)
Description copied from interface:PreferenceSetting
Add the GUI elements to the dialog. The elements should be initialized after the current preferences.- Parameters:
gui
- the preferences tab pane
-
readPreferences
private void readPreferences(Preferences tmpPrefs)
-
askUserForCustomSettingsFiles
private static File[] askUserForCustomSettingsFiles(boolean saveFileFlag, String title)
-
exportSelectedToXML
private void exportSelectedToXML()
-
readPreferencesFromXML
private void readPreferencesFromXML()
-
prepareData
private List<PrefEntry> prepareData(Map<String,Setting<?>> loaded, Map<String,Setting<?>> orig, Map<String,Setting<?>> defaults)
-
buildPopupMenu
private JPopupMenu buildPopupMenu()
-
getProfileMenu
private JMenu getProfileMenu()
-
applyFilter
private void applyFilter()
-
ok
public boolean ok()
Description copied from interface:PreferenceSetting
Called when OK is pressed to save the setting in the preferences file. Return true when restart is required.- Returns:
true
if restart is required
-
getHelpContext
public String getHelpContext()
Description copied from interface:TabPreferenceSetting
Returns the help context for this preferences settings tab.- Specified by:
getHelpContext
in interfaceTabPreferenceSetting
- Overrides:
getHelpContext
in classDefaultTabPreferenceSetting
- Returns:
- the help context for this preferences settings tab
-
-