01: //WebOnSwing - Web Application Framework
02: //Copyright (C) 2003 Fernando Damian Petrola
03: //
04: //This library is free software; you can redistribute it and/or
05: //modify it under the terms of the GNU Lesser General Public
06: //License as published by the Free Software Foundation; either
07: //version 2.1 of the License, or (at your option) any later version.
08: //
09: //This library is distributed in the hope that it will be useful,
10: //but WITHOUT ANY WARRANTY; without even the implied warranty of
11: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: //Lesser General Public License for more details.
13: //
14: //You should have received a copy of the GNU Lesser General Public
15: //License along with this library; if not, write to the Free Software
16: //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17:
18: package net.ar.webonswing.managers.contributors;
19:
20: import net.ar.webonswing.managers.persistence.*;
21: import net.ar.webonswing.managers.script.*;
22: import net.ar.webonswing.managers.styles.*;
23: import net.ar.webonswing.ui.*;
24: import net.ar.webonswing.visitor.*;
25:
26: /**
27: * Sirve para visitar contribuciones y llamar la operacion especifica de cada tipo de contribuidor,
28: * pasandole a cada uno el administrador correspondiente.
29: *
30: * @author Fernando Damian Petrola
31: */
32: public class ContributionContainer implements ContributorVisitor {
33: StyleContributionContainer theStylesContainer;
34: ScriptContributionContainer theScriptsContainer;
35: PersistenceContributionContainer thePersistenceContributionsContainer;
36:
37: public ContributionContainer(
38: ScriptContributionContainer anScriptsContainer,
39: StyleContributionContainer anStylesContainer,
40: PersistenceContributionContainer aPersistenceDataContainer) {
41: theScriptsContainer = anScriptsContainer;
42: theStylesContainer = anStylesContainer;
43: thePersistenceContributionsContainer = aPersistenceDataContainer;
44: }
45:
46: public void visitScriptContributor(ScriptContributor aContributor) {
47: aContributor.doScriptContribution(theScriptsContainer);
48: }
49:
50: public void visitStyleContributor(StyleContributor aContributor) {
51: aContributor.doStyleContribution(theStylesContainer);
52: }
53:
54: public void visitPersistenceContributor(
55: PersistenceContributor aContributor) {
56: aContributor
57: .doPersistenceContribution(thePersistenceContributionsContainer);
58: }
59:
60: public void visitRenderingContributor(
61: ComponentUIContributor aContributor) {
62: }
63:
64: public void visit(Visitable aVisitable) {
65: }
66:
67: public ScriptContributionContainer getScriptManager() {
68: return theScriptsContainer;
69: }
70:
71: public StyleContributionContainer getStyleManager() {
72: return theStylesContainer;
73: }
74:
75: public void setScriptManager(ScriptContributionContainer aManager) {
76: theScriptsContainer = aManager;
77: }
78:
79: public void setStyleManager(StyleContributionContainer aManager) {
80: theStylesContainer = aManager;
81: }
82:
83: public PersistenceContributionContainer getPersistenceContainer() {
84: return thePersistenceContributionsContainer;
85: }
86:
87: public void setPersistenceContainer(
88: PersistenceContributionContainer aManager) {
89: thePersistenceContributionsContainer = aManager;
90: }
91: }
|