public class PluginPreferencesModel extends Observable
Modifier and Type | Field and Description |
---|---|
private List<PluginInformation> |
availablePlugins |
private Set<String> |
currentActivePlugins |
private List<PluginInformation> |
displayedPlugins |
private String |
filterExpression |
private Set<String> |
pendingDownloads |
private Map<PluginInformation,Boolean> |
selectedPluginsMap |
Constructor and Description |
---|
PluginPreferencesModel()
Constructs a new
PluginPreferencesModel . |
Modifier and Type | Method and Description |
---|---|
void |
clearPendingPlugins(Collection<PluginInformation> plugins)
Removes all the plugin in
plugins from the list of plugins
with a pending download |
void |
filterDisplayedPlugins(String filter) |
List<PluginInformation> |
getAvailablePlugins()
Replies the set of all available plugins.
|
List<PluginInformation> |
getDisplayedPlugins()
Replies the list of plugin informations to display
|
Set<String> |
getNewlyActivatedPluginNames()
Replies the set of plugin names which have been added by the user to
the set of activated plugins.
|
List<PluginInformation> |
getNewlyActivatedPlugins()
Replies the set of plugins which have been added by the user to
the set of activated plugins.
|
List<PluginInformation> |
getNewlyDeactivatedPlugins()
Replies the set of plugins which have been removed by the user from
the set of activated plugins.
|
PluginInformation |
getPluginInformation(String name)
Replies the plugin info with the name
name . null, if no
such plugin info exists. |
List<PluginInformation> |
getPluginsScheduledForUpdateOrDownload()
Replies the list of plugins waiting for update or download
|
Set<String> |
getSelectedPluginNames()
Replies the list of selected plugin information objects
|
List<PluginInformation> |
getSelectedPlugins()
Replies the list of selected plugin information objects
|
void |
initFromPreferences()
Initializes the model from preferences
|
boolean |
isActivePluginsChanged()
Replies true if the set of active plugins has been changed by the user
in this preference model.
|
boolean |
isSelectedPlugin(String name)
Replies true if the plugin with name
name is currently
selected in the plugin model |
void |
refreshLocalPluginVersion(Collection<PluginInformation> plugins)
Refreshes the local version field on the plugins in
plugins with
the version in the manifest of the downloaded "jar.new"-file for this plugin. |
void |
setAvailablePlugins(Collection<PluginInformation> available) |
void |
setPluginSelected(String name,
boolean selected)
Sets whether the plugin is selected or not.
|
protected void |
sort()
Sorts the list of available plugins
|
protected void |
updateAvailablePlugin(PluginInformation other) |
void |
updateAvailablePlugins(Collection<PluginInformation> fromPluginSite)
Updates the list of plugin information objects with new information from
plugin update sites.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
private final List<PluginInformation> availablePlugins
private final List<PluginInformation> displayedPlugins
private final Map<PluginInformation,Boolean> selectedPluginsMap
private Set<String> pendingDownloads
private String filterExpression
private Set<String> currentActivePlugins
public PluginPreferencesModel()
PluginPreferencesModel
.public void filterDisplayedPlugins(String filter)
public void setAvailablePlugins(Collection<PluginInformation> available)
protected void updateAvailablePlugin(PluginInformation other)
public void updateAvailablePlugins(Collection<PluginInformation> fromPluginSite)
fromPluginSite
- plugin information read from plugin update sitespublic List<PluginInformation> getSelectedPlugins()
public Set<String> getSelectedPluginNames()
protected void sort()
public List<PluginInformation> getDisplayedPlugins()
public List<PluginInformation> getPluginsScheduledForUpdateOrDownload()
public void setPluginSelected(String name, boolean selected)
name
- the name of the pluginselected
- true, if selected; false, otherwisepublic void clearPendingPlugins(Collection<PluginInformation> plugins)
plugins
from the list of plugins
with a pending downloadplugins
- the list of plugins to clear for a pending downloadpublic PluginInformation getPluginInformation(String name)
name
. null, if no
such plugin info exists.name
- the name. If null, replies null.public void initFromPreferences()
public boolean isSelectedPlugin(String name)
name
is currently
selected in the plugin modelname
- the plugin namepublic List<PluginInformation> getNewlyActivatedPlugins()
public List<PluginInformation> getNewlyDeactivatedPlugins()
public List<PluginInformation> getAvailablePlugins()
public Set<String> getNewlyActivatedPluginNames()
public boolean isActivePluginsChanged()
public void refreshLocalPluginVersion(Collection<PluginInformation> plugins)
plugins
with
the version in the manifest of the downloaded "jar.new"-file for this plugin.plugins
- the collections of plugins to refresh