org.openstreetmap.josm.plugins
Class ReadLocalPluginInformationTask

java.lang.Object
  extended by org.openstreetmap.josm.gui.PleaseWaitRunnable
      extended by org.openstreetmap.josm.plugins.ReadLocalPluginInformationTask
All Implemented Interfaces:
java.lang.Runnable, ProgressMonitor.CancelListener

public class ReadLocalPluginInformationTask
extends PleaseWaitRunnable

This is an asynchronous task for reading plugin information from the files in the local plugin repositories. It scans the files in the local plugins repository (see Preferences#getPluginsDirectory() and extracts plugin information from three kind of files:


Field Summary
private  java.util.Map<java.lang.String,PluginInformation> availablePlugins
           
private  boolean canceled
           
 
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
 
Constructor Summary
ReadLocalPluginInformationTask()
           
ReadLocalPluginInformationTask(ProgressMonitor monitor)
           
 
Method Summary
protected  void analyseInProcessPlugins()
           
protected  void cancel()
          User pressed cancel button.
protected  void filterOldPlugins()
           
protected  void finish()
          Finish up the data work.
 java.util.List<PluginInformation> getAvailablePlugins()
          Replies information about available plugins detected by this task.
 boolean isCanceled()
          Replies true if the task was canceled by the user
protected  void processJarFile(java.io.File f, java.lang.String pluginName)
           
protected  void processLocalPluginInformationFile(java.io.File file)
           
protected  void realRun()
          Called in the worker thread to do the actual work.
protected  void scanIconCacheFiles(ProgressMonitor monitor, java.io.File pluginsDirectory)
           
protected  void scanLocalPluginRepository(ProgressMonitor monitor, java.io.File pluginsDirectory)
           
protected  void scanPluginFiles(ProgressMonitor monitor, java.io.File pluginsDirectory)
           
protected  void scanSiteCacheFiles(ProgressMonitor monitor, java.io.File pluginsDirectory)
           
 
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

availablePlugins

private java.util.Map<java.lang.String,PluginInformation> availablePlugins

canceled

private boolean canceled
Constructor Detail

ReadLocalPluginInformationTask

public ReadLocalPluginInformationTask()

ReadLocalPluginInformationTask

public ReadLocalPluginInformationTask(ProgressMonitor monitor)
Method Detail

cancel

protected void cancel()
Description copied from class: PleaseWaitRunnable
User pressed cancel button.

Specified by:
cancel in class PleaseWaitRunnable

finish

protected void finish()
Description copied from class: PleaseWaitRunnable
Finish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.

Specified by:
finish in class PleaseWaitRunnable

processJarFile

protected void processJarFile(java.io.File f,
                              java.lang.String pluginName)
                       throws PluginException
Throws:
PluginException

scanSiteCacheFiles

protected void scanSiteCacheFiles(ProgressMonitor monitor,
                                  java.io.File pluginsDirectory)

scanIconCacheFiles

protected void scanIconCacheFiles(ProgressMonitor monitor,
                                  java.io.File pluginsDirectory)

scanPluginFiles

protected void scanPluginFiles(ProgressMonitor monitor,
                               java.io.File pluginsDirectory)

scanLocalPluginRepository

protected void scanLocalPluginRepository(ProgressMonitor monitor,
                                         java.io.File pluginsDirectory)

processLocalPluginInformationFile

protected void processLocalPluginInformationFile(java.io.File file)
                                          throws PluginListParseException
Throws:
PluginListParseException

analyseInProcessPlugins

protected void analyseInProcessPlugins()

filterOldPlugins

protected void filterOldPlugins()

realRun

protected void realRun()
                throws org.xml.sax.SAXException,
                       java.io.IOException,
                       OsmTransferException
Description copied from class: PleaseWaitRunnable
Called in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.

Specified by:
realRun in class PleaseWaitRunnable
Throws:
org.xml.sax.SAXException
java.io.IOException
OsmTransferException

getAvailablePlugins

public java.util.List<PluginInformation> getAvailablePlugins()
Replies information about available plugins detected by this task.

Returns:
information about available plugins detected by this task.

isCanceled

public boolean isCanceled()
Replies true if the task was canceled by the user

Returns:
true if the task was canceled by the user


JOSM