001: /*
002: *
003: * Copyright (c) 2004 SourceTap - www.sourcetap.com
004: *
005: * The contents of this file are subject to the SourceTap Public License
006: * ("License"); You may not use this file except in compliance with the
007: * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
008: * Software distributed under the License is distributed on an "AS IS" basis,
009: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
010: * the specific language governing rights and limitations under the License.
011: *
012: * The above copyright notice and this permission notice shall be included
013: * in all copies or substantial portions of the Software.
014: *
015: */
016:
017: package com.sourcetap.sfa.ui;
018:
019: import org.ofbiz.base.util.UtilCache;
020:
021: /**
022: * DOCUMENT ME!
023: *
024: */
025: public class UICache extends UtilCache {
026: private static final boolean DEBUG = false;
027:
028: public UICache() {
029: super ("UI Cache");
030: }
031:
032: /**
033: * DOCUMENT ME!
034: *
035: * @param attributeId
036: *
037: * @return
038: */
039: public UIAttribute getUiAttribute(String attributeId) {
040: return (UIAttribute) (get("UIAttribute_" + attributeId));
041: }
042:
043: /**
044: * DOCUMENT ME!
045: *
046: * @param attributeId
047: * @param uiAttribute
048: */
049: public synchronized void putUiAttribute(String attributeId,
050: UIAttribute uiAttribute) {
051: put("UIAttribute_" + attributeId, uiAttribute);
052: }
053:
054: /**
055: * DOCUMENT ME!
056: *
057: * @param attributeId
058: */
059: public synchronized void removeUiAttribute(String attributeId) {
060: remove("UIAttribute_" + attributeId);
061: }
062:
063: /**
064: * DOCUMENT ME!
065: *
066: * @param displayObjectId
067: *
068: * @return
069: */
070: public UIDisplayObject getUiDisplayObject(String displayObjectId) {
071: return (UIDisplayObject) (get("UIDisplayObject_"
072: + displayObjectId));
073: }
074:
075: /**
076: * DOCUMENT ME!
077: *
078: * @param displayObjectId
079: * @param uiDisplayObject
080: */
081: public synchronized void putUiDisplayObject(String displayObjectId,
082: UIDisplayObject uiDisplayObject) {
083: put("UIDisplayObject_" + displayObjectId, uiDisplayObject);
084: }
085:
086: /**
087: * DOCUMENT ME!
088: *
089: * @param displayObjectId
090: */
091: public synchronized void removeUiDisplayObject(
092: String displayObjectId) {
093: remove("UIDisplayObject_" + displayObjectId);
094: }
095:
096: /**
097: * DOCUMENT ME!
098: *
099: * @param entityId
100: *
101: * @return
102: */
103: public UIEntity getUiEntity(String entityId) {
104: return (UIEntity) (get("UIEntity_" + entityId));
105: }
106:
107: /**
108: * DOCUMENT ME!
109: *
110: * @param entityId
111: * @param uiEntity
112: */
113: public synchronized void putUiEntity(String entityId,
114: UIEntity uiEntity) {
115: put("UIEntity_" + entityId, uiEntity);
116: }
117:
118: /**
119: * DOCUMENT ME!
120: *
121: * @param entityId
122: */
123: public synchronized void removeUiEntity(String entityId) {
124: remove("UIEntity_" + entityId);
125: }
126:
127: /**
128: * DOCUMENT ME!
129: *
130: * @param sectionId
131: * @param partyId
132: * @param attributeId
133: *
134: * @return
135: */
136: public UIFieldInfo getUiFieldInfo(String sectionId, String partyId,
137: String attributeId) {
138: return (UIFieldInfo) (get("UIFieldInfo_" + sectionId + "_"
139: + partyId + "_" + attributeId));
140: }
141:
142: /**
143: * DOCUMENT ME!
144: *
145: * @param sectionId
146: * @param partyId
147: * @param attributeId
148: * @param uiFieldInfo
149: */
150: public synchronized void putUiFieldInfo(String sectionId,
151: String partyId, String attributeId, UIFieldInfo uiFieldInfo) {
152: put("UIFieldInfo_" + sectionId + "_" + partyId + "_"
153: + attributeId, uiFieldInfo);
154: }
155:
156: /**
157: * DOCUMENT ME!
158: *
159: * @param sectionId
160: * @param partyId
161: * @param attributeId
162: */
163: public synchronized void removeUiFieldInfo(String sectionId,
164: String partyId, String attributeId) {
165: remove("UIFieldInfo_" + sectionId + "_" + partyId + "_"
166: + attributeId);
167: }
168:
169: /**
170: * DOCUMENT ME!
171: *
172: * @param screenName
173: *
174: * @return
175: */
176: public UIScreen getUiScreen(String screenName) {
177: return (UIScreen) (get("UIScreen_" + screenName));
178: }
179:
180: /**
181: * DOCUMENT ME!
182: *
183: * @param screenName
184: * @param uiScreen
185: */
186: public synchronized void putUiScreen(String screenName,
187: UIScreen uiScreen) {
188: put("UIScreen_" + screenName, uiScreen);
189: }
190:
191: /**
192: * DOCUMENT ME!
193: *
194: * @param screenName
195: */
196: public synchronized void removeUiScreen(String screenName) {
197: remove("UIScreen_" + screenName);
198: }
199:
200: /**
201: * DOCUMENT ME!
202: *
203: * @param screenName
204: * @param sectionName
205: * @param partyId
206: *
207: * @return
208: */
209: public UIScreenSection getUiScreenSection(String screenName,
210: String sectionName, String partyId) {
211: return (UIScreenSection) (get("UIScreenSection_" + screenName
212: + "_" + sectionName + "_" + partyId));
213: }
214:
215: /**
216: * DOCUMENT ME!
217: *
218: * @param screenName
219: * @param sectionName
220: * @param partyId
221: * @param uiScreenSection
222: */
223: public synchronized void putUiScreenSection(String screenName,
224: String sectionName, String partyId,
225: UIScreenSection uiScreenSection) {
226: put("UIScreenSection_" + screenName + "_" + sectionName + "_"
227: + partyId, uiScreenSection);
228: }
229:
230: /**
231: * DOCUMENT ME!
232: *
233: * @param screenName
234: * @param sectionName
235: * @param partyId
236: */
237: public synchronized void removeUiScreenSection(String screenName,
238: String sectionName, String partyId) {
239: remove("UIScreenSection_" + screenName + "_" + sectionName
240: + "_" + partyId);
241: }
242:
243: /**
244: * DOCUMENT ME!
245: *
246: * @param sectionId
247: * @param entityId
248: *
249: * @return
250: */
251: public UIScreenSectionEntity getUiScreenSectionEntity(
252: String sectionId, String entityId) {
253: return (UIScreenSectionEntity) (get("UIScreenSectionEntity_"
254: + sectionId + "_" + entityId));
255: }
256:
257: /**
258: * DOCUMENT ME!
259: *
260: * @param sectionId
261: * @param entityId
262: * @param uiScreenSectionEntity
263: */
264: public synchronized void putUiScreenSectionEntity(String sectionId,
265: String entityId, UIScreenSectionEntity uiScreenSectionEntity) {
266: put("UIScreenSectionEntity_" + sectionId + "_" + entityId,
267: uiScreenSectionEntity);
268: }
269:
270: /**
271: * DOCUMENT ME!
272: *
273: * @param sectionId
274: * @param entityId
275: */
276: public synchronized void removeUiScreenSectionEntity(
277: String sectionId, String entityId) {
278: remove("UIScreenSectionEntity_" + sectionId + "_" + entityId);
279: }
280: }
|