KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > common > XCheckBox


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin.common;
5
6 import javax.swing.JPopupMenu JavaDoc;
7
8 import org.dijon.CheckBox;
9
10 public class XCheckBox extends CheckBox {
11   protected XPopupListener m_popupListener;
12   
13   public XCheckBox() {
14     super();
15     m_popupListener = new XPopupListener(this);
16     
17     JPopupMenu JavaDoc popup = createPopup();
18     if(popup != null) {
19       setPopupMenu(popup);
20     }
21   }
22   
23   public XCheckBox(String JavaDoc label) {
24     this();
25     setText(label);
26   }
27   
28   protected JPopupMenu JavaDoc createPopup() {
29     return null;
30   }
31
32   public void setPopupMenu(JPopupMenu JavaDoc popupMenu) {
33     m_popupListener.setPopupMenu(popupMenu);
34   }
35
36   public JPopupMenu JavaDoc getPopupMenu() {
37     return m_popupListener.getPopupMenu();
38   }
39 }
40
Popular Tags