author | Stephen Talley <stephen.talley@oracle.com> |
Mon, 28 Mar 2011 10:53:34 -0400 | |
changeset 685 | 767674b0a2fb |
parent 657 | 9fdd9a66d201 |
child 735 | a25f22e2faa2 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
5 |
* Common Development and Distribution License (the "License"). |
|
6 |
* You may not use this file except in compliance with the License. |
|
7 |
* |
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
21 |
||
22 |
/* |
|
657
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
23 |
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
0 | 24 |
*/ |
25 |
||
40
d1412af1ae5b
3215 ActionAbortedException is used too broadly
Stephen Talley <stephen.talley@sun.com>
parents:
26
diff
changeset
|
26 |
package org.opensolaris.os.vp.panel.common.control; |
0 | 27 |
|
28 |
import java.io.UnsupportedEncodingException; |
|
29 |
import java.net.*; |
|
30 |
import java.util.*; |
|
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
31 |
import org.opensolaris.os.vp.panel.common.action.*; |
591
7c5752b99fd6
12473 panels should probably be run in a sandbox
Stephen Talley <stephen.talley@oracle.com>
parents:
456
diff
changeset
|
32 |
import org.opensolaris.os.vp.util.misc.finder.ResourceFinder; |
0 | 33 |
|
34 |
/** |
|
35 |
* The {@code Control} class encapsulates the control over all aspects of a |
|
36 |
* single point in a navigation hierarchy. |
|
37 |
*/ |
|
38 |
public abstract class Control implements Navigable, HasControl { |
|
39 |
// |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
40 |
// Enums |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
41 |
// |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
42 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
43 |
public enum UnsavedChangesAction { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
44 |
CANCEL, DISCARD, SAVE |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
45 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
46 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
47 |
// |
0 | 48 |
// Static data |
49 |
// |
|
50 |
||
279
b82f64a1f586
8129 smf/sharemgr/sysid: breadcrumbs should be shown until UI redesign is implemented
Stephen Talley <stephen.talley@sun.com>
parents:
274
diff
changeset
|
51 |
/** |
b82f64a1f586
8129 smf/sharemgr/sysid: breadcrumbs should be shown until UI redesign is implemented
Stephen Talley <stephen.talley@sun.com>
parents:
274
diff
changeset
|
52 |
* The encoding used to encode/decode Control IDs and parameters in a path |
b82f64a1f586
8129 smf/sharemgr/sysid: breadcrumbs should be shown until UI redesign is implemented
Stephen Talley <stephen.talley@sun.com>
parents:
274
diff
changeset
|
53 |
* string. |
b82f64a1f586
8129 smf/sharemgr/sysid: breadcrumbs should be shown until UI redesign is implemented
Stephen Talley <stephen.talley@sun.com>
parents:
274
diff
changeset
|
54 |
*/ |
b82f64a1f586
8129 smf/sharemgr/sysid: breadcrumbs should be shown until UI redesign is implemented
Stephen Talley <stephen.talley@sun.com>
parents:
274
diff
changeset
|
55 |
public static final String ENCODING = "UTF-8"; |
0 | 56 |
|
57 |
// |
|
58 |
// Instance data |
|
59 |
// |
|
60 |
||
61 |
private String id; |
|
62 |
private String name; |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
63 |
private Navigator navigator; |
0 | 64 |
private Map<String, String> parameters; |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
65 |
private Control child; |
0 | 66 |
|
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
67 |
private StructuredAction<?, ?, ?> resetAction = |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
68 |
new StructuredAction<Object, Object, Object>(null) { |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
69 |
@Override |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
70 |
public Object work(Object pInput, Object rtInput) |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
71 |
throws ActionAbortedException, ActionFailedException { |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
72 |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
73 |
resetAll(); |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
74 |
return null; |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
75 |
} |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
76 |
}; |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
77 |
|
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
78 |
private StructuredAction<?, ?, ?> saveAction = |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
79 |
new StructuredAction<Object, Object, Object>(null) { |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
80 |
@Override |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
81 |
public Object work(Object pInput, Object rtInput) |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
82 |
throws ActionAbortedException, ActionFailedException { |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
83 |
|
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
84 |
try { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
85 |
saveAll(); |
214
aed2b42f7344
6426 UnauthorizedActionException's name should follow convention
Stephen Talley <stephen.talley@sun.com>
parents:
196
diff
changeset
|
86 |
} catch (ActionUnauthorizedException e) { |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
87 |
throw new ActionFailedException(e); |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
88 |
} |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
89 |
return null; |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
90 |
} |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
91 |
}; |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
92 |
|
0 | 93 |
// |
94 |
// Constructors |
|
95 |
// |
|
96 |
||
97 |
/** |
|
98 |
* Constructs a {@code Control} with the given identifier and name. |
|
99 |
*/ |
|
100 |
public Control(String id, String name) { |
|
101 |
setId(id); |
|
102 |
setName(name); |
|
103 |
} |
|
104 |
||
105 |
/** |
|
106 |
* Constructs a {@code Control} with a {@code null} identifier and name. |
|
107 |
*/ |
|
108 |
public Control() { |
|
109 |
this(null, null); |
|
110 |
} |
|
111 |
||
112 |
// |
|
113 |
// HasId methods |
|
114 |
// |
|
115 |
||
116 |
/** |
|
117 |
* Gets an identifier for this {@code Control}, sufficiently unique as to |
|
118 |
* distinguish itself from its siblings. |
|
119 |
*/ |
|
120 |
@Override |
|
121 |
public String getId() { |
|
122 |
return id; |
|
123 |
} |
|
124 |
||
125 |
// |
|
126 |
// Navigable methods |
|
127 |
// |
|
128 |
||
129 |
/** |
|
130 |
* Gets the localized name of this {@code Control}. |
|
131 |
*/ |
|
132 |
@Override |
|
133 |
public String getName() { |
|
134 |
return name; |
|
135 |
} |
|
136 |
||
137 |
/** |
|
138 |
* Gets the initialization parameters passed to the {@link #start} method, |
|
139 |
* if this {@code Control} is started, or {@code null} if this {@code |
|
140 |
* Control} is stopped. |
|
141 |
*/ |
|
142 |
@Override |
|
143 |
public Map<String, String> getParameters() { |
|
144 |
return parameters; |
|
145 |
} |
|
146 |
||
147 |
// |
|
148 |
// HasControl methods |
|
149 |
// |
|
150 |
||
151 |
@Override |
|
152 |
public Control getControl() { |
|
153 |
return this; |
|
154 |
} |
|
155 |
||
156 |
// |
|
327
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
157 |
// Object methods |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
158 |
// |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
159 |
|
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
160 |
@Override |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
161 |
public String toString() { |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
162 |
return getName(); |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
163 |
} |
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
164 |
|
bb43a6fa6f0b
10096 time: new UI design and NTP support
Stephen Talley <stephen.talley@sun.com>
parents:
302
diff
changeset
|
165 |
// |
0 | 166 |
// Control methods |
167 |
// |
|
168 |
||
169 |
/** |
|
451
9dd6c980ba0c
10962 apache: help text should be updated to account for new UI design (source code update)
Stephen Talley <stephen.talley@sun.com>
parents:
414
diff
changeset
|
170 |
* Builds a help URL from a page and optional section, falling back to the |
407
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
171 |
* page if the section is invalid. |
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
172 |
*/ |
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
173 |
protected URL buildHelpURL(String page, String section) { |
456
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
174 |
return buildHelpURL(getClass(), page, section); |
407
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
175 |
} |
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
176 |
|
b313617320f8
13567 help button doesn't launch context-specific help
Stephen Talley <stephen.talley@sun.com>
parents:
404
diff
changeset
|
177 |
/** |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
178 |
* Saves the given child as the {@link #getRunningChild running child}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
179 |
* Called by {@link #descendantStarted} when a child of this {@code Control} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
180 |
* is started. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
181 |
* |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
182 |
* @exception IllegalStateException |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
183 |
* if the running child has already been set |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
184 |
*/ |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
185 |
public void childStarted(Control child) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
186 |
if (this.child != null) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
187 |
throw new IllegalStateException("child already started"); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
188 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
189 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
190 |
this.child = child; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
191 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
192 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
193 |
/** |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
194 |
* Removes the given child as the {@link #getRunningChild running child}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
195 |
* Called by {@link #descendantStopped} when a child of this {@code Control} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
196 |
* is stopped. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
197 |
* |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
198 |
* @exception IllegalStateException |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
199 |
* if the given control is not the running child |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
200 |
*/ |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
201 |
public void childStopped(Control child) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
202 |
if (this.child != child) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
203 |
throw new IllegalStateException("not running child"); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
204 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
205 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
206 |
this.child = null; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
207 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
208 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
209 |
/** |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
210 |
* Calls {@link #childStarted} iff the given path refers to an immediate |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
211 |
* child of this {@code Control}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
212 |
* <p/> |
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
213 |
* Called by the {@link Navigator} just after a descendant {@code Control} |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
214 |
* of this {@code Control} has been started and pushed onto the {@link |
0 | 215 |
* Navigator}'s {@code Control} stack. |
216 |
* |
|
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
217 |
* @param path |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
218 |
* the path to the descendant {@code Control}, relative to this |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
219 |
* {@code Control} (with the just-started {@code Control} as |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
220 |
* the last element) |
0 | 221 |
*/ |
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
222 |
public void descendantStarted(Control[] path) { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
223 |
if (path.length == 1) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
224 |
childStarted(path[0]); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
225 |
} |
0 | 226 |
} |
227 |
||
228 |
/** |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
229 |
* Calls {@link #childStopped} iff the given path refers to an immediate |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
230 |
* child of this {@code Control}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
231 |
* <p/> |
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
232 |
* Called by the {@link Navigator} just after a descendant {@code Control} |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
233 |
* of this {@code Control} has been stopped and popped off the {@link |
0 | 234 |
* Navigator}'s {@code Control} stack. |
235 |
* |
|
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
236 |
* @param path |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
237 |
* the path to the descendant {@code Control}, relative to this |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
238 |
* {@code Control} (with the just-stopped {@code Control} as |
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
239 |
* the last element) |
0 | 240 |
*/ |
248
d947462c8e37
7851 Control should support notification of descendants starting/stopping
Stephen Talley <stephen.talley@sun.com>
parents:
247
diff
changeset
|
241 |
public void descendantStopped(Control[] path) { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
242 |
if (path.length == 1) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
243 |
childStopped(path[0]); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
244 |
} |
0 | 245 |
} |
246 |
||
247 |
/** |
|
302
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
248 |
* Asynchronously navigates up one level above this {@code Control} in the |
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
249 |
* navigation stack. The {@link #stop stop methods} of all affected {@code |
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
250 |
* Control}s are called with a {@code true} argument. |
264
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
251 |
*/ |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
252 |
public void doCancel() { |
379
a915e5da7876
12716 minor javadoc improvements
Stephen Talley <stephen.talley@sun.com>
parents:
373
diff
changeset
|
253 |
getNavigator().goToAsync(true, this, Navigator.PARENT_NAVIGABLE); |
264
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
254 |
} |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
255 |
|
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
256 |
/** |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
257 |
* Asynchronously invokes this {@link Control}'s save action, then navigates |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
258 |
* up one level in the navigation stack. |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
259 |
*/ |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
260 |
public void doOkay() { |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
261 |
final StructuredAction<?, ?, ?> saveAction = getSaveAction(); |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
262 |
saveAction.asyncExec( |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
263 |
new Runnable() { |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
264 |
@Override |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
265 |
public void run() { |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
266 |
try { |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
267 |
saveAction.invoke(); |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
268 |
|
302
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
269 |
getNavigator().goToAsync(false, Control.this, |
373
faddb1b7fb76
12184 Navigator's address validation is incomplete, and uncompletable
Stephen Talley <stephen.talley@sun.com>
parents:
361
diff
changeset
|
270 |
Navigator.PARENT_NAVIGABLE); |
264
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
271 |
} catch (ActionException ignore) { |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
272 |
} |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
273 |
} |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
274 |
}); |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
275 |
} |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
276 |
|
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
277 |
/** |
0 | 278 |
* Gets a list of {@code Navigable}s that resolve to a child {@code Control} |
279 |
* of this {@code Control}. |
|
280 |
* |
|
281 |
* @return a non-{@code null} (but possibly empty) {@code Collection} |
|
282 |
*/ |
|
283 |
public abstract List<Navigable> getBrowsable(); |
|
284 |
||
285 |
/** |
|
286 |
* Gets the child {@code Control} with the given identifier, creating it if |
|
287 |
* necessary. |
|
288 |
* |
|
289 |
* @param id |
|
290 |
* a unique identifier, as reported by the child {@code |
|
291 |
* Control}'s {@link #getId} method. |
|
292 |
* |
|
293 |
* @return a {@code Control} object, or {@code null} if no such child |
|
294 |
* is known |
|
295 |
*/ |
|
296 |
public abstract Control getChildControl(String id); |
|
297 |
||
298 |
/** |
|
247
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
299 |
* Gets a {@link Navigable} path to navigate to automatically when this |
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
300 |
* {@code Control} is the final destination of a navigation (not an |
258
521fd086e813
7977 navigator: getForwardingPath should be called after Control is started
Stephen Talley <stephen.talley@sun.com>
parents:
248
diff
changeset
|
301 |
* intermediate stop to another {@code Control}). This method is called by |
521fd086e813
7977 navigator: getForwardingPath should be called after Control is started
Stephen Talley <stephen.talley@sun.com>
parents:
248
diff
changeset
|
302 |
* the {@link Navigator} <strong>after</strong> this {@code Control} has |
521fd086e813
7977 navigator: getForwardingPath should be called after Control is started
Stephen Talley <stephen.talley@sun.com>
parents:
248
diff
changeset
|
303 |
* been started. |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
304 |
* <p/> |
247
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
305 |
* If the first element is {@code null}, the returned path is considered |
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
306 |
* absolute. Otherwise, it is relative to this {@code Control}. |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
307 |
* <p/> |
0 | 308 |
* This default implementation returns {@code null}. |
309 |
* |
|
404
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
310 |
* @param childStopped |
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
311 |
* {@code true} if navigation stopped here because a child |
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
312 |
* {@code Control} of this {@code Control} stopped, {@code |
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
313 |
* false} if this {@code Control} was started as part of this |
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
314 |
* specific navigation |
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
315 |
* |
247
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
316 |
* @return a {@link Navigable} array, or {@code null} if no automatic |
8ed978c14164
7820 Control.getForwardingPath should return a Navigable array instead of a String
Stephen Talley <stephen.talley@sun.com>
parents:
235
diff
changeset
|
317 |
* forwarding should occur |
0 | 318 |
*/ |
404
32e9b6a2b5f2
13501 generic support for window-creating Controls
Stephen Talley <stephen.talley@sun.com>
parents:
379
diff
changeset
|
319 |
public Navigable[] getForwardingPath(boolean childStopped) { |
0 | 320 |
return null; |
321 |
} |
|
322 |
||
323 |
/** |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
324 |
* Gets the help URL for this {@code DefaultControl}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
325 |
* <p/> |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
326 |
* This default implementation returns {@code null}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
327 |
* |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
328 |
* @return a URL, or {@code null} if no URL applies |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
329 |
*/ |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
330 |
public URL getHelpURL() { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
331 |
return null; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
332 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
333 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
334 |
/** |
0 | 335 |
* Gets the {@link Navigator} passed to the {@link #start} method, if |
336 |
* this {@code Control} is started, or {@code null} if this {@code Control} |
|
337 |
* is stopped. |
|
338 |
*/ |
|
339 |
public Navigator getNavigator() { |
|
340 |
return navigator; |
|
341 |
} |
|
342 |
||
235
38f73435a683
7483 save/prompt functionality in SwingControl can be generalized and moved into Control and DefaultControl
Stephen Talley <stephen.talley@sun.com>
parents:
214
diff
changeset
|
343 |
/** |
348
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
344 |
* Gets a {@link StructuredAction} that invokes {@link #resetAll}. |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
345 |
*/ |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
346 |
public StructuredAction<?, ?, ?> getResetAction() { |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
347 |
return resetAction; |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
348 |
} |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
349 |
|
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
350 |
/** |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
351 |
* Gets the child {@code Control} currently running, or {@code null} if |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
352 |
* there is none. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
353 |
*/ |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
354 |
public Control getRunningChild() { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
355 |
return child; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
356 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
357 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
358 |
/** |
348
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
359 |
* Gets a {@link StructuredAction} that invokes {@link #saveAll}. |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
360 |
*/ |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
361 |
public StructuredAction<?, ?, ?> getSaveAction() { |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
362 |
return saveAction; |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
363 |
} |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
364 |
|
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
365 |
/** |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
366 |
* Called by {@link #stop} when there are unsaved changes, gets the action |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
367 |
* that should be taken to handle them. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
368 |
* <p/> |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
369 |
* This default implementation returns {@link UnsavedChangesAction#DISCARD}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
370 |
* Subclasses may wish to prompt the user to determine the appropriate |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
371 |
* action to take. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
372 |
*/ |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
373 |
protected UnsavedChangesAction getUnsavedChangesAction() { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
374 |
return UnsavedChangesAction.DISCARD; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
375 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
376 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
377 |
/** |
348
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
378 |
* Gets a hint as to whether this {@code Control} should be returned by a |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
379 |
* parent {@code Control}'s {@link #getBrowsable} method. The parent may |
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
380 |
* choose to ignore this hint. |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
381 |
* <p/> |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
382 |
* This default implementation returns {@code true}. |
348
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
383 |
*/ |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
384 |
public boolean isBrowsable() { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
385 |
return true; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
386 |
} |
348
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
387 |
|
6f9b5e56d0a1
11021 firewall: fails to start when breadcrumbs are enabled
Stephen Talley <stephen.talley@sun.com>
parents:
327
diff
changeset
|
388 |
/** |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
389 |
* Indicates whether there are any unsaved changes in this {@code Control}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
390 |
* <p/> |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
391 |
* This default implementation returns {@code false}. |
235
38f73435a683
7483 save/prompt functionality in SwingControl can be generalized and moved into Control and DefaultControl
Stephen Talley <stephen.talley@sun.com>
parents:
214
diff
changeset
|
392 |
*/ |
361
d3611020acea
11509 Control: s/isSaveNeeded/isChanged/g
Stephen Talley <stephen.talley@sun.com>
parents:
360
diff
changeset
|
393 |
protected boolean isChanged() { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
394 |
return false; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
395 |
} |
235
38f73435a683
7483 save/prompt functionality in SwingControl can be generalized and moved into Control and DefaultControl
Stephen Talley <stephen.talley@sun.com>
parents:
214
diff
changeset
|
396 |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
397 |
public boolean isStarted() { |
17
b82508ab9887
2522 hard to differentiate group and share edit views
Stephen Talley <stephen.talley@sun.com>
parents:
0
diff
changeset
|
398 |
return navigator != null; |
b82508ab9887
2522 hard to differentiate group and share edit views
Stephen Talley <stephen.talley@sun.com>
parents:
0
diff
changeset
|
399 |
} |
b82508ab9887
2522 hard to differentiate group and share edit views
Stephen Talley <stephen.talley@sun.com>
parents:
0
diff
changeset
|
400 |
|
0 | 401 |
/** |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
402 |
* If appropriate, resets this {@code Control}, discarding any pending |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
403 |
* changes. |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
404 |
* <p/> |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
405 |
* This default implementation does nothing. |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
406 |
* |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
407 |
* @exception ActionAbortedException |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
408 |
* if this operation is cancelled |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
409 |
* |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
410 |
* @exception ActionFailedException |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
411 |
* if this operation fails |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
412 |
*/ |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
413 |
protected void reset() throws ActionAbortedException, ActionFailedException |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
414 |
{ |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
415 |
} |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
416 |
|
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
417 |
/** |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
418 |
* {@link #reset Reset}s all {@code Control}s from the top of the navigation |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
419 |
* stack to this {@link Control}, discarding any pending changes. |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
420 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
421 |
* @exception ActionAbortedException |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
422 |
* see {@link #reset} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
423 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
424 |
* @exception ActionFailedException |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
425 |
* see {@link #reset} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
426 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
427 |
* @exception IllegalStateException |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
428 |
* if this {@link Control} is not started |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
429 |
*/ |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
430 |
protected void resetAll() throws ActionAbortedException, |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
431 |
ActionFailedException { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
432 |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
433 |
assertStartState(true); |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
434 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
435 |
List<Control> path = navigator.getPath(); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
436 |
if (!path.contains(this)) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
437 |
throw new IllegalStateException(); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
438 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
439 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
440 |
for (int i = path.size() - 1; i >= 0; i--) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
441 |
Control control = path.get(i); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
442 |
control.reset(); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
443 |
if (control == this) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
444 |
break; |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
445 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
446 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
447 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
448 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
449 |
/** |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
450 |
* If appropriate, saves any changes made while this {@code Control} is |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
451 |
* running. |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
452 |
* <p/> |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
453 |
* This default implementation does nothing. |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
454 |
* |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
455 |
* @exception ActionAbortedException |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
456 |
* if this operation is cancelled |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
457 |
* |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
458 |
* @exception ActionFailedException |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
459 |
* if this operation fails |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
460 |
* |
214
aed2b42f7344
6426 UnauthorizedActionException's name should follow convention
Stephen Talley <stephen.talley@sun.com>
parents:
196
diff
changeset
|
461 |
* @exception ActionUnauthorizedException |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
462 |
* if the current user has insufficient privileges for this |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
463 |
* operation |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
464 |
*/ |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
465 |
protected void save() throws ActionAbortedException, ActionFailedException, |
214
aed2b42f7344
6426 UnauthorizedActionException's name should follow convention
Stephen Talley <stephen.talley@sun.com>
parents:
196
diff
changeset
|
466 |
ActionUnauthorizedException { |
138
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
467 |
} |
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
468 |
|
48a05b6471de
4366 wizard: wizard steps should not be limited to SwingControls
Stephen Talley <stephen.talley@sun.com>
parents:
79
diff
changeset
|
469 |
/** |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
470 |
* {@link #save Save}s all {@code Control}s from the top of the navigation |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
471 |
* stack to this {@link Control}. |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
472 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
473 |
* @exception ActionAbortedException |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
474 |
* see {@link #save} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
475 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
476 |
* @exception ActionFailedException |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
477 |
* see {@link #save} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
478 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
479 |
* @exception ActionUnauthorizedException |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
480 |
* see {@link #save} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
481 |
* |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
482 |
* @exception IllegalStateException |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
483 |
* if this {@link Control} is not started |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
484 |
*/ |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
485 |
protected void saveAll() throws ActionAbortedException, |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
486 |
ActionFailedException, ActionUnauthorizedException { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
487 |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
488 |
assertStartState(true); |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
489 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
490 |
List<Control> path = navigator.getPath(); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
491 |
if (!path.contains(this)) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
492 |
throw new IllegalStateException(); |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
493 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
494 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
495 |
for (int i = path.size() - 1; i >= 0; i--) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
496 |
Control control = path.get(i); |
361
d3611020acea
11509 Control: s/isSaveNeeded/isChanged/g
Stephen Talley <stephen.talley@sun.com>
parents:
360
diff
changeset
|
497 |
if (control.isChanged()) { |
264
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
498 |
control.save(); |
d5cd4b2e7426
8029 apache: ui redesign
Stephen Talley <stephen.talley@sun.com>
parents:
260
diff
changeset
|
499 |
} |
260
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
500 |
if (control == this) { |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
501 |
break; |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
502 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
503 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
504 |
} |
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
505 |
|
507ac22496fe
7994 Control save/reset actions should act on descendents first
Stephen Talley <stephen.talley@sun.com>
parents:
258
diff
changeset
|
506 |
/** |
0 | 507 |
* Sets the identifier for this {@code Control}. |
508 |
*/ |
|
509 |
protected void setId(String id) { |
|
510 |
this.id = id; |
|
511 |
} |
|
512 |
||
513 |
/** |
|
514 |
* Sets the name for this {@code Control}. |
|
515 |
*/ |
|
516 |
protected void setName(String name) { |
|
517 |
this.name = name; |
|
518 |
} |
|
519 |
||
520 |
/** |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
521 |
* Saves references to the given {@link #getNavigator Navigator} and {@link |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
522 |
* #getParameters initialization parameters}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
523 |
* <p/> |
0 | 524 |
* Called by the {@link Navigator} when this {@code Control} is pushed onto |
525 |
* the {@code Control} stack. |
|
526 |
* |
|
527 |
* @param navigator |
|
528 |
* the {@link Navigator} that handles navigation to/from this |
|
529 |
* {@code Controls} |
|
530 |
* |
|
531 |
* @param parameters |
|
532 |
* non-{@code null}, but optional (may be empty) initialization |
|
533 |
* parameters |
|
534 |
* |
|
40
d1412af1ae5b
3215 ActionAbortedException is used too broadly
Stephen Talley <stephen.talley@sun.com>
parents:
26
diff
changeset
|
535 |
* @exception NavigationAbortedException |
657
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
536 |
* if this action is cancelled or vetoed |
0 | 537 |
* |
538 |
* @exception InvalidParameterException |
|
657
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
539 |
* if this action fails due to invalid initialization |
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
540 |
* parameters |
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
541 |
* |
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
542 |
* @exception NavigationFailedException |
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
543 |
* if this action fails for some other reason |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
544 |
* |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
545 |
* @exception IllegalStateException |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
546 |
* if this {@link Control} is already started |
0 | 547 |
*/ |
548 |
public void start(Navigator navigator, Map<String, String> parameters) |
|
657
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
549 |
throws NavigationAbortedException, InvalidParameterException, |
9fdd9a66d201
17928 Control.start should allow broader range of failures
Stephen Talley <stephen.talley@oracle.com>
parents:
591
diff
changeset
|
550 |
NavigationFailedException { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
551 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
552 |
assertStartState(false); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
553 |
this.navigator = navigator; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
554 |
this.parameters = parameters; |
0 | 555 |
} |
556 |
||
557 |
/** |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
558 |
* If {@code isCancel} is {@code false}, saves, resets, or cancels changes |
361
d3611020acea
11509 Control: s/isSaveNeeded/isChanged/g
Stephen Talley <stephen.talley@sun.com>
parents:
360
diff
changeset
|
559 |
* {@link #isChanged if necessary}, based on the return value of {@link |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
560 |
* #getUnsavedChangesAction}. Then resets the references to the {@link |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
561 |
* #getNavigator Navigator} and {@link #getParameters initialization |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
562 |
* parameters}. |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
563 |
* <p/> |
0 | 564 |
* Called by the {@link Navigator} prior to this {@code Control} being |
565 |
* removed as the current {@code Control}. |
|
566 |
* |
|
302
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
567 |
* @param isCancel |
356
379b8150bb93
11379 apache: unable to cancel app with bad data in outstanding changes
Stephen Talley <stephen.talley@sun.com>
parents:
350
diff
changeset
|
568 |
* {@code true} if this {@code Control} is being stopped as |
379b8150bb93
11379 apache: unable to cancel app with bad data in outstanding changes
Stephen Talley <stephen.talley@sun.com>
parents:
350
diff
changeset
|
569 |
* part of a {@code cancel} operation, {@code false} otherwise |
302
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
570 |
* |
40
d1412af1ae5b
3215 ActionAbortedException is used too broadly
Stephen Talley <stephen.talley@sun.com>
parents:
26
diff
changeset
|
571 |
* @exception NavigationAbortedException |
0 | 572 |
* if this {@code Control} should remain the current {@code |
573 |
* Control} |
|
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
574 |
* |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
575 |
* @exception IllegalStateException |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
576 |
* if this {@link Control} is not started |
0 | 577 |
*/ |
302
ac70675de834
9318 Navigator/Control should distinguish between cancel and non-cancel navigations
Stephen Talley <stephen.talley@sun.com>
parents:
279
diff
changeset
|
578 |
public void stop(boolean isCancel) throws NavigationAbortedException { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
579 |
assertStartState(true); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
580 |
|
361
d3611020acea
11509 Control: s/isSaveNeeded/isChanged/g
Stephen Talley <stephen.talley@sun.com>
parents:
360
diff
changeset
|
581 |
if (!isCancel && isChanged()) { |
360
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
582 |
try { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
583 |
switch (getUnsavedChangesAction()) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
584 |
case SAVE: |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
585 |
getSaveAction().invoke(); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
586 |
break; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
587 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
588 |
case DISCARD: |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
589 |
getResetAction().invoke(); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
590 |
break; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
591 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
592 |
default: |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
593 |
case CANCEL: |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
594 |
throw new NavigationAbortedException(); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
595 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
596 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
597 |
// Thrown by invoke() |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
598 |
} catch (ActionException e) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
599 |
throw new NavigationAbortedException(e); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
600 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
601 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
602 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
603 |
this.navigator = null; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
604 |
this.parameters = null; |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
605 |
} |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
606 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
607 |
// |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
608 |
// Private methods |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
609 |
// |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
610 |
|
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
611 |
private void assertStartState(boolean started) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
612 |
if (isStarted() != started) { |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
613 |
throw new IllegalStateException(started ? "control started" : |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
614 |
"control not started"); |
8943c58ad2f5
11508 Control, DefaultControl refactoring
Stephen Talley <stephen.talley@sun.com>
parents:
356
diff
changeset
|
615 |
} |
0 | 616 |
} |
617 |
||
618 |
// |
|
619 |
// Static methods |
|
620 |
// |
|
621 |
||
622 |
/** |
|
350
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
623 |
* Decodes the given encoded {@code String} into an identifier and |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
624 |
* parameters, encapsulated by a {@link SimpleNavigable}. |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
625 |
* |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
626 |
* @param encoded |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
627 |
* an {@link #encode encode}d {@code String} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
628 |
* |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
629 |
* @return a {@link SimpleNavigable} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
630 |
*/ |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
631 |
public static SimpleNavigable decode(String encoded) { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
632 |
String[] elements = encoded.split("\\?", 2); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
633 |
String id = elements[0]; |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
634 |
Map<String, String> parameters = new HashMap<String, String>(); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
635 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
636 |
try { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
637 |
id = URLDecoder.decode(elements[0], ENCODING); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
638 |
} catch (UnsupportedEncodingException ignore) { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
639 |
} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
640 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
641 |
if (elements.length >= 2 && !elements[1].isEmpty()) { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
642 |
String[] keyEqVals = elements[1].split("&"); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
643 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
644 |
for (String keyEqVal : keyEqVals) { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
645 |
String[] nvPair = keyEqVal.split("=", 2); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
646 |
String key = nvPair[0]; |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
647 |
String value = nvPair.length < 2 ? "" : nvPair[1]; |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
648 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
649 |
try { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
650 |
key = URLDecoder.decode(key, ENCODING); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
651 |
value = URLDecoder.decode(value, ENCODING); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
652 |
} catch (UnsupportedEncodingException ignore) { |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
653 |
} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
654 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
655 |
parameters.put(key, value); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
656 |
} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
657 |
} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
658 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
659 |
return new SimpleNavigable(id, null, parameters); |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
660 |
} |
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
661 |
|
1e9744735024
11081 parameter retrieval in Control start methods could be simplified
Stephen Talley <stephen.talley@sun.com>
parents:
348
diff
changeset
|
662 |
/** |
0 | 663 |
* Encodes the given identifier and parameters. |
664 |
* |
|
665 |
* @param id |
|
666 |
* a {@link Control#getId Control identifier} |
|
667 |
* |
|
668 |
* @param parameters |
|
669 |
* initialization parameters, or {@code null} if no parameters |
|
670 |
* apply |
|
671 |
* |
|
672 |
* @return an encoded String |
|
673 |
*/ |
|
674 |
public static String encode(String id, Map<String, String> parameters) { |
|
685
767674b0a2fb
18094 s/StringBuffer/StringBuilder/g
Stephen Talley <stephen.talley@oracle.com>
parents:
657
diff
changeset
|
675 |
StringBuilder buffer = new StringBuilder(); |
0 | 676 |
|
677 |
try { |
|
678 |
buffer.append(URLEncoder.encode(id, ENCODING)); |
|
679 |
||
680 |
if (parameters != null && !parameters.isEmpty()) { |
|
681 |
buffer.append("?"); |
|
682 |
boolean first = true; |
|
683 |
||
684 |
for (String key : parameters.keySet()) { |
|
685 |
if (first) { |
|
686 |
first = false; |
|
687 |
} else { |
|
688 |
buffer.append("&"); |
|
689 |
} |
|
690 |
||
691 |
String value = parameters.get(key); |
|
692 |
if (value == null) { |
|
693 |
value = ""; |
|
694 |
} else { |
|
695 |
value = URLEncoder.encode(value, ENCODING); |
|
696 |
} |
|
697 |
||
698 |
key = URLEncoder.encode(key, ENCODING); |
|
699 |
||
700 |
buffer.append(key).append("=").append(value); |
|
701 |
} |
|
702 |
} |
|
703 |
} catch (UnsupportedEncodingException ignore) { |
|
704 |
} |
|
705 |
||
706 |
return buffer.toString(); |
|
707 |
} |
|
456
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
708 |
|
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
709 |
/** |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
710 |
* Builds a help URL from a page and optional section, falling back to the |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
711 |
* page if the section is invalid. |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
712 |
*/ |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
713 |
public static URL buildHelpURL(Class clazz, String page, String section) { |
591
7c5752b99fd6
12473 panels should probably be run in a sandbox
Stephen Talley <stephen.talley@oracle.com>
parents:
456
diff
changeset
|
714 |
URL url = new ResourceFinder().getResource( |
7c5752b99fd6
12473 panels should probably be run in a sandbox
Stephen Talley <stephen.talley@oracle.com>
parents:
456
diff
changeset
|
715 |
clazz.getClassLoader(), clazz.getPackage().getName(), page); |
456
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
716 |
|
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
717 |
if (section != null) { |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
718 |
try { |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
719 |
url = new URL(url, section); |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
720 |
} catch (MalformedURLException ignore) { |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
721 |
} |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
722 |
} |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
723 |
|
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
724 |
return url; |
3c23a2501f35
10964 time: need initial online help (source code update)
David Powell <David.Powell@sun.com>
parents:
451
diff
changeset
|
725 |
} |
0 | 726 |
} |