public class PluginServices extends Object
Modifier and Type | Class and Description |
---|---|
class |
PluginServices.PluginLoadDataException |
class |
PluginServices.PluginPersistenceAddDefinitionException |
class |
PluginServices.PluginPersistenceNeedDefinitionException |
class |
PluginServices.PluginSaveDataException |
Constructor and Description |
---|
PluginServices(PluginClassLoader loader)
Creates a new PluginServices objetct.
|
PluginServices(PluginClassLoader loader,
String[] alternativeNames) |
Modifier and Type | Method and Description |
---|---|
void |
addDependencyWithPlugin(PluginServices otherPlugin) |
static void |
addLoaders(ArrayList classLoaders) |
void |
addPopupMenuListener(String name,
Component c,
ActionListener listener)
A�ade un listener a un popup menu registrado en el config.xml de alg�n
plugin
|
static Thread |
backgroundExecution(Runnable r)
Runs a background task.
|
static void |
cancelableBackgroundExecution(IMonitorableTask task)
Runs a backbround task.
|
static void |
closeApplication()
Closes the application.
|
String[] |
getAlternativeNames() |
static String |
getArgumentByName(String name)
Returns the value of a command line named argument.
|
static String[] |
getArguments()
Gets an array containing the application's startup arguments.
|
PluginClassLoader |
getClassLoader()
Gets the plugin's classloader.
|
static ExtensionDecorator |
getDecoratedExtension(Class extensionClass)
Gets a reference to the Extension Decorator which adds some extra options
to the basic extension interface.
|
static ExtensionDecorator[] |
getDecoratedExtensions()
Returns an array containing references to all the loaded extensions.
|
static DlgPreferences |
getDlgPreferences() |
static ExclusiveUIExtension |
getExclusiveUIExtension()
Gets the ExclusiveUIExtension, an special extension which
will take
control over the UI and will decide which extensions may be
enable/disabled or visible/hidden.
|
static IExtension |
getExtension(Class extensionClass)
Gets the instance of the extension whose class is provided.
|
static Iterator |
getExtensions()
Gets an iterator with all the loaded Extensions.
|
static String |
getFromClipboard()
Gets text data from the Clipboard, if available.
|
static IconTheme |
getIconTheme()
Deprecated.
use ToolsSwingLocator.getIconThemeManager().getCurrent()
|
static IconThemeManager |
getIconThemeManager()
Deprecated.
use ToolsSwingLocator.getIconThemeManager()
|
static Logger |
getLogger()
Gets the logger.
|
static MainFrame |
getMainFrame()
Gets the application's main frame.
|
PluginsManager |
getManager() |
static MDIManager |
getMDIManager()
Gets the window manager (MDIManager).
|
XMLEntity |
getPersistentXML()
Gets the XML data which was saved on previous sessions for this
plugins.
|
File |
getPluginDirectory()
Gets the plugin's root directory.
|
File |
getPluginHomeFolder()
Returns the folder where the plugin stores its resources.
|
String |
getPluginName()
Gets the plugin's name
|
DynObject |
getPluginProperties() |
static PluginServices |
getPluginServices(Object pluginClassInstance)
Gets a reference to the PluginServices object associated with the
plugin containing the provided class.
|
static PluginServices |
getPluginServices(String pluginName)
Gets a reference to the PluginServices object associated with the
provided plugin.
|
static String |
getText(Object pluginObject,
String key)
Returns the message in the current's locale language
corresponding to the provided translation key.
|
String |
getText(String key)
Returns the message in the current's locale language
corresponding to the provided translation key.
|
static void |
putInClipboard(String data)
Stores the provided text data on the clipboard.
|
static void |
registerKeyStroke(KeyStroke key,
KeyEventDispatcher a) |
static boolean |
runningInDevelopment()
Try to detect if the application is running in a development
environment.
|
void |
savePluginProperties() |
static void |
setArguments(String[] arguments)
Replaces the original Andami arguments with the provided arguments.
|
static void |
setExclusiveUIExtension(ExclusiveUIExtension extension)
Sets the ExclusiveUIExtension, an special extension which
will take
control over the UI and will decide which extensions may be
enable/disabled or visible/hidden.
|
void |
setPersistentXML(XMLEntity entity)
Sets the XML data which should be saved on disk for this plugin.
|
String |
toString() |
static void |
unRegisterKeyStroke(KeyStroke key) |
public PluginServices(PluginClassLoader loader)
loader
- The Plugin's ClassLoader.public PluginServices(PluginClassLoader loader, String[] alternativeNames)
public String[] getAlternativeNames()
public String getText(String key)
key
- Translation key whose associated message is to be obtainedpublic PluginClassLoader getClassLoader()
public String getPluginName()
public static PluginServices getPluginServices(Object pluginClassInstance)
pluginClassInstance
- An instance of a class. This class is contained in a plugin,
whose
services are to be obtainedRuntimeException
- If the parameter was not loaded from a pluginpublic static PluginServices getPluginServices(String pluginName)
pluginName
- Plugin's name whose services are going to be usedpublic static MDIManager getMDIManager()
public static MainFrame getMainFrame()
public static void registerKeyStroke(KeyStroke key, KeyEventDispatcher a)
public static void unRegisterKeyStroke(KeyStroke key)
public static IExtension getExtension(Class extensionClass)
extensionClass
- Class of the extension whose instance is to be returnedpublic static ExtensionDecorator getDecoratedExtension(Class extensionClass)
extensionClass
- The class of the extension whose decorator is to be returnedpublic static ExtensionDecorator[] getDecoratedExtensions()
public static Iterator getExtensions()
public static String getText(Object pluginObject, String key)
pluginObject
- Any object which was loaded from a pluginkey
- Translation key whose associated message is to be obtainedpublic void setPersistentXML(XMLEntity entity)
The
- XMLEntity object containing the data to be persisted.PluginServices.getPersistentXML()
,
XMLEntity
public XMLEntity getPersistentXML()
public void addPopupMenuListener(String name, Component c, ActionListener listener)
name
- Nombre del men� contextualc
- Componente que desplegar� el men� cuando se haga click con el
bot�n derecholistener
- Listener que se ejecutar� cuando se seleccione cualquier
entrada del men�RuntimeException
- Si la interfaz no est� preparada todav�a. S�lo puede darse
durante el arranquepublic File getPluginDirectory()
public static Thread backgroundExecution(Runnable r)
r
- The task to run.public static void cancelableBackgroundExecution(IMonitorableTask task)
task
- The task to run.public static void closeApplication()
public static String[] getArguments()
appName plugins-directory [locale] [other args]
public static void setArguments(String[] arguments)
arguments
- An array of String, each element of the array
represents one
argument.public static String getArgumentByName(String name)
public static Logger getLogger()
object from the Log4j library.
public static DlgPreferences getDlgPreferences()
public static void putInClipboard(String data)
data
- An String containing the data to be stored
on the clipboard.public static String getFromClipboard()
null
if the data was not available.public static ExclusiveUIExtension getExclusiveUIExtension()
null
.Launcher.initializeExclusiveUIExtension()
,
org.gvsig.andami.plugins.IExtension#isEnabled(IExtension extension)
,
org.gvsig.andami.plugins.IExtension#isVisible(IExtension extension)
public static void setExclusiveUIExtension(ExclusiveUIExtension extension)
ExclusiveUIExtension=ExtensionName
Launcher.initializeExclusiveUIExtension()
,
org.gvsig.andami.plugins.IExtension#isEnabled(IExtension extension)
,
org.gvsig.andami.plugins.IExtension#isVisible(IExtension extension)
public static void addLoaders(ArrayList classLoaders)
public static IconThemeManager getIconThemeManager()
public static IconTheme getIconTheme()
public static boolean runningInDevelopment()
public PluginsManager getManager()
public DynObject getPluginProperties()
public void savePluginProperties()
public File getPluginHomeFolder()
public void addDependencyWithPlugin(PluginServices otherPlugin)