Class DefaultTabPreferenceSetting
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
-
- All Implemented Interfaces:
PreferenceSetting
,TabPreferenceSetting
- Direct Known Subclasses:
AdvancedPreference
,AudioPreference
,BackupPreference
,DrawingPreference
,ExtensibleTabPreferenceSetting
,GPXPreference
,LanguagePreference
,MapPaintPreference
,ProjectionPreference
,ProxyPreference
,RemoteControlPreference
,ServerAccessPreference
,ShortcutPreference
,TaggingPresetPreference
,ToolbarPreferences.Settings
public abstract class DefaultTabPreferenceSetting extends DefaultPreferenceSetting implements TabPreferenceSetting
Abstract base class forTabPreferenceSetting
implementations. Support for common functionality, like icon, title and adding a tab (SubPreferenceSetting
).
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
description
private java.lang.String
iconName
private java.util.Map<SubPreferenceSetting,java.awt.Component>
subSettingMap
private javax.swing.JTabbedPane
tabpane
private java.lang.String
title
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultTabPreferenceSetting()
Constructs a newDefaultTabPreferenceSetting
.protected
DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description)
protected
DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description, boolean isExpert)
protected
DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description, boolean isExpert, javax.swing.JTabbedPane tabpane)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubTab(SubPreferenceSetting sub, java.lang.String title, java.awt.Component component)
Adds a new sub preference settings tab with the given title and component.void
addSubTab(SubPreferenceSetting sub, java.lang.String title, java.awt.Component component, java.lang.String tip)
Adds a new sub preference settings tab with the given title, component and tooltip.protected boolean
canBeHidden()
Determines whether this tab may be hidden (since it does not contain any relevant content)protected void
createPreferenceTabWithScrollPane(PreferenceTabbedPane gui, javax.swing.JPanel panel)
java.lang.String
getDescription()
Called during preferences tab initialization to display a description in one sentence for this tab.java.lang.String
getHelpContext()
Returns the help context for this preferences settings tab.java.lang.String
getIconName()
Called during preferences dialog initialization to display the preferences tab with the returned icon.java.lang.Class<? extends SubPreferenceSetting>
getSelectedSubTab()
Returns the currently selected sub preference settingjava.awt.Component
getSubTab(SubPreferenceSetting sub)
Returns the tab component related to the specified sub preference settingsjavax.swing.JTabbedPane
getTabPane()
Get the inner tab pane, if any.java.lang.String
getTitle()
Called during preferences tab initialization to display its title.java.lang.String
getTooltip()
Called during preferences dialog initialization to display the preferences tab with the returned tooltip.void
registerSubTab(SubPreferenceSetting sub, java.awt.Component component)
Registers a sub preference settings to an existing tab component.boolean
selectSubTab(SubPreferenceSetting subPref)
Selects the specified sub preference settings, if applicable.-
Methods inherited from class org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
isExpert, 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.PreferenceSetting
addGui, isExpert, ok
-
Methods inherited from interface org.openstreetmap.josm.gui.preferences.TabPreferenceSetting
getIcon
-
-
-
-
Field Detail
-
iconName
private final java.lang.String iconName
-
description
private final java.lang.String description
-
title
private final java.lang.String title
-
tabpane
private final javax.swing.JTabbedPane tabpane
-
subSettingMap
private final java.util.Map<SubPreferenceSetting,java.awt.Component> subSettingMap
-
-
Constructor Detail
-
DefaultTabPreferenceSetting
protected DefaultTabPreferenceSetting()
Constructs a newDefaultTabPreferenceSetting
.
-
DefaultTabPreferenceSetting
protected DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description)
-
DefaultTabPreferenceSetting
protected DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description, boolean isExpert)
-
DefaultTabPreferenceSetting
protected DefaultTabPreferenceSetting(java.lang.String iconName, java.lang.String title, java.lang.String description, boolean isExpert, javax.swing.JTabbedPane tabpane)
-
-
Method Detail
-
getIconName
public java.lang.String getIconName()
Description copied from interface:TabPreferenceSetting
Called during preferences dialog initialization to display the preferences tab with the returned icon.- Specified by:
getIconName
in interfaceTabPreferenceSetting
- Returns:
- The icon name in the preferences folder.
-
getTooltip
public java.lang.String getTooltip()
Description copied from interface:TabPreferenceSetting
Called during preferences dialog initialization to display the preferences tab with the returned tooltip.- Specified by:
getTooltip
in interfaceTabPreferenceSetting
- Returns:
- The tooltip of this preferences tab.
-
getDescription
public java.lang.String getDescription()
Description copied from interface:TabPreferenceSetting
Called during preferences tab initialization to display a description in one sentence for this tab. Will be displayed in italic under the title.- Specified by:
getDescription
in interfaceTabPreferenceSetting
- Returns:
- The description of this preferences tab.
-
getTitle
public java.lang.String getTitle()
Description copied from interface:TabPreferenceSetting
Called during preferences tab initialization to display its title.- Specified by:
getTitle
in interfaceTabPreferenceSetting
- Returns:
- The title of this preferences tab.
-
getTabPane
public final javax.swing.JTabbedPane getTabPane()
Get the inner tab pane, if any.- Returns:
- The JTabbedPane contained in this tab preference settings, or null if none is set.
- Since:
- 5631
-
createPreferenceTabWithScrollPane
protected final void createPreferenceTabWithScrollPane(PreferenceTabbedPane gui, javax.swing.JPanel panel)
-
selectSubTab
public boolean selectSubTab(SubPreferenceSetting subPref)
Description copied from interface:TabPreferenceSetting
Selects the specified sub preference settings, if applicable. Not all Tab preference settings need to implement this.- Specified by:
selectSubTab
in interfaceTabPreferenceSetting
- Parameters:
subPref
- The sub preference settings to be selected.- Returns:
- true if the specified preference settings have been selected, false otherwise.
-
addSubTab
public final void addSubTab(SubPreferenceSetting sub, java.lang.String title, java.awt.Component component)
Description copied from interface:TabPreferenceSetting
Adds a new sub preference settings tab with the given title and component.- Specified by:
addSubTab
in interfaceTabPreferenceSetting
- Parameters:
sub
- The new sub preference settings.title
- The tab title.component
- The tab component.
-
addSubTab
public final void addSubTab(SubPreferenceSetting sub, java.lang.String title, java.awt.Component component, java.lang.String tip)
Description copied from interface:TabPreferenceSetting
Adds a new sub preference settings tab with the given title, component and tooltip.- Specified by:
addSubTab
in interfaceTabPreferenceSetting
- Parameters:
sub
- The new sub preference settings.title
- The tab title.component
- The tab component.tip
- The tab tooltip.
-
registerSubTab
public final void registerSubTab(SubPreferenceSetting sub, java.awt.Component component)
Description copied from interface:TabPreferenceSetting
Registers a sub preference settings to an existing tab component.- Specified by:
registerSubTab
in interfaceTabPreferenceSetting
- Parameters:
sub
- The new sub preference settings.component
- The component for which a tab already exists.
-
getSubTab
public final java.awt.Component getSubTab(SubPreferenceSetting sub)
Description copied from interface:TabPreferenceSetting
Returns the tab component related to the specified sub preference settings- Specified by:
getSubTab
in interfaceTabPreferenceSetting
- Parameters:
sub
- The requested sub preference settings.- Returns:
- The component related to the specified sub preference settings, or null.
-
getSelectedSubTab
public java.lang.Class<? extends SubPreferenceSetting> getSelectedSubTab()
Description copied from interface:TabPreferenceSetting
Returns the currently selected sub preference setting- Specified by:
getSelectedSubTab
in interfaceTabPreferenceSetting
- Returns:
- the currently selected sub preference setting
-
canBeHidden
protected boolean canBeHidden()
Determines whether this tab may be hidden (since it does not contain any relevant content)- Returns:
- whether this tab may be hidden
-
getHelpContext
public java.lang.String getHelpContext()
Description copied from interface:TabPreferenceSetting
Returns the help context for this preferences settings tab.- Specified by:
getHelpContext
in interfaceTabPreferenceSetting
- Returns:
- the help context for this preferences settings tab
-
-