153 if (sessionView == null) {
154 sessionView = createSessionView();
155 }
156 return sessionView;
157 }
158
159 /**
160 * Returns array of actions for the tool bar.
161 */
162 Action[] getToolBarActions() {
163 return new Action[] {
164 showFullConfigAction,
165 showStdConfigAction,
166 };
167 }
168
169 public List<Action> getToolBarActionList() {
170 return Arrays.asList(getToolBarActions());
171 }
172
173 public void save(Map m) {
174 if (testSuite != null && testSuite.getRoot() != null)
175 m.put("testSuite", testSuite.getRoot().getPath());
176
177 // save work dir and ip
178 session.save(m);
179 }
180
181 public void restore(Map m) {
182 try {
183 session.restore(m);
184 } catch (Fault e) {
185 if (debug > 0) {
186 e.printStackTrace(Debug.getWriter());
187 }
188 uif.showError("exec.cantRestoreSession", e.getMessage());
189 }
190 }
191
192 public void dispose() {
193 session.dispose();
194 if (interviewEditor != null) {
195 interviewEditor.dispose();
196 interviewEditor = null;
197 }
198 }
199
200 /**
201 * Creates an empty configuration for the test suite. By default BasicSession
1278 public void menuSelected(MenuEvent e) {
1279 Parameters c = session.getParameters(); // alias, to save typing
1280 if (c == null) // if null, should not even be enabled
1281 return;
1282
1283 // Update the various menu items depending whether the corresponding parameters
1284 // can be handled by the Standard Values view -- ie whether the corresponding
1285 // parameters are mutable
1286 // Note: can't ask configEditor and hence stdView directly, since they
1287 // may not have been initialized yet
1288
1289 update(tests, c.getTestsParameters(), MutableTestsParameters.class);
1290 update(excludeList, c.getExcludeListParameters(), MutableExcludeListParameters.class);
1291 update(keywords, c.getKeywordsParameters(), MutableKeywordsParameters.class);
1292 update(priorStatus, c.getPriorStatusParameters(), MutablePriorStatusParameters.class);
1293 update(environment, c.getEnvParameters(), LegacyEnvParameters.class);
1294 update(concurrency, c.getConcurrencyParameters(), MutableConcurrencyParameters.class);
1295 update(timeoutFactor, c.getTimeoutFactorParameters(), MutableTimeoutFactorParameters.class);
1296 }
1297
1298 private void update(JMenuItem mi, Object o, Class c) {
1299 mi.setVisible(o != null && c.isAssignableFrom(o.getClass()));
1300 }
1301
1302 public void menuDeselected(MenuEvent e) {
1303 }
1304
1305 public void menuCanceled(MenuEvent e) {
1306 }
1307 /*
1308 void loadInterview(File file) {
1309 if (initEditor()) {
1310 interviewEditor.load(file);
1311 }
1312 }
1313 */
1314
1315 // ----------
1316
1317 private JMenuItem tests;
1318 private JMenuItem excludeList;
|
153 if (sessionView == null) {
154 sessionView = createSessionView();
155 }
156 return sessionView;
157 }
158
159 /**
160 * Returns array of actions for the tool bar.
161 */
162 Action[] getToolBarActions() {
163 return new Action[] {
164 showFullConfigAction,
165 showStdConfigAction,
166 };
167 }
168
169 public List<Action> getToolBarActionList() {
170 return Arrays.asList(getToolBarActions());
171 }
172
173 public void save(Map<String, String> m) {
174 if (testSuite != null && testSuite.getRoot() != null)
175 m.put("testSuite", testSuite.getRoot().getPath());
176
177 // save work dir and ip
178 session.save(m);
179 }
180
181 public void restore(Map<String, String> m) {
182 try {
183 session.restore(m);
184 } catch (Fault e) {
185 if (debug > 0) {
186 e.printStackTrace(Debug.getWriter());
187 }
188 uif.showError("exec.cantRestoreSession", e.getMessage());
189 }
190 }
191
192 public void dispose() {
193 session.dispose();
194 if (interviewEditor != null) {
195 interviewEditor.dispose();
196 interviewEditor = null;
197 }
198 }
199
200 /**
201 * Creates an empty configuration for the test suite. By default BasicSession
1278 public void menuSelected(MenuEvent e) {
1279 Parameters c = session.getParameters(); // alias, to save typing
1280 if (c == null) // if null, should not even be enabled
1281 return;
1282
1283 // Update the various menu items depending whether the corresponding parameters
1284 // can be handled by the Standard Values view -- ie whether the corresponding
1285 // parameters are mutable
1286 // Note: can't ask configEditor and hence stdView directly, since they
1287 // may not have been initialized yet
1288
1289 update(tests, c.getTestsParameters(), MutableTestsParameters.class);
1290 update(excludeList, c.getExcludeListParameters(), MutableExcludeListParameters.class);
1291 update(keywords, c.getKeywordsParameters(), MutableKeywordsParameters.class);
1292 update(priorStatus, c.getPriorStatusParameters(), MutablePriorStatusParameters.class);
1293 update(environment, c.getEnvParameters(), LegacyEnvParameters.class);
1294 update(concurrency, c.getConcurrencyParameters(), MutableConcurrencyParameters.class);
1295 update(timeoutFactor, c.getTimeoutFactorParameters(), MutableTimeoutFactorParameters.class);
1296 }
1297
1298 private void update(JMenuItem mi, Object o, Class<?> c) {
1299 mi.setVisible(o != null && c.isAssignableFrom(o.getClass()));
1300 }
1301
1302 public void menuDeselected(MenuEvent e) {
1303 }
1304
1305 public void menuCanceled(MenuEvent e) {
1306 }
1307 /*
1308 void loadInterview(File file) {
1309 if (initEditor()) {
1310 interviewEditor.load(file);
1311 }
1312 }
1313 */
1314
1315 // ----------
1316
1317 private JMenuItem tests;
1318 private JMenuItem excludeList;
|