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.demo;
14:
15: import java.awt.Menu;
16: import java.awt.MenuItem;
17:
18: final class AwtFileMenuManager extends FileMenuManager {
19:
20: private Menu fMenu;
21:
22: public AwtFileMenuManager(Menu menu, EditApplication application,
23: DocumentWindow document, boolean supportStyledFormat,
24: boolean supportPlainFormat) {
25:
26: super (application, document);
27:
28: fMenu = menu;
29: createItems(supportStyledFormat, supportPlainFormat);
30: fMenu = null;
31: }
32:
33: protected Object addMenuItem(String key) {
34:
35: MenuItem item = ResourceUtils.createMenuItem(key);
36: item.addActionListener(this );
37: fMenu.add(item);
38: return item;
39: }
40:
41: protected void addSeparator() {
42:
43: fMenu.add(new MenuItem("-"));
44: }
45: }
|