コード例 #1
0
  public void launchNewConfigDialoge() {

    window = new DefaultWindow("Create Server Configuration");
    window.setWidth(480);
    window.setHeight(360);
    window.addCloseHandler(
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {
            /*if(selectedRecord==null)
            History.back();*/
          }
        });

    serverGroupStore.loadServerGroups(
        new SimpleCallback<List<ServerGroupRecord>>() {
          @Override
          public void onSuccess(List<ServerGroupRecord> result) {
            serverGroups = result;
            window.setWidget(
                new NewServerConfigWizard(ServerConfigPresenter.this, serverGroups).asWidget());

            window.setGlassEnabled(true);
            window.center();
          }
        });
  }
コード例 #2
0
 @Override
 public void onStaleModel(String modelName) {
   if (StaleModelEvent.SERVER_GROUPS.equals(modelName)) {
     serverGroupStore.loadServerGroups(
         new SimpleCallback<List<ServerGroupRecord>>() {
           @Override
           public void onSuccess(List<ServerGroupRecord> result) {
             getView().updateServerGroups(result);
           }
         });
   }
 }
コード例 #3
0
  private void loadSocketBindings() {
    serverGroupStore.loadSocketBindingGroupNames(
        new SimpleCallback<List<String>>() {
          @Override
          public void onSuccess(List<String> result) {
            getView().updateSocketBindings(result);

            // step2
            loadServerConfigurations();
          }
        });
  }
コード例 #4
0
  @Override
  protected void onReveal() {
    super.onReveal();

    PlaceRequest currentPlaceRequest = placeManager.getCurrentPlaceRequest();
    if (!hasBeenRevealed
        && NameTokens.ServerGroupMgmtPresenter.equals(currentPlaceRequest.getNameToken())) {
      hasBeenRevealed = true;

      // update LHS
      serverGroupStore.loadServerGroups(
          new SimpleCallback<List<ServerGroupRecord>>() {
            @Override
            public void onSuccess(List<ServerGroupRecord> result) {
              getView().updateServerGroups(result);
            }
          });

      // forward default to ServerGroupPresenter, this presenter doesn't have a default view
      placeManager.revealRelativePlace(new PlaceRequest(NameTokens.ServerGroupPresenter));
    }
  }
コード例 #5
0
  private void loadSubsystems(ServerInstance server) {
    if (!server.getName().equals(previousServerSelection)) {
      previousServerSelection = server.getName();

      // load subsystems for selected server

      serverGroupStore.loadServerGroup(
          server.getGroup(),
          new SimpleCallback<ServerGroupRecord>() {
            @Override
            public void onSuccess(ServerGroupRecord group) {
              subsysStore.loadSubsystems(
                  group.getProfileName(),
                  new SimpleCallback<List<SubsystemRecord>>() {
                    @Override
                    public void onSuccess(List<SubsystemRecord> result) {
                      getView().setSubsystems(result);

                      Scheduler.get()
                          .scheduleDeferred(
                              new Scheduler.ScheduledCommand() {
                                @Override
                                public void execute() {
                                  Console.MODULES
                                      .getEventBus()
                                      .fireEvent(
                                          new LHSHighlightEvent(
                                              placeManager
                                                  .getCurrentPlaceRequest()
                                                  .getNameToken()));
                                }
                              });
                    }
                  });
            }
          });
    }
  }