001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.console.base.context;
009:
010: //base classes
011: import java.io.IOException;
012:
013: //project specific classes
014: import org.jfolder.common.UnexpectedSystemException;
015: import org.jfolder.common.web.template.SubmitActionContext;
016: import org.jfolder.console.base.ConsolePageContext;
017: import org.jfolder.console.base.NamesForSubCpc;
018:
019: //other classes
020:
021: public class BasePaneRcthTextConsolePageContext extends
022: BaseSubPaneConsolePageContext {
023:
024: //
025: private String downContentId = null;
026:
027: //
028: //private int barHeight = 0;
029: //private int barColumnWidth = 0;
030: //private String barIconUrls[] = null;
031: //private String barIconLabels[] = null;
032: //private SubmitActionContext barSac[] = null;
033:
034: private BasePaneRcthTextConsolePageContext(
035: ConsolePageContext inCpc, int inColumnCount, int inHeight,
036: int inBarHeight, int inBarColumnWidth,
037: String inBarIconUrls[], String inBarIconLabels[],
038: SubmitActionContext inBarSac[]) {
039:
040: super (inCpc, NamesForSubCpc.getBasePaneRcthTextCpcName(),
041: inColumnCount, inHeight, inBarHeight, inBarColumnWidth,
042: inBarIconUrls, inBarIconLabels, inBarSac, "Text");
043: //
044: //
045: //this.barHeight = inBarHeight;
046: //this.barColumnWidth = inBarColumnWidth;
047: //this.barIconUrls = inBarIconUrls;
048: //this.barIconLabels = inBarIconLabels;
049: //this.barSac = inBarSac;
050: }
051:
052: public final static BasePaneRcthTextConsolePageContext newInstance(
053: ConsolePageContext inCpc, int inColumnCount, int inHeight,
054: int inBarHeight, int inBarColumnWidth,
055: String inBarIconUrls[], String inBarIconLabels[],
056: SubmitActionContext inBarSac[]) throws IOException {
057:
058: BasePaneRcthTextConsolePageContext outValue = null;
059:
060: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
061: .getBasePaneRcthTextCpcName())) {
062: //
063: Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
064: .getBasePaneRcthTextCpcName());
065: outValue = (BasePaneRcthTextConsolePageContext) o;
066: } else {
067: outValue = new BasePaneRcthTextConsolePageContext(inCpc,
068: inColumnCount, inHeight, inBarHeight,
069: inBarColumnWidth, inBarIconUrls, inBarIconLabels,
070: inBarSac);
071: inCpc.registerSubConsolePageContext(NamesForSubCpc
072: .getBasePaneRcthTextCpcName(), outValue);
073: }
074:
075: outValue.copyFromParent(inCpc);
076: outValue.createConsolePage(inCpc.getWriter(), inCpc
077: .getPageSetupContext());
078:
079: return outValue;
080: }
081:
082: //
083: protected boolean isDownContentIdUsed() {
084: return true;
085: }
086:
087: //
088: protected boolean isDownShiftToHighlightHandleUsed() {
089: return false;
090: }
091:
092: protected String getDownShiftToHighlightHandle() {
093: throw UnexpectedSystemException.unknownState();
094: }
095:
096: //
097: protected String getDownContentId() {
098: return this .downContentId;
099: }
100:
101: protected void getDownContent() throws IOException {
102: BaseSubPaneContentConsolePageContext bspccpc = BasePanelessRcthTextConsolePageContext
103: .newInstance(this );
104: //
105: this.downContentId = bspccpc.getSectionId();
106: }
107: }
|