| Index: pkg/analysis_services/lib/src/refactoring/refactoring.dart
|
| diff --git a/pkg/analysis_services/lib/src/refactoring/refactoring.dart b/pkg/analysis_services/lib/src/refactoring/refactoring.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c8dc4f7743e87bd6f36affd1397dddc7c91635c2
|
| --- /dev/null
|
| +++ b/pkg/analysis_services/lib/src/refactoring/refactoring.dart
|
| @@ -0,0 +1,46 @@
|
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +// This code was auto-generated, is not intended to be edited, and is subject to
|
| +// significant change. Please see the README file for more information.
|
| +
|
| +library services.src.refactoring;
|
| +
|
| +import 'package:analysis_services/correction/status.dart';
|
| +import 'package:analysis_services/refactoring/progress_monitor.dart';
|
| +import 'package:analysis_services/refactoring/refactoring.dart';
|
| +import 'package:analysis_services/src/refactoring/progress_monitor.dart';
|
| +
|
| +
|
| +/**
|
| + * Returns [pm] if not `null` or a new [NullProgressMonitor] instance.
|
| + */
|
| +ProgressMonitor checkProgressMonitor(ProgressMonitor pm) {
|
| + if (pm != null) {
|
| + return pm;
|
| + }
|
| + return new NullProgressMonitor();
|
| +}
|
| +
|
| +
|
| +/**
|
| + * Abstract implementation of {@link Refactoring}.
|
| + */
|
| +abstract class RefactoringImpl implements Refactoring {
|
| + @override
|
| + RefactoringStatus checkAllConditions(ProgressMonitor pm) {
|
| + pm = checkProgressMonitor(pm);
|
| + pm.beginTask("", 2);
|
| + RefactoringStatus result = new RefactoringStatus();
|
| + result.merge(checkInitialConditions(new SubProgressMonitor(pm, 1)));
|
| + if (!result.hasFatalError) {
|
| + if (pm.isCanceled) {
|
| + throw new OperationCanceledException();
|
| + }
|
| + result.merge(checkFinalConditions(new SubProgressMonitor(pm, 1)));
|
| + }
|
| + pm.done();
|
| + return result;
|
| + }
|
| +}
|
|
|