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.util.ListResourceBundle;
16: import java.awt.event.KeyEvent;
17:
18: public final class EditorResources extends ListResourceBundle {
19:
20: static final String COPYRIGHT = "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
21: // menu names - values are Strings
22: public static final String FILE = "File";
23:
24: // file menu items - values are MenuData instances
25: public static final String NEW = "New";
26: public static final String NEW_WINDOW = "New Window";
27: public static final String OPEN = "Open...";
28: public static final String SAVE = "Save";
29: public static final String SAVE_AS = "Save As...";
30: public static final String SAVE_AS_STYLED = "Save As Styled Text...";
31: public static final String SAVE_AS_TEXT = "Save As Plain Text...";
32: public static final String CLOSE = "Close";
33: public static final String PRINT = "Print";
34: public static final String EXIT = "Exit";
35:
36: // button labels - values are Strings
37: public static final String YES = "Yes";
38: public static final String NO = "No";
39: public static final String CANCEL = "Cancel";
40:
41: // message strings - values are Strings
42: public static final String SAVE_MSG = "Save {0} before closing?";
43: public static final String UNTITLED_MSG = "Untitled {0}";
44:
45: // window and dialog titles - values are Strings
46: public static final String OPEN_TITLE = "Open Document";
47: public static final String SAVE_TITLE = "Save As";
48:
49: /**
50: * Convenience method that returns a two-element
51: * Object array. The first element is name, the
52: * second is a MenuData instance with the given
53: * shortcut.
54: */
55: private static Object[] makeEntry(String name, char shortCut,
56: int keyCode) {
57:
58: return new Object[] { name,
59: new MenuData(name, shortCut, keyCode) };
60: }
61:
62: /**
63: * Convenience method that returns a two-element
64: * Object array. The first element is name, the
65: * second is a MenuData instance.
66: */
67: private static Object[] makeEntry(String name) {
68:
69: return new Object[] { name, new MenuData(name) };
70: }
71:
72: /**
73: * Convenience method that returns a two-element
74: * Object array in which both elements are obj.
75: */
76: private static Object[] duplicate(Object obj) {
77:
78: return new Object[] { obj, obj };
79: }
80:
81: protected Object[][] getContents() {
82:
83: return new Object[][] { duplicate(FILE), duplicate(YES),
84: duplicate(NO), duplicate(CANCEL), duplicate(SAVE_MSG),
85: duplicate(SAVE_TITLE), duplicate(OPEN_TITLE),
86: duplicate(UNTITLED_MSG),
87: makeEntry(NEW, 'n', KeyEvent.VK_N),
88: makeEntry(NEW_WINDOW),
89: makeEntry(OPEN, 'o', KeyEvent.VK_O),
90: makeEntry(SAVE, 's', KeyEvent.VK_S),
91: makeEntry(SAVE_AS), makeEntry(SAVE_AS_STYLED),
92: makeEntry(SAVE_AS_TEXT), makeEntry(CLOSE),
93: makeEntry(PRINT), makeEntry(EXIT), };
94: }
95: }
|