org.homeunix.thecave.buddi.plugin.builtin.imports
Class ImportTestData
java.lang.Object
org.homeunix.thecave.buddi.plugin.api.PreferenceAccess
org.homeunix.thecave.buddi.plugin.api.MenuPlugin
org.homeunix.thecave.buddi.plugin.api.BuddiImportPlugin
org.homeunix.thecave.buddi.plugin.builtin.imports.ImportTestData
- All Implemented Interfaces:
- FileAccess, MossPlugin
public class ImportTestData
- extends BuddiImportPlugin
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImportTestData
public ImportTestData()
importData
public void importData(MutableDocument model,
MossDocumentFrame callingFrame,
java.io.File file)
throws PluginException,
PluginMessage
- Description copied from class:
BuddiImportPlugin
- Imports data as required. The plugin launch code will prompt for a file
and pass it in (unless you override the isPromptForFile() method to return false).
This method is executed from the launch code within a SwingWorker thread. Once this
method is completed, the launch code will update all windows with any new information
which may have come from this plugin. Thus, it is not a good idea to use any threads
in this method, unless you can guarantee that this method will not complete until
all data processing is completed.
As well, since this method is not run from the AWT Event thread, you should not display
any Swing objects here, as it can potentially cause deadlocks in some situations. This
should not be a problem for most plugins, as they just need a file (provided), and that is
all. If you do need to display some Swing objects, you can do so using the
SwingUtilities.invokeLater() method.
- Specified by:
importData in class BuddiImportPlugin
- Throws:
PluginException
PluginMessage
isPromptForFile
public boolean isPromptForFile()
- Description copied from interface:
FileAccess
- Should Buddi prompt for a file to import? Defaults to true. If you know what
the file name is (or you are importing from a different source, such as the
network), you should override this method and return false.
- Specified by:
isPromptForFile in interface FileAccess- Overrides:
isPromptForFile in class MenuPlugin
- Returns:
isCreateNewFile
public boolean isCreateNewFile()
- Description copied from class:
BuddiImportPlugin
- If set to true, we will force the creation of a new file here. Most people will want to
leave this as false (the default); only people who are importing a complete file from
another source (e.g. Legacy Buddi files) will want to set it to true.
- Overrides:
isCreateNewFile in class BuddiImportPlugin
- Returns:
getName
public java.lang.String getName()
- Description copied from interface:
MossPlugin
- Returns the plugin name. This may be used in different places, depending
on the type of plugin.
- Returns: