KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.dijon.Spinner;
7
8 import javax.swing.JComponent JavaDoc;
9 import javax.swing.JPopupMenu JavaDoc;
10
11 public class XSpinner extends Spinner {
12   protected XPopupListener m_popupListener;
13   
14   public XSpinner() {
15     super();
16     m_popupListener = new XPopupListener(this);
17     setPopupMenu(createPopup());
18   }
19   
20   public void setEditor(JComponent JavaDoc editor) {
21     super.setEditor(editor);
22     m_popupListener.setTarget(editor);
23   }
24   
25   protected JPopupMenu JavaDoc createPopup() {
26     return null;
27   }
28
29   public void setPopupMenu(JPopupMenu JavaDoc popupMenu) {
30     m_popupListener.setPopupMenu(popupMenu);
31   }
32
33   public JPopupMenu JavaDoc getPopupMenu() {
34     return m_popupListener.getPopupMenu();
35   }
36 }
37
Popular Tags