com.sas.console.plugins
Class AbstractPlugin

java.lang.Object
  |
  +--com.sas.console.plugins.AbstractPlugin
All Implemented Interfaces:
PluginInterface,
Direct Known Subclasses:
AbstractNavigationPlugin,

public abstract class AbstractPlugin
extends Object
implements PluginInterface

This is a basic implementation of the PluginInterface. A plug-in can extend this class and provide only a name and description to have a functioning plug-in.


Field Summary
protected  AboutInterface m_aboutInfo
          The version of the Plug-in.
protected  ConsoleInterface m_console
          Reference to the console framework.
protected  ImageIcon m_icon
          The icon representing this Plug-in.
protected  Vector m_pluginListenerList
          The list of registered listeners.
protected  String m_strDescription
          A short description of this plugin.
protected  String m_strName
          The display name of this plugin.
 
Constructor Summary
AbstractPlugin(ConsoleInterface console)
          Constructor
 
Method Summary
 void addPluginChangeListener(PluginChangeListener listener)
          Adds a plugin change listener to this Plug-in.
 void dispose()
          Reserved for future use.
 void firePluginChange(int eventType, NodeInterface parentNode, List pairList)
          Fires a plugin change to registered listeners.
 AboutInterface getAbout()
          Returns an object that has more detailed information about this plug-in.
 ConsoleInterface getConsole()
          Gets a reference to the console framework.
 String getDescription()
          Returns the short description of the plug-in.
 Icon getIcon()
           
 Icon getIcon(int size)
          Returns the icon of the Plug-in.
 String getName()
          Returns the name of the Plug-in.
 void initPlugin()
          Initialize the plugin.
 boolean needsConnection()
          Returns if the plugin requires a metadata connection with repositories to display
 void removePluginChangeListener(PluginChangeListener listener)
          Removes a plugin change listener to this Plug-in.
 void setDescription(String strDescription)
          Sets the short description of the plug-in.
 void setIcon(ImageIcon icon)
          Sets the icon of the Plug-in.
 void setName(String strName)
          Sets the name of the plug-in.
 String toString()
          Return the plugin's name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_console

protected ConsoleInterface m_console
Reference to the console framework.

m_strName

protected String m_strName
The display name of this plugin.

m_strDescription

protected String m_strDescription
A short description of this plugin.

m_icon

protected ImageIcon m_icon
The icon representing this Plug-in.

m_aboutInfo

protected AboutInterface m_aboutInfo
The version of the Plug-in.

m_pluginListenerList

protected Vector m_pluginListenerList
The list of registered listeners.
Constructor Detail

AbstractPlugin

public AbstractPlugin(ConsoleInterface console)
Constructor
Parameters:
console - The console interface
Method Detail

getName

public String getName()
Returns the name of the Plug-in.
Specified by:
getName in interface PluginInterface
Returns:
The Plug-in name.

setName

public void setName(String strName)
Sets the name of the plug-in.
Parameters:
strName - The plug-in name.

getDescription

public String getDescription()
Returns the short description of the plug-in.
Specified by:
getDescription in interface PluginInterface
Returns:
The plug-in description.

setDescription

public void setDescription(String strDescription)
Sets the short description of the plug-in.
Parameters:
strDescription - The description of the plug-in.

toString

public String toString()
Return the plugin's name
Overrides:
toString in class Object
Returns:
The name of the Plug-in.

getIcon

public Icon getIcon(int size)
Returns the icon of the Plug-in.
Specified by:
getIcon in interface PluginInterface
Returns:
The Plug-in icon.

getIcon

public Icon getIcon()
Specified by:
getIcon in interface PluginInterface

setIcon

public void setIcon(ImageIcon icon)
Sets the icon of the Plug-in.
Parameters:
icon - The icon to be set.

getAbout

public AboutInterface getAbout()
Returns an object that has more detailed information about this plug-in.
Specified by:
getAbout in interface PluginInterface
Returns:
Aboutinterface object with Plug-in info.

needsConnection

public boolean needsConnection()
Returns if the plugin requires a metadata connection with repositories to display
Specified by:
needsConnection in interface PluginInterface
Returns:
the default value is true

dispose

public void dispose()
Reserved for future use. Disposes of plugin. Plugin should clean up anything that needs to be cleaned up. The calls to this method are not fully implemented yet. and may not be fully implemented until 9.1. When this method is called is dependent on how the plugin is used.
Specified by:
dispose in interface PluginInterface

addPluginChangeListener

public void addPluginChangeListener(PluginChangeListener listener)
Adds a plugin change listener to this Plug-in.
Specified by:
addPluginChangeListener in interface PluginInterface
Parameters:
listener - The plugin change listener.

removePluginChangeListener

public void removePluginChangeListener(PluginChangeListener listener)
Removes a plugin change listener to this Plug-in.
Specified by:
removePluginChangeListener in interface PluginInterface
Parameters:
listener - The plugin change listener.

firePluginChange

public void firePluginChange(int eventType,
                             NodeInterface parentNode,
                             List pairList)
Fires a plugin change to registered listeners.
Specified by:
firePluginChange in interface PluginInterface
Parameters:
eventType - One of the PluginChangeEvent types ( DELETED, CHANGED, INSERTED, RESTRUCTURED, SELECTED ).
parentNode - The parent node of the changed object.
pairList - The list of IntObjectPairs that hold the children who have changed

getConsole

public ConsoleInterface getConsole()
Gets a reference to the console framework.
Specified by:
getConsole in interface PluginInterface
Following copied from interface: com.sas.console.plugins.PluginInterface
Returns:
Console in which this plugin is running.

initPlugin

public void initPlugin()
Initialize the plugin.
Specified by:
initPlugin in interface PluginInterface




Copyright © 2001-2003 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 15:59:52