1 7 8 package org.jboss.portal.core.theme.strategy.impl; 9 10 import org.jboss.portal.server.plugins.windowstate.WindowState; 11 import org.jboss.portal.server.theme.strategy.PortletContext; 12 import org.jboss.portal.server.theme.strategy.StrategyResponse; 13 14 import java.util.ArrayList ; 15 import java.util.Collections ; 16 import java.util.HashMap ; 17 import java.util.List ; 18 import java.util.Map ; 19 20 27 public class StrategyResponseImpl implements StrategyResponse 28 { 29 private String state; 30 private String layoutURI; 31 private Map stateChangeMap; 32 private List noRenderList; 33 private List modifiedPortletList; 34 35 38 public StrategyResponseImpl() 39 { 40 this.stateChangeMap = new HashMap (5); 41 this.noRenderList = new ArrayList (5); 42 this.modifiedPortletList = new ArrayList (5); 43 } 44 45 48 public String getLayoutURI() 49 { 50 return layoutURI; 51 } 52 53 56 public Map getWindowStateChangeMap() 57 { 58 return Collections.unmodifiableMap(stateChangeMap); 59 } 60 61 64 public List getExcludedList() 65 { 66 return Collections.unmodifiableList(noRenderList); 67 } 68 69 72 public List getModifiedPortletContextList() 73 { 74 return Collections.unmodifiableList(modifiedPortletList); 75 } 76 77 80 public void addNoRender(PortletContext portlet) 81 { 82 if (portlet == null) 83 { 84 throw new NullPointerException ("portlet reference is null"); 85 } 86 noRenderList.add(portlet); 87 } 88 89 92 public void addModified(PortletContext portlet) 93 { 94 throw new UnsupportedOperationException ("Currently not implemented"); 95 } 96 97 100 public void addWindowStateChange(PortletContext portlet, WindowState state) 101 { 102 if (portlet == null || state == null) 103 { 104 throw new NullPointerException ("portlet reference and/or state is null"); 105 } 106 stateChangeMap.put(portlet, state); 107 } 108 109 112 public void reset() 113 { 114 stateChangeMap.clear(); 115 noRenderList.clear(); 116 modifiedPortletList.clear(); 117 layoutURI = null; 118 state = null; 119 } 120 121 124 public void setURI(String layoutURI) 125 { 126 this.layoutURI = layoutURI; 127 } 128 129 132 public void setState(String state) 133 { 134 this.state = state; 135 } 136 137 140 public String getState() 141 { 142 return state; 143 } 144 } 145 | Popular Tags |