01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.console.web.admin.macro.studio;
09:
10: //base classes
11: import java.io.IOException;
12: import java.util.HashMap;
13:
14: //project specific classes
15: import org.jfolder.common.utils.xml.XMLHelper;
16: import org.jfolder.common.web.template.SubmitActionContext;
17: import org.jfolder.console.base.ConsolePageContext;
18: import org.jfolder.console.base.NamesForSubCpc;
19: import org.jfolder.console.base.context.BaseSubUpDownConsolePageContext;
20:
21: //other classes
22:
23: public class ConsoleMacroUpDownContext extends
24: BaseSubUpDownConsolePageContext {
25:
26: private ConsoleMacroUpDownContext(ConsolePageContext inCpc,
27: String inUpName, String inDownName) {
28:
29: super (inCpc, inUpName, inDownName);
30: }
31:
32: protected final static ConsoleMacroUpDownContext newInstance(
33: ConsolePageContext inCpc, String inUpName, String inDownName)
34: throws IOException {
35:
36: ConsoleMacroUpDownContext outValue = null;
37:
38: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
39: .getBaseSubUpDownCpcName(inUpName, inDownName))) {
40: //
41: Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
42: .getBaseSubUpDownCpcName(inUpName, inDownName));
43: outValue = (ConsoleMacroUpDownContext) o;
44: } else {
45: outValue = new ConsoleMacroUpDownContext(inCpc, inUpName,
46: inDownName);
47: inCpc.registerSubConsolePageContext(NamesForSubCpc
48: .getBaseSubUpDownCpcName(inUpName, inDownName),
49: outValue);
50: }
51:
52: outValue.copyFromParent(inCpc);
53: outValue.createConsolePage(inCpc.getWriter(), inCpc
54: .getPageSetupContext());
55:
56: return outValue;
57: }
58:
59: //
60: public int getUpDownWidth() {
61: return 4;
62: }
63:
64: public void renderUpPane() throws IOException {
65: simpleAndPrint("Up");
66: }
67:
68: public void renderDownPane() throws IOException {
69: ConsoleMacroLeftRightContext.newInstance(this , 1, 3, "tree",
70: "tag");
71: }
72:
73: }
|