01: /*
02: * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
03: *
04: * The program is provided "as is" without any warranty express or
05: * implied, including the warranty of non-infringement and the implied
06: * warranties of merchantibility and fitness for a particular purpose.
07: * IBM will not be liable for any damages suffered by you as a result
08: * of using the Program. In no event will IBM be liable for any
09: * special, indirect or consequential damages or lost profits even if
10: * IBM has been advised of the possibility of their occurrence. IBM
11: * will not be liable for any third party claims against you.
12: */
13: package com.ibm.richtext.uiimpl;
14:
15: import com.ibm.richtext.textpanel.MTextPanel;
16: import com.ibm.richtext.uiimpl.resources.MenuData;
17:
18: public abstract class SingleCheckMenuItem extends MenuItemSet {
19:
20: static final String COPYRIGHT = "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
21: protected MItem fItem;
22:
23: SingleCheckMenuItem(MenuData menuData) {
24:
25: fItem = MItem.createCheckboxItem(menuData);
26: }
27:
28: abstract void setChecked();
29:
30: protected final void textPanelChanged() {
31:
32: MTextPanel textPanel = getTextPanel();
33: if (textPanel == null) {
34: fItem.setEnabled(false);
35: fItem.setState(false);
36: } else {
37: fItem.setEnabled(true);
38: setChecked();
39: }
40: }
41: }
|