Class PluginPreference
- java.lang.Object
-
- org.openstreetmap.josm.gui.preferences.DefaultPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.ExtensibleTabPreferenceSetting
-
- org.openstreetmap.josm.gui.preferences.plugin.PluginPreference
-
- All Implemented Interfaces:
PreferenceSetting
,TabPreferenceSetting
public final class PluginPreference extends ExtensibleTabPreferenceSetting
Preference settings for plugins.- Since:
- 168
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
PluginPreference.ConfigureSitesAction
The action for configuring the plugin download sites(package private) class
PluginPreference.DownloadAvailablePluginsAction
The action for downloading the list of available pluginsstatic class
PluginPreference.Factory
Factory used to create a newPluginPreference
.private static class
PluginPreference.PluginConfigurationSitesPanel
(package private) class
PluginPreference.SelectByListAction
The action for selecting the plugins given by a text file compatible to JOSM bug report.(package private) class
PluginPreference.UpdateSelectedPluginsAction
The action for updating the list of selected plugins
-
Field Summary
Fields Modifier and Type Field Description private PluginPreferencesModel
model
private boolean
pluginPreferencesActivated
is set to true if this preference pane has been selected by the userprivate PluginListPanel
pnlPluginPreferences
private PluginUpdatePolicyPanel
pnlPluginUpdatePolicy
private JScrollPane
spPluginPreferences
-
Constructor Summary
Constructors Modifier Constructor Description private
PluginPreference()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Component
addButton(JPanel pnl, JButton button, String buttonName)
void
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.private void
addRadioButton(ButtonGroup bg, JPanel pnl, JRadioButton rb, PluginInstallation value)
private JPanel
buildActionPanel()
static String
buildDownloadSummary(PluginDownloadTask task)
Returns the download summary string to be shown.private JPanel
buildPluginListPanel()
private JPanel
buildSearchFieldPanel()
private void
configureSites()
String
getHelpContext()
Returns the help context for this preferences settings tab.List<PluginInformation>
getNewlyActivatedPlugins()
Replies the list of plugins which have been added by the user to the set of activated pluginsSet<PluginInformation>
getPluginsScheduledForUpdateOrDownload()
Replies the set of plugins waiting for update or downloadstatic void
notifyDownloadResults(Component parent, PluginDownloadTask task, boolean restartRequired)
Notifies user about result of a finished plugin download task.boolean
ok()
Called when OK is pressed to save the setting in the preferences file.void
readLocalPluginInformation()
Reads locally available information about plugins from the local file system.-
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
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
isExpert
-
Methods inherited from interface org.openstreetmap.josm.gui.preferences.TabPreferenceSetting
getIcon
-
-
-
-
Field Detail
-
pnlPluginPreferences
private PluginListPanel pnlPluginPreferences
-
model
private PluginPreferencesModel model
-
spPluginPreferences
private JScrollPane spPluginPreferences
-
pnlPluginUpdatePolicy
private PluginUpdatePolicyPanel pnlPluginUpdatePolicy
-
pluginPreferencesActivated
private boolean pluginPreferencesActivated
is set to true if this preference pane has been selected by the user
-
-
Constructor Detail
-
PluginPreference
private PluginPreference()
-
-
Method Detail
-
buildDownloadSummary
public static String buildDownloadSummary(PluginDownloadTask task)
Returns the download summary string to be shown.- Parameters:
task
- The plugin download task that has completed- Returns:
- the download summary string to be shown. Contains summary of success/failed plugins.
-
notifyDownloadResults
public static void notifyDownloadResults(Component parent, PluginDownloadTask task, boolean restartRequired)
Notifies user about result of a finished plugin download task.- Parameters:
parent
- The parent componenttask
- The finished plugin download taskrestartRequired
- true if a restart is required- Since:
- 6797
-
buildSearchFieldPanel
private JPanel buildSearchFieldPanel()
-
addRadioButton
private void addRadioButton(ButtonGroup bg, JPanel pnl, JRadioButton rb, PluginInstallation value)
-
buildActionPanel
private JPanel buildActionPanel()
-
buildPluginListPanel
private JPanel buildPluginListPanel()
-
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.- Specified by:
addGui
in interfacePreferenceSetting
- Overrides:
addGui
in classExtensibleTabPreferenceSetting
- Parameters:
gui
- the preferences tab pane
-
configureSites
private void configureSites()
-
getPluginsScheduledForUpdateOrDownload
public Set<PluginInformation> getPluginsScheduledForUpdateOrDownload()
Replies the set of plugins waiting for update or download- Returns:
- the set of plugins waiting for update or download
-
getNewlyActivatedPlugins
public List<PluginInformation> getNewlyActivatedPlugins()
Replies the list of plugins which have been added by the user to the set of activated plugins- Returns:
- the list of newly activated plugins
-
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
-
readLocalPluginInformation
public void readLocalPluginInformation()
Reads locally available information about plugins from the local file system. Scans cached plugin lists from plugin download sites and locally available plugin jar files.
-
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
-
-