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.BasePaneRcthEditConsolePageContext;
20: import org.jfolder.console.base.context.BasePaneRcthTreeConsolePageContext;
21: import org.jfolder.console.base.context.BaseSubLeftRightConsolePageContext;
22:
23: //other classes
24:
25: public class ConsoleMacroLeftRightContext extends
26: BaseSubLeftRightConsolePageContext {
27:
28: //
29: private int leftWidth = 0;
30: private int rightWidth = 0;
31:
32: private ConsoleMacroLeftRightContext(ConsolePageContext inCpc,
33: int inLeftWidth, int inRightWidth, String inLeftName,
34: String inRightName) {
35:
36: super (inCpc, inLeftName, inRightName);
37: this .leftWidth = inLeftWidth;
38: this .rightWidth = inRightWidth;
39: }
40:
41: protected final static ConsoleMacroLeftRightContext newInstance(
42: ConsolePageContext inCpc, int inLeftWidth,
43: int inRightWidth, String inLeftName, String inRightName)
44: throws IOException {
45:
46: ConsoleMacroLeftRightContext outValue = null;
47:
48: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
49: .getBaseSubLeftRightCpcName(inLeftName, inRightName))) {
50: //
51: Object o = inCpc
52: .getSubConsolePageContext(NamesForSubCpc
53: .getBaseSubLeftRightCpcName(inLeftName,
54: inRightName));
55: outValue = (ConsoleMacroLeftRightContext) o;
56: } else {
57: outValue = new ConsoleMacroLeftRightContext(inCpc,
58: inLeftWidth, inRightWidth, inLeftName, inRightName);
59: inCpc.registerSubConsolePageContext(
60: NamesForSubCpc.getBaseSubLeftRightCpcName(
61: inLeftName, inRightName), outValue);
62: }
63:
64: outValue.copyFromParent(inCpc);
65: outValue.createConsolePage(inCpc.getWriter(), inCpc
66: .getPageSetupContext());
67:
68: return outValue;
69: }
70:
71: //
72: public int getLeftWidth() {
73: return this .leftWidth;
74: }
75:
76: public void renderLeftPane() throws IOException {
77: BasePaneRcthTreeConsolePageContext.newInstance(this ,
78: this .leftWidth, getColumnWidth(), 50, 50,
79: new String[0], new String[0],
80: new SubmitActionContext[0]);
81: }
82:
83: //
84: public int getRightWidth() {
85: return this .rightWidth;
86: }
87:
88: public void renderRightPane() throws IOException {
89: BasePaneRcthEditConsolePageContext.newInstance(this ,
90: this .rightWidth, getColumnWidth(), 50, 50,
91: new String[0], new String[0],
92: new SubmitActionContext[0]);
93: }
94: //
95: }
|