Statistics
| Revision:

svn-gvsig-desktop / trunk / frameworks / _fwAndami / src / com / iver / andami / ui / mdiFrame / JMenuItem.java @ 977

History | View | Annotate | Download (1.57 KB)

1
package com.iver.andami.ui.mdiFrame;
2

    
3
import javax.swing.Action;
4
import javax.swing.Icon;
5

    
6
public class JMenuItem extends javax.swing.JMenuItem implements EnableTextSupport{
7
        /**
8
         * 
9
         */
10
        public JMenuItem() {
11
                super();
12
                // TODO Auto-generated constructor stub
13
        }
14
        /**
15
         * @param text
16
         */
17
        public JMenuItem(String text) {
18
                super(text);
19
                // TODO Auto-generated constructor stub
20
        }
21
        /**
22
         * @param text
23
         * @param mnemonic
24
         */
25
        public JMenuItem(String text, int mnemonic) {
26
                super(text, mnemonic);
27
                // TODO Auto-generated constructor stub
28
        }
29
        /**
30
         * @param text
31
         * @param icon
32
         */
33
        public JMenuItem(String text, Icon icon) {
34
                super(text, icon);
35
                // TODO Auto-generated constructor stub
36
        }
37
        /**
38
         * @param a
39
         */
40
        public JMenuItem(Action a) {
41
                super(a);
42
                // TODO Auto-generated constructor stub
43
        }
44
        /**
45
         * @param icon
46
         */
47
        public JMenuItem(Icon icon) {
48
                super(icon);
49
                // TODO Auto-generated constructor stub
50
        }
51
        private String enableText;
52
        private String toolTip = super.getToolTipText();
53
        
54
        
55
        /**
56
         * @return Returns the enableText.
57
         */
58
        public String getEnableText() {
59
                return enableText;
60
        }
61
        /**
62
         * @param enableText The enableText to set.
63
         */
64
        public void setEnableText(String enableText) {
65
                this.enableText = enableText;
66
        }
67
        
68
        
69
        /**
70
         * @see java.awt.Component#setVisible(boolean)
71
         */
72
        public void setEnabled(boolean aFlag) {
73
                super.setEnabled(aFlag);
74
                if (aFlag){
75
                        setToolTipText(toolTip);
76
                }else{
77
                        setToolTipText(enableText);
78
                }
79
        }
80
        /**
81
         * @see javax.swing.JComponent#setToolTipText(java.lang.String)
82
         */
83
        public void setToolTip(String text) {
84
                toolTip = text;
85
        }
86
}