KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > rero > gui > toolbar > EvilAction


1 package rero.gui.toolbar;
2
3 import rero.gui.*;
4
5 import java.awt.event.*;
6 import javax.swing.*;
7 import rero.client.*;
8 import rero.client.script.*;
9 import rero.config.*;
10
11 public class EvilAction implements ToolAction
12 {
13    public void actionPerformed(MouseEvent ev)
14    {
15       if (ev.getClickCount() > 2)
16       {
17          boolean lame = !ClientState.getClientState().isOption("load.lame", false);
18          String JavaDoc message = "";
19
20          if (lame)
21          {
22             message = "Hunting for easter eggs?\nRight click on a nick (in the nicklist) and\nlook for an extra surprise.";
23             ((ScriptManager)SessionManager.getGlobalCapabilities().getActiveSession().getCapabilities().getDataStructure(DataStructures.ScriptManager)).loadLameScripts();
24          }
25          else
26          {
27             message = "Ok, ok, that feature is not all it's cracked up\nto be. Restart jIRCii to disable the lame menus";
28          }
29
30          JOptionPane.showMessageDialog(null, message, "Your favorite holiday...", JOptionPane.INFORMATION_MESSAGE);
31          ClientState.getClientState().setOption("load.lame", lame);
32       }
33    }
34
35    public String JavaDoc getDescription()
36    {
37       return null;
38    }
39
40    public int getIndex()
41    {
42       return 2;
43    }
44 }
45
Popular Tags