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 BasePaneRcthTreeConsolePageContext 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: //protected BasePaneBarConsolePageContext(ConsolePageContext inCpc,
035: // int inHeight, int inColumnWidth, String inIconUrls[],
036: // String inIconLabels[], SubmitActionContext inSacs[]) {
037: private BasePaneRcthTreeConsolePageContext(
038: ConsolePageContext inCpc, int inColumnCount, int inHeight,
039: int inBarHeight, int inBarColumnWidth,
040: String inBarIconUrls[], String inBarIconLabels[],
041: SubmitActionContext inBarSac[]) {
042:
043: super (inCpc, NamesForSubCpc.getBasePaneRcthTreeCpcName(),
044: inColumnCount, inHeight, inBarHeight, inBarColumnWidth,
045: inBarIconUrls, inBarIconLabels, inBarSac, "Tree");
046: //
047: //
048: //this.barHeight = inBarHeight;
049: //this.barColumnWidth = inBarColumnWidth;
050: //this.barIconUrls = inBarIconUrls;
051: //this.barIconLabels = inBarIconLabels;
052: //this.barSac = inBarSac;
053: }
054:
055: public final static BasePaneRcthTreeConsolePageContext newInstance(
056: ConsolePageContext inCpc, int inColumnCount, int inHeight,
057: int inBarHeight, int inBarColumnWidth,
058: String inBarIconUrls[], String inBarIconLabels[],
059: SubmitActionContext inBarSac[]) throws IOException {
060:
061: BasePaneRcthTreeConsolePageContext outValue = null;
062:
063: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
064: .getBasePaneRcthTreeCpcName())) {
065: //
066: Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
067: .getBasePaneRcthTreeCpcName());
068: outValue = (BasePaneRcthTreeConsolePageContext) o;
069: } else {
070: outValue = new BasePaneRcthTreeConsolePageContext(inCpc,
071: inColumnCount, inHeight, inBarHeight,
072: inBarColumnWidth, inBarIconUrls, inBarIconLabels,
073: inBarSac);
074: inCpc.registerSubConsolePageContext(NamesForSubCpc
075: .getBasePaneRcthTreeCpcName(), outValue);
076: }
077:
078: outValue.copyFromParent(inCpc);
079: outValue.createConsolePage(inCpc.getWriter(), inCpc
080: .getPageSetupContext());
081:
082: return outValue;
083: }
084:
085: //
086: //protected void getUpContent() throws IOException {
087: // BaseSubPaneBarConsolePageContext.newInstance(
088: // this,
089: // this.barHeight, this.barColumnWidth, this.barIconUrls,
090: // this.barIconLabels, this.barSac);
091: //}
092: //
093: protected boolean isDownContentIdUsed() {
094: return true;
095: }
096:
097: //
098: protected boolean isDownShiftToHighlightHandleUsed() {
099: return false;
100: }
101:
102: protected String getDownShiftToHighlightHandle() {
103: throw UnexpectedSystemException.unknownState();
104: }
105:
106: //
107: protected String getDownContentId() {
108: return this .downContentId;
109: }
110:
111: protected void getDownContent() throws IOException {
112: BaseSubPaneContentConsolePageContext bspccpc = BasePanelessRcthTreeConsolePageContext
113: .newInstance(this );
114: //
115: this.downContentId = bspccpc.getSectionId();
116: }
117: }
|