public ExportAction(ExportPlugin plugin) {
if (plugin == null)
{
throw new NullPointerException();
}
this.plugin = plugin;
plugin.addPropertyChangeListener(new ExportPluginListener());
if (plugin.getAcceleratorKey() != null)
{
putValue(ActionDowngrade.ACCELERATOR_KEY, plugin.getAcceleratorKey());
}
if (plugin.getDisplayName() != null)
{
putValue(ExportAction.NAME, plugin.getDisplayName());
}
if (plugin.getSmallIcon() != null)
{
putValue(ExportAction.SMALL_ICON, plugin.getSmallIcon());
}
if (plugin.getLargeIcon() != null)
{
putValue("ICON24", plugin.getLargeIcon());
}
if (plugin.getMnemonicKey() != null)
{
putValue(ActionDowngrade.MNEMONIC_KEY, plugin.getMnemonicKey());
}
if (plugin.getShortDescription() != null)
{
putValue(ExportAction.SHORT_DESCRIPTION, plugin.getShortDescription());
}
}
Defines an Action object with a default description string and default icon. Parameters:
plugin - the export plug-in.
|