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