01: /**
02: * L2FProd.com Common Components 7.3 License.
03: *
04: * Copyright 2005-2007 L2FProd.com
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */package com.l2fprod.common.swing;
18:
19: import com.l2fprod.common.swing.plaf.JLinkButtonAddon;
20: import com.l2fprod.common.swing.plaf.LookAndFeelAddons;
21:
22: import javax.swing.Action;
23: import javax.swing.Icon;
24: import javax.swing.JButton;
25:
26: /**
27: * A button targeted to be used as an hyperlink. Most UI will make it
28: * transparent and it will react on mouse over by changing the cursor to the
29: * hand cursor.
30: *
31: * @javabean.class
32: * name="JLinkButton"
33: * shortDescription="A button looking as an hyperlink."
34: * stopClass="java.awt.Component"
35: *
36: * @javabean.attribute
37: * name="isContainer"
38: * value="Boolean.FALSE"
39: * rtexpr="true"
40: *
41: * @javabean.icons
42: * mono16="JLinkButton16-mono.gif"
43: * color16="JLinkButton16.gif"
44: * mono32="JLinkButton32-mono.gif"
45: * color32="JLinkButton32.gif"
46: */
47: public class JLinkButton extends JButton {
48:
49: public static final String UI_CLASS_ID = "LinkButtonUI";
50:
51: // ensure at least the default ui is registered
52: static {
53: LookAndFeelAddons.contribute(new JLinkButtonAddon());
54: }
55:
56: public JLinkButton() {
57: super ();
58: }
59:
60: public JLinkButton(String text) {
61: super (text);
62: }
63:
64: public JLinkButton(String text, Icon icon) {
65: super (text, icon);
66: }
67:
68: public JLinkButton(Action a) {
69: super (a);
70: }
71:
72: public JLinkButton(Icon icon) {
73: super (icon);
74: }
75:
76: /**
77: * Returns the name of the L&F class that renders this component.
78: *
79: * @return the string {@link #UI_CLASS_ID}
80: * @see javax.swing.JComponent#getUIClassID
81: * @see javax.swing.UIDefaults#getUI
82: */
83: public String getUIClassID() {
84: return UI_CLASS_ID;
85: }
86:
87: }
|