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.develop.web.page;
09:
10: //base classes
11: import java.io.IOException;
12:
13: //project specific classes
14: import org.jfolder.common.UnexpectedSystemException;
15: import org.jfolder.common.web.template.SubmitActionContext;
16: import org.jfolder.console.base.ConsolePageContext;
17: import org.jfolder.console.base.NamesForSubCpc;
18: import org.jfolder.console.base.context.BaseSubPaneConsolePageContext;
19: import org.jfolder.console.base.context.BaseSubPaneContentConsolePageContext;
20:
21: //other classes
22:
23: public class DevelopWebPagePaneViewContext extends
24: BaseSubPaneConsolePageContext {
25:
26: //
27: private String downContentId = null;
28:
29: //
30: private DevelopWebPagePaneViewContext(ConsolePageContext inCpc,
31: int inColumnCount, int inHeight, int inBarHeight,
32: int inBarColumnWidth, String inBarIconUrls[],
33: String inBarIconLabels[], SubmitActionContext inBarSac[]) {
34:
35: super (inCpc, NamesForSubCpc.getDevelopWebPagePaneViewCpcName(),
36: inColumnCount, inHeight, inBarHeight, inBarColumnWidth,
37: inBarIconUrls, inBarIconLabels, inBarSac, "View");
38: //
39: }
40:
41: public final static DevelopWebPagePaneViewContext newInstance(
42: ConsolePageContext inCpc, int inColumnCount, int inHeight,
43: int inBarHeight, int inBarColumnWidth,
44: String inBarIconUrls[], String inBarIconLabels[],
45: SubmitActionContext inBarSac[]) throws IOException {
46:
47: DevelopWebPagePaneViewContext outValue = null;
48:
49: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
50: .getDevelopWebPagePaneViewCpcName())) {
51: //
52: Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
53: .getDevelopWebPagePaneViewCpcName());
54: outValue = (DevelopWebPagePaneViewContext) o;
55: } else {
56: outValue = new DevelopWebPagePaneViewContext(inCpc,
57: inColumnCount, inHeight, inBarHeight,
58: inBarColumnWidth, inBarIconUrls, inBarIconLabels,
59: inBarSac);
60: inCpc.registerSubConsolePageContext(NamesForSubCpc
61: .getDevelopWebPagePaneViewCpcName(), outValue);
62: }
63:
64: outValue.copyFromParent(inCpc);
65: outValue.createConsolePage(inCpc.getWriter(), inCpc
66: .getPageSetupContext());
67:
68: return outValue;
69: }
70:
71: //
72: protected boolean isDownContentIdUsed() {
73: return true;
74: }
75:
76: //
77: protected boolean isDownShiftToHighlightHandleUsed() {
78: return false;
79: }
80:
81: protected String getDownShiftToHighlightHandle() {
82: throw UnexpectedSystemException.unknownState();
83: }
84:
85: //
86: protected String getDownContentId() {
87: return this .downContentId;
88: }
89:
90: protected void getDownContent() throws IOException {
91: //
92: BaseSubPaneContentConsolePageContext bspccpc = DevelopWebPagePanelessViewContext
93: .newInstance(this );
94: //
95: this.downContentId = bspccpc.getSectionId();
96: }
97: }
|