2 * (C) Copyright IBM Corp. 1998-2004. All Rights Reserved.
\r
4 * The program is provided "as is" without any warranty express or
\r
5 * implied, including the warranty of non-infringement and the implied
\r
6 * warranties of merchantibility and fitness for a particular purpose.
\r
7 * IBM will not be liable for any damages suffered by you as a result
\r
8 * of using the Program. In no event will IBM be liable for any
\r
9 * special, indirect or consequential damages or lost profits even if
\r
10 * IBM has been advised of the possibility of their occurrence. IBM
\r
11 * will not be liable for any third party claims against you.
\r
13 package com.ibm.richtext.demo;
\r
15 import java.util.ListResourceBundle;
\r
16 import java.awt.event.KeyEvent;
\r
18 public final class EditorResources extends ListResourceBundle {
\r
20 static final String COPYRIGHT =
\r
21 "(C) Copyright IBM Corp. 1998-1999 - All Rights Reserved";
\r
22 // menu names - values are Strings
\r
23 public static final String FILE = "File";
\r
25 // file menu items - values are MenuData instances
\r
26 public static final String NEW = "New";
\r
27 public static final String NEW_WINDOW = "New Window";
\r
28 public static final String OPEN = "Open...";
\r
29 public static final String SAVE = "Save";
\r
30 public static final String SAVE_AS = "Save As...";
\r
31 public static final String SAVE_AS_STYLED = "Save As Styled Text...";
\r
32 public static final String SAVE_AS_TEXT = "Save As Plain Text...";
\r
33 public static final String CLOSE = "Close";
\r
34 public static final String PRINT = "Print";
\r
35 public static final String EXIT = "Exit";
\r
37 // button labels - values are Strings
\r
38 public static final String YES = "Yes";
\r
39 public static final String NO = "No";
\r
40 public static final String CANCEL = "Cancel";
\r
42 // message strings - values are Strings
\r
43 public static final String SAVE_MSG = "Save {0} before closing?";
\r
44 public static final String UNTITLED_MSG = "Untitled {0}";
\r
46 // window and dialog titles - values are Strings
\r
47 public static final String OPEN_TITLE = "Open Document";
\r
48 public static final String SAVE_TITLE = "Save As";
\r
51 * Convenience method that returns a two-element
\r
52 * Object array. The first element is name, the
\r
53 * second is a MenuData instance with the given
\r
56 private static Object[] makeEntry(String name,
\r
60 return new Object[] { name, new MenuData(name, shortCut, keyCode) };
\r
64 * Convenience method that returns a two-element
\r
65 * Object array. The first element is name, the
\r
66 * second is a MenuData instance.
\r
68 private static Object[] makeEntry(String name) {
\r
70 return new Object[] { name, new MenuData(name) };
\r
74 * Convenience method that returns a two-element
\r
75 * Object array in which both elements are obj.
\r
77 private static Object[] duplicate(Object obj) {
\r
79 return new Object[] { obj, obj };
\r
82 protected Object[][] getContents() {
\r
84 return new Object[][] {
\r
89 duplicate(SAVE_MSG),
\r
90 duplicate(SAVE_TITLE),
\r
91 duplicate(OPEN_TITLE),
\r
92 duplicate(UNTITLED_MSG),
\r
93 makeEntry(NEW, 'n', KeyEvent.VK_N),
\r
94 makeEntry(NEW_WINDOW),
\r
95 makeEntry(OPEN, 'o', KeyEvent.VK_O),
\r
96 makeEntry(SAVE, 's', KeyEvent.VK_S),
\r
98 makeEntry(SAVE_AS_STYLED),
\r
99 makeEntry(SAVE_AS_TEXT),
\r