Пример #1
0
  @Override
  public void execute(final ProjectNode node) {
    final MessagesOutput messagesOutput = MessagesOutput.getMessagesOutput();
    messagesOutput.addMessages(MESSAGES.downloadingToPhoneMessage());

    final RpcStatusPopup rpcStatusPopup = Ode.getInstance().getRpcStatusPopup();

    AsyncCallback<Void> callback =
        new AsyncCallback<Void>() {
          @Override
          public void onFailure(Throwable caught) {
            rpcStatusPopup.onFailure(FAKE_RPC_NAME, caught);
            ErrorReporter.reportError(MESSAGES.downloadToPhoneFailedMessage());
            executionFailedOrCanceled();
          }

          @Override
          public void onSuccess(Void result) {
            rpcStatusPopup.onSuccess(FAKE_RPC_NAME, result);
            Window.alert(MESSAGES.downloadToPhoneSucceededMessage());
            executeNextCommand(node);
          }
        };

    String packageName;
    if (node instanceof YoungAndroidProjectNode) {
      YoungAndroidProjectNode yaNode = (YoungAndroidProjectNode) node;
      packageName = yaNode.getPackageNode().getPackageName();
    } else {
      ErrorReporter.reportError(MESSAGES.downloadToPhoneFailedMessage());
      executionFailedOrCanceled();
      return;
    }

    rpcStatusPopup.onStart(FAKE_RPC_NAME);
    String apkFilePath =
        BUILD_FOLDER
            + "/"
            + YoungAndroidProjectNode.YOUNG_ANDROID_TARGET_ANDROID
            + "/"
            + node.getName()
            + ".apk";
    CodeblocksManager.getCodeblocksManager()
        .installApplication(apkFilePath, node.getName(), packageName, callback);
  }
 @Override
 public void execute(final ProjectNode node) {
   // Display a barcode for an url pointing at our server's download servlet
   String barcodeUrl =
       CHARTSERVER_BARCODE_URI
           + GWT.getModuleBaseURL()
           + ServerLayout.genRelativeDownloadPath(node.getProjectId(), target);
   OdeLog.log("Barcode url is: " + barcodeUrl);
   new BarcodeDialogBox(node.getName(), barcodeUrl).center();
 }