Talk:OpenCDS CreatePlugin

From OpenFrag

Jump to: navigation, search

Testing usage of our new syntax highlighter as per instructions here: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi#Usage Please contact me if there are any problems or suggestions, such as colors or usage. PhycoFalcon 11:32, 13 September 2007 (CEST)

  1. package TestPlugin;
  2. import org.openfrag.OpenCDS.core.plugin.*;
  3. import org.openfrag.OpenCDS.core.logging.*;
  4. import java.awt.event.ActionListener;
  5. import java.awt.event.ActionEvent;
  6. import javax.swing.Timer;
  7.  
  8.  
  9. public class TestPlugin extends Plugin
  10. {
  11.   private PluginInterface m_PluginInterface;
  12.  
  13.  
  14.   /**
  15.    * Initializes the plugin.
  16.   */
  17.   public void initialize(PluginInterface pluginInterface)
  18.   {
  19.     m_PluginInterface = pluginInterface;
  20.    
  21.  
  22.     int delay = 5000; // The amount of seconds between messages.
  23.     ActionListener performer = new ActionListener()
  24.     {
  25.       public void actionPerformed(ActionEvent event)
  26.       {
  27.         Logger.getInstance().log("TestPlugin", "Hey!");
  28.       }
  29.     };
  30.     new Timer(delay, performer).start();
  31.   }
  32.  
  33.  
  34.   /**
  35.    * Destroys the plugin.
  36.   */
  37.   public void destroy()
  38.   {
  39.   }
  40. }
Personal tools
OpenFrag