root / trunk / frameworks / _fwAndami / src / com / iver / andami / ui / mdiFrame / JToggleButton.java @ 995
History | View | Annotate | Download (1.94 KB)
1 |
package com.iver.andami.ui.mdiFrame; |
---|---|
2 |
|
3 |
import javax.swing.Action; |
4 |
import javax.swing.Icon; |
5 |
|
6 |
public class JToggleButton extends javax.swing.JToggleButton implements EnableTextSupport{ |
7 |
/**
|
8 |
*
|
9 |
*/
|
10 |
public JToggleButton() { |
11 |
super();
|
12 |
// TODO Auto-generated constructor stub
|
13 |
} |
14 |
/**
|
15 |
* @param text
|
16 |
*/
|
17 |
public JToggleButton(String text) { |
18 |
super(text);
|
19 |
// TODO Auto-generated constructor stub
|
20 |
} |
21 |
/**
|
22 |
* @param text
|
23 |
* @param selected
|
24 |
*/
|
25 |
public JToggleButton(String text, boolean selected) { |
26 |
super(text, selected);
|
27 |
// TODO Auto-generated constructor stub
|
28 |
} |
29 |
/**
|
30 |
* @param text
|
31 |
* @param icon
|
32 |
*/
|
33 |
public JToggleButton(String text, Icon icon) { |
34 |
super(text, icon);
|
35 |
// TODO Auto-generated constructor stub
|
36 |
} |
37 |
/**
|
38 |
* @param text
|
39 |
* @param icon
|
40 |
* @param selected
|
41 |
*/
|
42 |
public JToggleButton(String text, Icon icon, boolean selected) { |
43 |
super(text, icon, selected);
|
44 |
// TODO Auto-generated constructor stub
|
45 |
} |
46 |
/**
|
47 |
* @param a
|
48 |
*/
|
49 |
public JToggleButton(Action a) { |
50 |
super(a);
|
51 |
// TODO Auto-generated constructor stub
|
52 |
} |
53 |
/**
|
54 |
* @param icon
|
55 |
*/
|
56 |
public JToggleButton(Icon icon) { |
57 |
super(icon);
|
58 |
// TODO Auto-generated constructor stub
|
59 |
} |
60 |
/**
|
61 |
* @param icon
|
62 |
* @param selected
|
63 |
*/
|
64 |
public JToggleButton(Icon icon, boolean selected) { |
65 |
super(icon, selected);
|
66 |
// TODO Auto-generated constructor stub
|
67 |
} |
68 |
private String enableText; |
69 |
private String toolTip; |
70 |
|
71 |
|
72 |
/**
|
73 |
* @return Returns the enableText.
|
74 |
*/
|
75 |
public String getEnableText() { |
76 |
return enableText;
|
77 |
} |
78 |
/**
|
79 |
* @param enableText The enableText to set.
|
80 |
*/
|
81 |
public void setEnableText(String enableText) { |
82 |
this.enableText = enableText;
|
83 |
} |
84 |
|
85 |
|
86 |
/**
|
87 |
* @see java.awt.Component#setVisible(boolean)
|
88 |
*/
|
89 |
public void setEnabled(boolean aFlag) { |
90 |
super.setEnabled(aFlag);
|
91 |
if (aFlag){
|
92 |
setToolTipText(toolTip); |
93 |
}else{
|
94 |
setToolTipText(enableText); |
95 |
} |
96 |
} |
97 |
/**
|
98 |
* @see javax.swing.JComponent#setToolTipText(java.lang.String)
|
99 |
*/
|
100 |
public void setToolTip(String text) { |
101 |
toolTip = text; |
102 |
} |
103 |
} |