Examples of PushChangesPlan


Examples of org.chromium.debug.core.model.PushChangesPlan

        List<Optional<PushChangesPlan>> result =
            new ArrayList<DialogUtils.Optional<PushChangesPlan>>(input.size());
        for (ScriptTargetMapping mapping : input) {
          Optional<PushChangesPlan> optionalPlan;
          try {
            PushChangesPlan plan = PushChangesPlan.create(mapping);
            optionalPlan = createOptional(plan);
          } catch (RuntimeException e) {
            // TODO: have more specific exception types to catch.
            optionalPlan = createErrorOptional(new Message(
                Messages.WizardLogicBuilder_FAILED_TO_GET,
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

      createProcessor(handleErrors(
          new NormalExpression<LiveEditDiffViewer.Input>() {
            @Calculate
            public Optional<? extends LiveEditDiffViewer.Input> calculate(
                PreviewLoader.Data previewRawResultParam) {
              final PushChangesPlan changesPlan = singlePlanValue.getValue();

              return previewRawResultParam.accept(
                  new PreviewLoader.Data.Visitor<Optional<LiveEditDiffViewer.Input>>() {
                @Override
                public Optional<LiveEditDiffViewer.Input> visitSuccess(
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

      requestPreview();
    }
  }

  private void requestPreview() {
    final PushChangesPlan plan = inputParameterSource.getValue();
    boolean inputIsNew = dataMonitor.updateInputAndStarted(plan);
    if (!inputIsNew) {
      return;
    }

    // Report about our value becoming empty.
    updater.reportChanged(this);

    UpdatableScript.UpdateCallback callback = new UpdatableScript.UpdateCallback() {
      public void failure(final String message, UpdatableScript.Failure failure) {
        Optional<Data> result = failure.accept(
            new UpdatableScript.Failure.Visitor<Optional<Data>>() {
          @Override
          public Optional<Data> visitUnspecified() {
            return createErrorOptional(
                new Message(NLS.bind(Messages.PreviewLoader_FAILED_TO_GET, message),
                    MessagePriority.WARNING));
          }

          @Override
          public Optional<Data> visitCompileError(final CompileErrorFailure compileError) {
            Data data = new Data() {
              @Override
              public <R> R accept(Visitor<R> visitor) {
                return visitor.visitCompileError(compileError);
              }
              @Override public PushChangesPlan getChangesPlan() {
                return plan;
              }
            };
            return createOptional(data);
          }
        });
        done(result);
      }
      public void success(boolean resumed, Object report,
          final UpdatableScript.ChangeDescription changeDescription) {
        Optional<Data> result;
        if (changeDescription == null) {
          result = EMPTY_DATA;
        } else {
          Data data = new Data() {
            @Override public PushChangesPlan getChangesPlan() {
              return plan;
            }
            @Override public <R> R accept(Visitor<R> visitor) {
              return visitor.visitSuccess(changeDescription);
            }
          };
          result = createOptional(data);
        }
        done(result);
      }
      private void done(Optional<Data> result) {
        boolean resultTaken = dataMonitor.updateResult(result, plan);
        if (resultTaken) {
          updater.reportChanged(PreviewLoader.this);
          updater.updateAsync();
        }
      }
    };

    plan.execute(true, callback, null);
  }
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

    }
  }

  private void execute(final ScriptTargetMapping filePair, final Shell shell,
      final LiveEditResultDialog.ErrorPositionHighlighter positionHighlighter) {
    final PushChangesPlan plan = PushChangesPlan.create(filePair);

    UpdatableScript.UpdateCallback callback = new UpdatableScript.UpdateCallback() {
      @Override
      public void success(boolean resumed, Object report, ChangeDescription changeDescription) {
        ChromiumDebugPlugin.log(new Status(IStatus.OK, ChromiumDebugPlugin.PLUGIN_ID,
            "Script has been successfully updated on remote: " + report)); //$NON-NLS-1$
      }

      @Override
      public void failure(final String message, final UpdatableScript.Failure failure) {
        shell.getDisplay().asyncExec(new Runnable() {
          @Override
          public void run() {
            SingleInput textInput = LiveEditResultDialog.createTextInput(message, plan,
                failure);
            LiveEditResultDialog dialog =
                new LiveEditResultDialog(shell, textInput, positionHighlighter);
            dialog.open();
          }
        });
      }
    };

    plan.execute(false, callback, null);
  }
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

      execute(pair, shell);
    }
  }

  private void execute(final ScriptTargetMapping filePair, final Shell shell) {
    final PushChangesPlan plan = PushChangesPlan.create(filePair);

    UpdatableScript.UpdateCallback callback = new UpdatableScript.UpdateCallback() {
      @Override
      public void success(Object report, ChangeDescription changeDescription) {
        ChromiumDebugPlugin.log(new Status(IStatus.OK, ChromiumDebugPlugin.PLUGIN_ID,
            "Script has been successfully updated on remote: " + report)); //$NON-NLS-1$
      }

      @Override
      public void failure(final String message) {
        shell.getDisplay().asyncExec(new Runnable() {
          @Override
          public void run() {
            LiveEditResultDialog dialog = new LiveEditResultDialog(shell,
                LiveEditResultDialog.createTextInput(message, plan));
            dialog.open();
          }
        });
      }
    };

    plan.execute(false, callback, null);
  }
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

        List<Optional<PushChangesPlan>> result =
            new ArrayList<DialogUtils.Optional<PushChangesPlan>>(input.size());
        for (ScriptTargetMapping mapping : input) {
          Optional<PushChangesPlan> optionalPlan;
          try {
            PushChangesPlan plan = PushChangesPlan.create(mapping);
            optionalPlan = createOptional(plan);
          } catch (RuntimeException e) {
            // TODO: have more specific exception types to catch.
            optionalPlan = createErrorOptional(new Message(
                "Failed to get script source from a file. See log for details.",
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

      createProcessor(handleErrors(
          new NormalExpression<LiveEditDiffViewer.Input>() {
            @Calculate
            public Optional<? extends LiveEditDiffViewer.Input> calculate(
                PreviewLoader.Data previewRawResultParam) {
              PushChangesPlan changesPlan = singlePlanValue.getValue();
              ChangeDescription changeDescription = previewRawResultParam.getChangeDescription();
              Optional<LiveEditDiffViewer.Input> result;
              if (changeDescription == null) {
                result = createOptional(null);
              } else {
View Full Code Here

Examples of org.chromium.debug.core.model.PushChangesPlan

      requestPreview();
    }
  }

  private void requestPreview() {
    final PushChangesPlan plan = inputParameterSource.getValue();
    boolean inputIsNew = dataMonitor.updateInputAndStarted(plan);
    if (!inputIsNew) {
      return;
    }

    // Report about our value becoming empty.
    updater.reportChanged(this);

    UpdatableScript.UpdateCallback callback = new UpdatableScript.UpdateCallback() {
      public void failure(String message) {
        Optional<Data> error = createErrorOptional(
            new Message(NLS.bind(Messages.PreviewLoader_FAILED_TO_GET, message),
                MessagePriority.WARNING));
        done(error);
      }
      public void success(Object report,
          final UpdatableScript.ChangeDescription changeDescription) {
        Optional<Data> result;
        if (changeDescription == null) {
          result = EMPTY_DATA;
        } else {
          Data data = new Data() {
            @Override public PushChangesPlan getChangesPlan() {
              return plan;
            }
            @Override public ChangeDescription getChangeDescription() {
              return changeDescription;
            }
          };
          result = createOptional(data);
        }
        done(result);
      }
      private void done(Optional<Data> result) {
        boolean resultTaken = dataMonitor.updateResult(result, plan);
        if (resultTaken) {
          updater.reportChanged(PreviewLoader.this);
          updater.updateAsync();
        }
      }
    };

    plan.execute(true, callback, null);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.