Package org.jboss.errai.ui.nav.client.local.api

Examples of org.jboss.errai.ui.nav.client.local.api.NavigationControl


      }
    });
  }

  private <W extends IsWidget> void pageHiding(final W widget, final Request<W> request, final boolean fireEvent) {
    final NavigationControl control = new NavigationControl(new Runnable() {

      @Override
      public void run() {
        final Access<W> accessEvent = new AccessImpl<W>();
        accessEvent.fireAsync(widget, new LifecycleCallback() {

          @Override
          public void callback(final boolean success) {
            if (success) {
              locked = true;
              try {
                hideCurrentPage();
                request.pageNode.pageShowing(widget, request.state);

                // Fire IOC lifecycle event to indicate that the state of the
                // bean has changed.
                // TODO make this smarter and only fire state change event when
                // fields actually changed.
                stateChangeEvent.fireAsync(widget);

                setCurrentPage(request.pageNode);
                currentWidget = widget;
                navigatingContainer.setWidget(widget);
                request.pageNode.pageShown(widget, request.state);
              } finally {
                locked = false;
              }

              handleQueuedRequests(request, fireEvent);
            }
            else {
              request.pageNode.destroy(widget);
            }
          }
        });
      }
    });

    if (currentPage != null && currentWidget != null && currentWidget.asWidget() == navigatingContainer.getWidget()) {
      currentPage.pageHiding(currentWidget, control);
    }
    else {
      control.proceed();
    }
  }
View Full Code Here


      }
    });
  }

  private <W extends IsWidget> void pageHiding(final W widget, final Request<W> request, final boolean fireEvent) {
    final NavigationControl control = new NavigationControl(new Runnable() {

      @Override
      public void run() {
        final Access<W> accessEvent = new AccessImpl<W>();
        accessEvent.fireAsync(widget, new LifecycleCallback() {

          @Override
          public void callback(final boolean success) {
            if (success) {
              locked = true;
              try {
                hideCurrentPage();
                request.pageNode.pageShowing(widget, request.state);

                // Fire IOC lifecycle event to indicate that the state of the
                // bean has changed.
                // TODO make this smarter and only fire state change event when
                // fields actually changed.
                stateChangeEvent.fireAsync(widget);

                setCurrentPage(request.pageNode);
                currentWidget = widget;
                navigatingContainer.setWidget(widget);
                request.pageNode.pageShown(widget, request.state);
              } finally {
                locked = false;
              }

              handleQueuedRequests(request, fireEvent);
            }
            else {
              request.pageNode.destroy(widget);
            }
          }
        });
      }
    });

    if (currentPage != null && currentWidget != null && currentWidget.asWidget() == navigatingContainer.getWidget()) {
      currentPage.pageHiding(currentWidget, control);
    }
    else {
      control.proceed();
    }
  }
View Full Code Here

      }
    });
  }

  private <W extends IsWidget> void pageHiding(final W widget, final Request<W> request, final boolean fireEvent) {
    final NavigationControl control = new NavigationControl(new Runnable() {

      @Override
      public void run() {
        final Access<W> accessEvent = new AccessImpl<W>();
        accessEvent.fireAsync(widget, new LifecycleCallback() {

          @Override
          public void callback(final boolean success) {
            if (success) {
              locked = true;
              try {
                hideCurrentPage();
                request.pageNode.pageShowing(widget, request.state);

                // Fire IOC lifecycle event to indicate that the state of the
                // bean has changed.
                // TODO make this smarter and only fire state change event when
                // fields actually changed.
                stateChangeEvent.fireAsync(widget);

                setCurrentPage(request.pageNode);
                currentWidget = widget;
                navigatingContainer.setWidget(widget);
                request.pageNode.pageShown(widget, request.state);
              } finally {
                locked = false;
              }

              handleQueuedRequests(request, fireEvent);
            }
            else {
              request.pageNode.destroy(widget);
            }
          }
        });
      }
    });

    if (currentPage != null && currentWidget != null && currentWidget.asWidget() == navigatingContainer.getWidget()) {
      currentPage.pageHiding(currentWidget, control);
    }
    else {
      control.proceed();
    }
  }
View Full Code Here

      }
    });
  }

  private <W extends IsWidget> void pageHiding(final W widget, final Request<W> request, final boolean fireEvent) {
    final NavigationControl control = new NavigationControl(new Runnable() {

      @Override
      public void run() {
        final Access<W> accessEvent = new AccessImpl<W>();
        accessEvent.fireAsync(widget, new LifecycleCallback() {

          @Override
          public void callback(final boolean success) {
            if (success) {
              locked = true;
              try {
                hideCurrentPage();
                request.pageNode.pageShowing(widget, request.state);

                // Fire IOC lifecycle event to indicate that the state of the
                // bean has changed.
                // TODO make this smarter and only fire state change event when
                // fields actually changed.
                stateChangeEvent.fireAsync(widget);

                setCurrentPage(request.pageNode);
                currentWidget = widget;
                navigatingContainer.setWidget(widget);
                request.pageNode.pageShown(widget, request.state);
              } finally {
                locked = false;
              }

              handleQueuedRequests(request, fireEvent);
            }
            else {
              request.pageNode.destroy(widget);
            }
          }
        });
      }
    });

    if (currentPage != null && currentWidget != null && currentWidget.asWidget() == navigatingContainer.getWidget()) {
      currentPage.pageHiding(currentWidget, control);
    }
    else {
      control.proceed();
    }
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.ui.nav.client.local.api.NavigationControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.