1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.container.state.impl;
18
19 import java.util.HashMap;
20 import java.util.Iterator;
21 import java.util.Map;
22
23 import org.apache.pluto.om.window.PortletWindow;
24
25 public class PortletWindowRequestNavigationalStates
26 {
27 private String characterEncoding;
28 private Map pwnStates = new HashMap();
29 private PortletWindow maximizedWindow;
30 private PortletWindow actionWindow;
31 private PortletWindow resourceWindow;
32
33 public PortletWindowRequestNavigationalStates(String characterEncoding)
34 {
35 this.characterEncoding = characterEncoding;
36 }
37
38 public String getCharacterEncoding()
39 {
40 return characterEncoding;
41 }
42
43 public Iterator getWindowIdIterator()
44 {
45 return pwnStates.keySet().iterator();
46 }
47
48 public void removePortletWindowNavigationalState(String windowId)
49 {
50 boolean removed = pwnStates.remove(windowId) != null;
51 if (removed)
52 {
53 if (maximizedWindow != null && windowId.equals(maximizedWindow.getId().toString()))
54 {
55 maximizedWindow = null;
56 }
57 if (actionWindow != null && windowId.equals(actionWindow.getId().toString()))
58 {
59 actionWindow = null;
60 }
61 if (resourceWindow != null && windowId.equals(actionWindow.getId().toString()))
62 {
63 resourceWindow = null;
64 }
65 }
66 }
67
68 public PortletWindowRequestNavigationalState getPortletWindowNavigationalState(String windowId)
69 {
70 return (PortletWindowRequestNavigationalState)pwnStates.get(windowId);
71 }
72
73 public void addPortletWindowNavigationalState(String windowId, PortletWindowRequestNavigationalState pwnState)
74 {
75 pwnStates.put(windowId, pwnState);
76 }
77
78 public PortletWindow getMaximizedWindow()
79 {
80 return maximizedWindow;
81 }
82
83 public void setMaximizedWindow(PortletWindow maximizedWindow)
84 {
85 this.maximizedWindow = maximizedWindow;
86 }
87
88 public PortletWindow getActionWindow()
89 {
90 return actionWindow;
91 }
92 public void setActionWindow(PortletWindow actionWindow)
93 {
94 this.actionWindow = actionWindow;
95 }
96 public void setResourceWindow(PortletWindow resourceWindow)
97 {
98 this.resourceWindow = resourceWindow;
99 }
100 public PortletWindow getResourceWindow()
101 {
102 return resourceWindow;
103 }
104 }