|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.plugins.PluginDownloadTask
public class PluginDownloadTask
Asynchronous task for downloading a collection of plugins.
When the task is finished getDownloadedPlugins()
replies the list of downloaded plugins
and getFailedPlugins()
replies the list of failed plugins.
Field Summary | |
---|---|
private boolean |
canceled
|
private java.net.HttpURLConnection |
downloadConnection
|
private java.util.Collection<PluginInformation> |
downloaded
|
private java.util.Collection<PluginInformation> |
failed
|
private java.lang.Exception |
lastException
|
private java.util.Collection<PluginInformation> |
toUpdate
|
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
progressMonitor |
Constructor Summary | |
---|---|
PluginDownloadTask(java.awt.Component parent,
java.util.Collection<PluginInformation> toUpdate,
java.lang.String title)
Creates the download task |
|
PluginDownloadTask(ProgressMonitor monitor,
java.util.Collection<PluginInformation> toUpdate,
java.lang.String title)
Creates the task |
Method Summary | |
---|---|
protected void |
cancel()
User pressed cancel button. |
protected void |
download(PluginInformation pi,
java.io.File file)
|
protected void |
finish()
Finish up the data work. |
java.util.Collection<PluginInformation> |
getDownloadedPlugins()
Replies the list of plugins whose download has failed |
java.util.Collection<PluginInformation> |
getFailedPlugins()
Replies the list of successfully downloaded plugins |
boolean |
isCanceled()
Replies true if the task was canceled by the user |
protected void |
realRun()
Called in the worker thread to do the actual work. |
void |
setPluginsToDownload(java.util.Collection<PluginInformation> toUpdate)
Sets the collection of plugins to update. |
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable |
---|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.Collection<PluginInformation> toUpdate
private final java.util.Collection<PluginInformation> failed
private final java.util.Collection<PluginInformation> downloaded
private java.lang.Exception lastException
private boolean canceled
private java.net.HttpURLConnection downloadConnection
Constructor Detail |
---|
public PluginDownloadTask(java.awt.Component parent, java.util.Collection<PluginInformation> toUpdate, java.lang.String title) throws java.lang.IllegalArgumentException
parent
- the parent component relative to which the PleaseWaitDialog
is displayedtoUpdate
- a collection of plugin descriptions for plugins to update/download. Must not be null.title
- the title to display in the PleaseWaitDialog
java.lang.IllegalArgumentException
- thrown if toUpdate is nullpublic PluginDownloadTask(ProgressMonitor monitor, java.util.Collection<PluginInformation> toUpdate, java.lang.String title)
monitor
- a progress monitor. Defaults to NullProgressMonitor.INSTANCE
if nulltoUpdate
- a collection of plugin descriptions for plugins to update/download. Must not be null.title
- the title to display in the PleaseWaitDialog
java.lang.IllegalArgumentException
- thrown if toUpdate is nullMethod Detail |
---|
public void setPluginsToDownload(java.util.Collection<PluginInformation> toUpdate) throws java.lang.IllegalArgumentException
toUpdate
- the collection of plugins to update. Must not be null.
java.lang.IllegalArgumentException
- thrown if toUpdate is nullprotected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void download(PluginInformation pi, java.io.File file) throws PluginDownloadException
PluginDownloadException
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
java.io.IOException
public boolean isCanceled()
public java.util.Collection<PluginInformation> getFailedPlugins()
public java.util.Collection<PluginInformation> getDownloadedPlugins()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |