Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: plugins/org.chromium.debug.ui/src/org/chromium/debug/ui/WizardUtils.java

Issue 6312048: Redo normal expressions in dialog updater to be thread-safe (Closed) Base URL: https://chromedevtools.googlecode.com/svn/trunk
Patch Set: follow codereview Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.debug.ui; 5 package org.chromium.debug.ui;
6 6
7 import java.lang.reflect.InvocationTargetException; 7 import java.lang.reflect.InvocationTargetException;
8 import java.util.ArrayList; 8 import java.util.ArrayList;
9 import java.util.HashSet; 9 import java.util.HashSet;
10 import java.util.List; 10 import java.util.List;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 } 274 }
275 275
276 /** 276 /**
277 * A utility class that ties {@link Updater} together with {@link LogicBasedWi zard}. 277 * A utility class that ties {@link Updater} together with {@link LogicBasedWi zard}.
278 * It is fed with {@link WizardFinisher} value and optional warning value. 278 * It is fed with {@link WizardFinisher} value and optional warning value.
279 * It controls messages and 'finish' button of the wizard. 279 * It controls messages and 'finish' button of the wizard.
280 */ 280 */
281 public static class WizardFinishController implements ValueConsumer { 281 public static class WizardFinishController implements ValueConsumer {
282 private final ValueSource<? extends Optional<? extends WizardFinisher>> fini sherValue; 282 private final ValueSource<? extends Optional<? extends WizardFinisher>> fini sherValue;
283 private final ValueSource<? extends Optional<Void>> warningValue; 283 private final ValueSource<? extends Optional<?>> warningValue;
284 private final LogicBasedWizard wizardImpl; 284 private final LogicBasedWizard wizardImpl;
285 285
286 public WizardFinishController( 286 public WizardFinishController(
287 ValueSource<? extends Optional<? extends WizardFinisher>> finisherValue, 287 ValueSource<? extends Optional<? extends WizardFinisher>> finisherValue,
288 ValueSource<? extends Optional<Void>> warningValue, 288 ValueSource<? extends Optional<? extends Void>> warningValue,
289 LogicBasedWizard wizardImpl) { 289 LogicBasedWizard wizardImpl) {
290 this.finisherValue = finisherValue; 290 this.finisherValue = finisherValue;
291 this.warningValue = warningValue; 291 this.warningValue = warningValue;
292 this.wizardImpl = wizardImpl; 292 this.wizardImpl = wizardImpl;
293 } 293 }
294 294
295 public void update(Updater updater) { 295 public void update(Updater updater) {
296 WizardFinisher finisher; 296 WizardFinisher finisher;
297 Set<Message> messages = new HashSet<Message>(); 297 Set<Message> messages = new HashSet<Message>();
298 if (warningValue != null) { 298 if (warningValue != null) {
299 Optional<Void> warnings = warningValue.getValue(); 299 Optional<?> warnings = warningValue.getValue();
300 if (!warnings.isNormal()) { 300 if (!warnings.isNormal()) {
301 messages.addAll(warnings.errorMessages()); 301 messages.addAll(warnings.errorMessages());
302 } 302 }
303 } 303 }
304 if (finisherValue.getValue().isNormal()) { 304 if (finisherValue.getValue().isNormal()) {
305 finisher = finisherValue.getValue().getNormal(); 305 finisher = finisherValue.getValue().getNormal();
306 } else { 306 } else {
307 finisher = null; 307 finisher = null;
308 messages.addAll(finisherValue.getValue().errorMessages()); 308 messages.addAll(finisherValue.getValue().errorMessages());
309 } 309 }
(...skipping 17 matching lines...) Expand all
327 327
328 public void setEnabled(boolean enabled, boolean recursive) { 328 public void setEnabled(boolean enabled, boolean recursive) {
329 if (enabled) { 329 if (enabled) {
330 basePage.linkToNextPage(nextPage); 330 basePage.linkToNextPage(nextPage);
331 } else { 331 } else {
332 basePage.unlinkFromNextPage(nextPage); 332 basePage.unlinkFromNextPage(nextPage);
333 } 333 }
334 } 334 }
335 } 335 }
336 } 336 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698