@Override
 protected void onUnbind() {
   super.onUnbind();
   if (handlerRegistration != null) {
     handlerRegistration.removeHandler();
   }
 }
  @Override
  @SuppressWarnings("unchecked")
  protected void onBind() {
    super.onBind();
    getView().setPresenter(this);

    // GWT event handler
    registerHandler(getEventBus().addHandler(PreviewEvent.TYPE, this));
    registerHandler(getEventBus().addHandler(FinderScrollEvent.TYPE, this));
    registerHandler(getEventBus().addHandler(ClearFinderSelectionEvent.TYPE, this));
  }
  @Override
  protected void onBind() {
    super.onBind();
    getView().setPresenter(this);

    HandlerRegistration previewReg = getEventBus().addHandler(PreviewEvent.TYPE, this);

    handlerRegistration =
        serverStore.addChangeHandler(
            new PropagatesChange.Handler() {
              @Override
              public void onChange(Action action) {

                if (!isVisible()) return; // don't process anything when not visible

                if (action instanceof SelectServer) {
                  // changing the server selection: update subsystems on server
                  if (hostStore.hasSelectedServer()) {
                    Scheduler.get()
                        .scheduleDeferred(
                            new Scheduler.ScheduledCommand() {
                              @Override
                              public void execute() {
                                loadSubsystems();
                              }
                            });
                  } else {
                    getView().setSubsystems(Collections.EMPTY_LIST);
                  }
                }

                // clear the view
                else if (action instanceof FilterType) {
                  getView().clearServerList();
                }

                // Refresh the server list when:
                // - changes to host/group filter refresh the server list
                // - group and host selection events
                // - server's are added or removed

                else if ((action instanceof FilterType)
                    || (action instanceof GroupSelection)
                    || (action instanceof HostSelection)
                    || (action instanceof RemoveServer)
                    || (action instanceof AddServer)
                    || (action instanceof CopyServer)
                    || (action instanceof RefreshServer)) {

                  refreshServerList();
                }
              }
            });
  }
 @Override
 protected void onReset() {
   super.onReset();
   Console.MODULES.getHeader().highlight(getProxy().getNameToken());
 }
 @Override
 protected void onReset() {
   super.onReset();
   if (placeManager.getCurrentPlaceRequest().matchesNameToken(getProxy().getNameToken()))
     refreshServerList();
 }