Beispiel #1
0
 public void nodeChanged(final NodeChangeEvent event) {
   IMapSelection selection = Controller.getCurrentController().getSelection();
   if (selection != null) {
     if (event.getNode() != selection.getSelected()) {
       return;
     }
   }
   changeToolbar(event.getNode());
 }
  @Override
  public void nodeChanged(final NodeChangeEvent event) {
    if (!isUpdating()) {
      if (event != null && event.getProperty() != null)
        LogUtils.info("attribute: " + event.getProperty().toString());
      if (event != null && event.getNewValue() != null)
        LogUtils.info("value: " + event.getNewValue().toString());

      if (event.getProperty() != null && event.getProperty().equals("node_text")) {
        LogUtils.info("node_text");
        webservice()
            .changeNode(
                user().getUsername(),
                user().getAccessToken(),
                "5",
                event.getNode().getID(),
                "nodeText",
                event.getNewValue());
        // final ListenableFuture<Boolean> future =
        // webservice().changeNode("5", event.getNode().getID(),
        // "nodeText", event.getNewValue());
        // Futures.addCallback(future, new FutureCallback<Boolean>() {
        // @Override
        // public void onFailure(Throwable t) {
        // t.printStackTrace();
        // }
        //
        // @Override
        // public void onSuccess(Boolean success) {
        // if (!success) {
        // isUpdating(true);
        // event.getNode().setText(event.getOldValue().toString());
        // isUpdating(false);
        // }
        // }
        // });
      }
      // node_text

    }
  }