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;
009:
010: //base classes
011: import java.util.ArrayList;
012:
013: //project specific classes
014: import org.jfolder.common.UnexpectedSystemException;
015: import org.jfolder.common.web.template.ConsoleTemplateContext;
016: import org.jfolder.common.web.template.SubmitActionContext;
017: import org.jfolder.console.base.ConsolePageContext;
018:
019: //other classes
020:
021: public abstract class BaseSubConsolePageContext extends
022: ConsolePageContext {
023:
024: private String fromPage = null;
025: //private String handleExtension = null;
026: private String aliasHandle = null;
027: //
028: private ConsolePageContext parentCpc = null;
029:
030: protected BaseSubConsolePageContext(ConsolePageContext inCpc,
031: String inName) {
032:
033: super (inCpc, inName);
034: setColumnWidth(inCpc.getColumnWidth());
035: this .fromPage = inCpc.getFromPage();
036: //this.handleExtension = inCpc.getHandleExtension();
037: this .aliasHandle = inCpc.getAliasHandle();
038: //
039: this .parentCpc = inCpc;
040: }
041:
042: //
043: protected ConsolePageContext getParentCpc() {
044: return this .parentCpc;
045: }
046:
047: //
048: protected SubmitActionContext createRefreshSac() {
049:
050: //
051: return getParentCpc().createRefreshSac();
052: }
053:
054: //
055: public void registerSubConsolePageContext(String inName,
056: ConsoleTemplateContext inSubCpc) {
057: //
058: this .parentCpc.registerSubConsolePageContext(inName, inSubCpc);
059: }
060:
061: public boolean isSubConsolePageContextPresent(String inName) {
062: //
063: return this .parentCpc.isSubConsolePageContextPresent(inName);
064: }
065:
066: public ConsoleTemplateContext getSubConsolePageContext(String inName) {
067: //
068: //ConsoleTemplateContext outValue = null;
069: //
070: //outValue.setLongestRowWidth(0);
071:
072: return this .parentCpc.getSubConsolePageContext(inName);
073: }
074:
075: public String getFromPage() {
076: return this .fromPage;
077: }
078:
079: //public String getHandleExtension() {
080: // return this.handleExtension;
081: //}
082:
083: public String getAliasHandle() {
084: return this .aliasHandle;
085: }
086:
087: //
088: //public boolean isMetaMode() {
089: // return this.parentCpc.isMetaMode();
090: //}
091: //
092: //
093: //
094: //
095: //
096: //
097: //
098: public String getTreeState() {
099: return this .parentCpc.getTreeState();
100: }
101:
102: public void setTreeState(String inTreeState) {
103: this .parentCpc.setTreeState(inTreeState);
104: }
105:
106: public String getSubSectionPosition() {
107: return this .parentCpc.getSubSectionPosition();
108: }
109:
110: public void setSubSectionPosition(String inSubSectionPosition) {
111: this .parentCpc.setSubSectionPosition(inSubSectionPosition);
112: }
113:
114: public ArrayList getTreeStateAsArrayList() {
115: return this .parentCpc.getTreeStateAsArrayList();
116: }
117:
118: public boolean isTreeComponentPresent(String inTreeComponent) {
119: return this .parentCpc.isTreeComponentPresent(inTreeComponent);
120: }
121:
122: public void addTreeComponent(String inTreeComponent) {
123: this .parentCpc.addTreeComponent(inTreeComponent);
124: }
125:
126: public void removeTreeComponent(String inTreeComponent) {
127: this .parentCpc.removeTreeComponent(inTreeComponent);
128: }
129:
130: public void setTreeState(ArrayList inTreeComponents) {
131: this .parentCpc.setTreeState(inTreeComponents);
132: }
133:
134: //
135: //
136: //
137: //
138: //
139: //
140: //
141: public String getHighlightHandle() {
142: return this .parentCpc.getHighlightHandle();
143: }
144:
145: public void setHighlightHandle(String inHandle) {
146: throw UnexpectedSystemException.unknownState();
147: }
148:
149: //
150: public void considerDefaultSettings() {
151: throw UnexpectedSystemException.unknownState();
152: }
153:
154: public void setDefaultHighlighHandle(String inHandle) {
155: this .parentCpc.setDefaultHighlightHandle(inHandle);
156: }
157:
158: public void addDefaultTreeBranch(String inHandle) {
159: this .parentCpc.addDefaultTreeBranch(inHandle);
160: }
161:
162: //public int getLongestRowWidth() {
163: // return this.parentCpc.getLongestRowWidth();
164: //}
165:
166: //////////////////////
167: public int getLongestRowWidth() {
168:
169: int outValue = super .getLongestRowWidth();
170:
171: return outValue;
172: }
173: //protected void popMetaTable() {
174: //
175: // //MiscHelper.println("BaSuCoPagCon pre-long = "+getLongestRowWidth());
176: // super.popMetaTable();
177: // //MiscHelper.println("BaSuCoPagCon pos-long = "+getLongestRowWidth());
178: //
179: //}
180: }
|