Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
InviterListPopupMenu |
|
| 1.3333333333333333;1.333 |
1 | /****************************************************************************** | |
2 | * InviterListPopupMenu.java - The context menu on the inviter table | |
3 | * $Id$ | |
4 | * | |
5 | * BuckoFIBS - Backgammon by BuckoSoft | |
6 | * Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp. | |
7 | * | |
8 | * $Log$ | |
9 | * Revision 1.2 2010/03/03 12:19:49 inim | |
10 | * Moved source to UTF8 encoding from CP1252 encoding. To this end all source files' (c) message was updated to "Copyright© 2009,2010 - Dick Balaska - BuckoSoft, Corp.". This replaces the (c) sign to UTF8, and adds the new year 2010. | |
11 | * | |
12 | * Revision 1.1 2010/02/04 05:57:53 inim | |
13 | * Mavenized project folder layout | |
14 | * | |
15 | * Revision 1.2 2009/02/14 15:46:36 dick | |
16 | * BuckoFIBS is released under the GNU license. | |
17 | * | |
18 | * Revision 1.1 2009/01/28 19:39:15 dick | |
19 | * package com.buckosoft.fibs.gui.inviterList becomes com.buckosoft.fibs.BuckoFIBS.gui.inviterList. | |
20 | * | |
21 | * Revision 1.1 2008/12/11 20:32:58 dick | |
22 | * The context menu on the inviter table. | |
23 | */ | |
24 | ||
25 | /* | |
26 | * This program is free software: you can redistribute it and/or modify | |
27 | * it under the terms of the GNU General Public License as published by | |
28 | * the Free Software Foundation, either version 3 of the License, or | |
29 | * (at your option) any later version. | |
30 | * | |
31 | * This program is distributed in the hope that it will be useful, | |
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
34 | * GNU General Public License for more details. | |
35 | * | |
36 | * You should have received a copy of the GNU General Public License | |
37 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
38 | * | |
39 | * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>. | |
40 | * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp. | |
41 | * | |
42 | */ | |
43 | package com.buckosoft.fibs.BuckoFIBS.gui.inviterList; | |
44 | ||
45 | import java.awt.event.ActionEvent; | |
46 | import java.awt.event.ActionListener; | |
47 | ||
48 | import javax.swing.JMenuItem; | |
49 | import javax.swing.JPopupMenu; | |
50 | ||
51 | /** The context menu on the inviter table | |
52 | * @author Dick Balaska | |
53 | * @since 2008/12/11 | |
54 | * @version $Revision$ <br> $Date$ | |
55 | * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/com/buckosoft/fibs/BuckoFIBS/gui/inviterList/InviterListPopupMenu.java">cvs InviterListPopupMenu.java</a> | |
56 | */ | |
57 | public class InviterListPopupMenu extends JPopupMenu implements ActionListener { | |
58 | private static final long serialVersionUID = 1L; | |
59 | 0 | private JMenuItem jMenuItemAccept = null; |
60 | 0 | private JMenuItem jMenuItemDecline = null; |
61 | ||
62 | 0 | private ActionListener menuHandler = null; // @jve:decl-index=0: |
63 | ||
64 | /** | |
65 | * This method initializes | |
66 | * | |
67 | */ | |
68 | public InviterListPopupMenu() { | |
69 | 0 | super(); |
70 | 0 | initialize(); |
71 | 0 | } |
72 | ||
73 | /** | |
74 | * This method initializes this | |
75 | * | |
76 | */ | |
77 | private void initialize() { | |
78 | 0 | this.add(getJMenuItemAccept()); |
79 | 0 | this.add(getJMenuItemDecline()); |
80 | ||
81 | 0 | } |
82 | ||
83 | public void setMenuHandler(ActionListener c) { | |
84 | 0 | this.menuHandler = c; |
85 | 0 | } |
86 | ||
87 | /* (non-Javadoc) | |
88 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) | |
89 | */ | |
90 | public void actionPerformed(ActionEvent e) { | |
91 | 0 | menuHandler.actionPerformed(e); |
92 | 0 | } |
93 | ||
94 | /** | |
95 | * This method initializes jMenuItemAccept | |
96 | * | |
97 | * @return javax.swing.JMenuItem | |
98 | */ | |
99 | private JMenuItem getJMenuItemAccept() { | |
100 | 0 | if (jMenuItemAccept == null) { |
101 | 0 | jMenuItemAccept = new JMenuItem(); |
102 | 0 | jMenuItemAccept.setText("Accept"); |
103 | 0 | jMenuItemAccept.addActionListener(this); |
104 | } | |
105 | 0 | return jMenuItemAccept; |
106 | } | |
107 | ||
108 | /** | |
109 | * This method initializes jMenuItemDecline | |
110 | * | |
111 | * @return javax.swing.JMenuItem | |
112 | */ | |
113 | private JMenuItem getJMenuItemDecline() { | |
114 | 0 | if (jMenuItemDecline == null) { |
115 | 0 | jMenuItemDecline = new JMenuItem(); |
116 | 0 | jMenuItemDecline.setText("Decline"); |
117 | 0 | jMenuItemDecline.addActionListener(this); |
118 | } | |
119 | 0 | return jMenuItemDecline; |
120 | } | |
121 | ||
122 | } // @jve:decl-index=0:visual-constraint="18,7" |