예제 #1
0
 @Override
 public void onWisemlLoaded(final WisemlLoadedEvent event) {
   final Setup setup = event.getWiseml().getSetup();
   if (setup != null) {
     view.setTreeViewModel(
         new NodeTreeViewModel(
             testbedConfiguration, setup.getNode(), nodeSelectionModel, nodeGroupSelectionModel));
   }
   view.getLoadingIndicator().hideLoading();
 }
예제 #2
0
  @Override
  public void onTestbedSelected(final TestbedSelectedEvent event) {
    // TODO Find out why loading indicator is not shown...
    view.getLoadingIndicator().showLoading("Testbed Nodes");

    // Clear tree
    view.setTreeViewModel(
        new NodeTreeViewModel(
            testbedConfiguration,
            new ArrayList<Node>(0),
            nodeSelectionModel,
            nodeGroupSelectionModel));

    this.testbedConfiguration = event.getConfiguration();

    final AsyncCallback<Wiseml> callback =
        new AsyncCallback<Wiseml>() {

          public void onSuccess(final Wiseml result) {
            if (result != null) {
              result.setSetup(DefaultsHelper.apply(result.getSetup()));
            }
            eventBus.fireEvent(new WisemlLoadedEvent(result));
          }

          public void onFailure(final Throwable caught) {
            view.getLoadingIndicator().hideLoading();
            eventBus.fireEvent(new ThrowableEvent(caught));
          }
        };
    final String url = testbedConfiguration.getSessionmanagementEndpointUrl().trim();
    Scheduler.get()
        .scheduleDeferred(
            new Scheduler.ScheduledCommand() {

              public void execute() {
                service.getWiseml(url, callback);
              }
            });
  }