01: package net.xoetrope.builder.editor.helper;
02:
03: import net.xoetrope.builder.editor.XSourceEditor;
04: import java.util.ArrayList;
05: import net.xoetrope.builder.editor.XPageResource;
06: import net.xoetrope.builder.editor.XEditorProject;
07:
08: /**
09: * An abstract helper class to support definitions of code snippets
10: * <p> Copyright (c) Xoetrope Ltd., 2002-2003</p>
11: * <p> $Revision: 1.4 $</p>
12: * <p> License: see License.txt</p>
13: */
14: public abstract class CodeHelper {
15: /**
16: * Construct a new helper
17: */
18: public CodeHelper() {
19: }
20:
21: /**
22: * Register the helper. XEditorProjectManager.getStaticResources() is an array of
23: * static resources and an instance of the helper should be added to this array
24: */
25: public static void register(ArrayList resources) {
26: throw new java.lang.UnsupportedOperationException(
27: "The register() method must be overridden by each helper subclass.");
28: }
29:
30: /**
31: * Insert the new codes
32: */
33: public abstract void doInsert(XSourceEditor editor,
34: XEditorProject currentProject, XPageResource pageRes);
35:
36: /**
37: * Get the caption displayed on the popup menu
38: * @return the caption
39: */
40: public abstract String getCaption();
41:
42: /**
43: * Get the mnemonic key for this item
44: * @return
45: */
46: public abstract Integer getMnemonic();
47: }
|