01: /*
02: * @(#)HeaderBox.java 4/27/2006
03: *
04: * Copyright 2002 - 2006 JIDE Software Inc. All rights reserved.
05: */
06:
07: package com.jidesoft.swing;
08:
09: import com.jidesoft.plaf.LookAndFeelFactory;
10: import com.jidesoft.plaf.UIDefaultsLookup;
11:
12: import javax.swing.*;
13:
14: /**
15: * HeaderBox is a special component that is used in JIDE Pivot Grid product to mimic a button with table header style.
16: */
17: public class HeaderBox extends JButton {
18:
19: private static final String uiClassID = "HeaderBoxUI";
20:
21: public static final String CLIENT_PROPERTY_TABLE_CELL_EDITOR = "HeaderBox.isTableCellEditor";
22:
23: /**
24: * Creates a button with no set text or icon.
25: */
26: public HeaderBox() {
27: setOpaque(false);
28: setRolloverEnabled(true);
29: }
30:
31: /**
32: * Resets the UI property to a value from the current look and
33: * feel.
34: *
35: * @see javax.swing.JComponent#updateUI
36: */
37: @Override
38: public void updateUI() {
39: if (UIDefaultsLookup.get(uiClassID) == null) {
40: LookAndFeelFactory.installJideExtension();
41: }
42: setUI(UIManager.getUI(this ));
43: }
44:
45: /**
46: * Returns a string that specifies the name of the L&F class
47: * that renders this component.
48: *
49: * @return the string "HeaderBoxUI"
50: */
51: @Override
52: public String getUIClassID() {
53: return uiClassID;
54: }
55: }
|