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 |
0 |
private Map pwnStates = new HashMap(); |
29 |
|
private PortletWindow maximizedWindow; |
30 |
|
private PortletWindow actionWindow; |
31 |
|
private PortletWindow resourceWindow; |
32 |
|
|
33 |
|
public PortletWindowRequestNavigationalStates(String characterEncoding) |
34 |
0 |
{ |
35 |
0 |
this.characterEncoding = characterEncoding; |
36 |
0 |
} |
37 |
|
|
38 |
|
public String getCharacterEncoding() |
39 |
|
{ |
40 |
0 |
return characterEncoding; |
41 |
|
} |
42 |
|
|
43 |
|
public Iterator getWindowIdIterator() |
44 |
|
{ |
45 |
0 |
return pwnStates.keySet().iterator(); |
46 |
|
} |
47 |
|
|
48 |
|
public void removePortletWindowNavigationalState(String windowId) |
49 |
|
{ |
50 |
0 |
boolean removed = pwnStates.remove(windowId) != null; |
51 |
0 |
if (removed) |
52 |
|
{ |
53 |
0 |
if (maximizedWindow != null && windowId.equals(maximizedWindow.getId().toString())) |
54 |
|
{ |
55 |
0 |
maximizedWindow = null; |
56 |
|
} |
57 |
0 |
if (actionWindow != null && windowId.equals(actionWindow.getId().toString())) |
58 |
|
{ |
59 |
0 |
actionWindow = null; |
60 |
|
} |
61 |
0 |
if (resourceWindow != null && windowId.equals(actionWindow.getId().toString())) |
62 |
|
{ |
63 |
0 |
resourceWindow = null; |
64 |
|
} |
65 |
|
} |
66 |
0 |
} |
67 |
|
|
68 |
|
public PortletWindowRequestNavigationalState getPortletWindowNavigationalState(String windowId) |
69 |
|
{ |
70 |
0 |
return (PortletWindowRequestNavigationalState)pwnStates.get(windowId); |
71 |
|
} |
72 |
|
|
73 |
|
public void addPortletWindowNavigationalState(String windowId, PortletWindowRequestNavigationalState pwnState) |
74 |
|
{ |
75 |
0 |
pwnStates.put(windowId, pwnState); |
76 |
0 |
} |
77 |
|
|
78 |
|
public PortletWindow getMaximizedWindow() |
79 |
|
{ |
80 |
0 |
return maximizedWindow; |
81 |
|
} |
82 |
|
|
83 |
|
public void setMaximizedWindow(PortletWindow maximizedWindow) |
84 |
|
{ |
85 |
0 |
this.maximizedWindow = maximizedWindow; |
86 |
0 |
} |
87 |
|
|
88 |
|
public PortletWindow getActionWindow() |
89 |
|
{ |
90 |
0 |
return actionWindow; |
91 |
|
} |
92 |
|
public void setActionWindow(PortletWindow actionWindow) |
93 |
|
{ |
94 |
0 |
this.actionWindow = actionWindow; |
95 |
0 |
} |
96 |
|
public void setResourceWindow(PortletWindow resourceWindow) |
97 |
|
{ |
98 |
0 |
this.resourceWindow = resourceWindow; |
99 |
0 |
} |
100 |
|
public PortletWindow getResourceWindow() |
101 |
|
{ |
102 |
0 |
return resourceWindow; |
103 |
|
} |
104 |
|
} |