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.web.template.PageSetupContext;
015: import org.jfolder.common.web.template.SubmitActionContext;
016: import org.jfolder.console.base.ConsolePageContext;
017: import org.jfolder.console.base.ConsolePageSession;
018: import org.jfolder.console.base.NamesForSubCpc;
019:
020: //other classes
021:
022: public class BasePaneRcthEditConsolePageContext extends
023: BaseSubPaneConsolePageContext {
024:
025: //
026: private String downContentId = null;
027: private String downShiftToHighlightHandle = null;
028:
029: //
030: private BasePaneRcthEditConsolePageContext(
031: ConsolePageContext inCpc, int inColumnCount, int inHeight,
032: int inBarHeight, int inBarColumnWidth,
033: String inBarIconUrls[], String inBarIconLabels[],
034: SubmitActionContext inBarSac[]) {
035:
036: super (inCpc, NamesForSubCpc.getBasePaneRcthEditCpcName(),
037: inColumnCount, inHeight, inBarHeight, inBarColumnWidth,
038: inBarIconUrls, inBarIconLabels, inBarSac, "Edit");
039: //
040: }
041:
042: public final static BasePaneRcthEditConsolePageContext newInstance(
043: ConsolePageContext inCpc, int inColumnCount, int inHeight,
044: int inBarHeight, int inBarColumnWidth,
045: String inBarIconUrls[], String inBarIconLabels[],
046: SubmitActionContext inBarSac[]) throws IOException {
047:
048: BasePaneRcthEditConsolePageContext outValue = null;
049:
050: if (inCpc.isSubConsolePageContextPresent(NamesForSubCpc
051: .getBasePaneRcthEditCpcName())) {
052: //
053: Object o = inCpc.getSubConsolePageContext(NamesForSubCpc
054: .getBasePaneRcthEditCpcName());
055: outValue = (BasePaneRcthEditConsolePageContext) o;
056: } else {
057: outValue = new BasePaneRcthEditConsolePageContext(inCpc,
058: inColumnCount, inHeight, inBarHeight,
059: inBarColumnWidth, inBarIconUrls, inBarIconLabels,
060: inBarSac);
061: inCpc.registerSubConsolePageContext(NamesForSubCpc
062: .getBasePaneRcthEditCpcName(), outValue);
063: }
064:
065: outValue.copyFromParent(inCpc);
066: outValue.createConsolePage(inCpc.getWriter(), inCpc
067: .getPageSetupContext());
068:
069: return outValue;
070: }
071:
072: //
073: //
074: //
075: protected boolean isDownContentIdUsed() {
076:
077: boolean outValue = false;
078:
079: ConsolePageSession localCps = getConsolePageSession();
080: //return true;
081: PageSetupContext localPsc = localCps.getPageSetupContext();
082: outValue = !localPsc.isHighlighHandleUpdated();
083:
084: return outValue;
085: }
086:
087: //
088: protected boolean isDownShiftToHighlightHandleUsed() {
089: return !isDownContentIdUsed();
090: }
091:
092: protected String getDownShiftToHighlightHandle() {
093: return this .downShiftToHighlightHandle;
094: //throw UnexpectedSystemException.unknownState();
095: }
096:
097: //
098: protected String getDownContentId() {
099: return this .downContentId;
100: }
101:
102: protected void getDownContent() throws IOException {
103:
104: BaseSubPaneContentConsolePageContext bspccpc = BasePanelessRcthEditConsolePageContext
105: .newInstance(this );
106: //
107: this.downContentId = bspccpc.getSectionId();
108: this.downShiftToHighlightHandle = bspccpc
109: .getDownShiftToHighlightHandle();
110: }
111: }
|