Examples of NavigationOutcome


Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

    given(this.context.getAttributes()).willReturn(attributes);
  }

  @Test
  public void shouldSupportMultipleItems() throws Exception {
    DestinationAndModel d1 = new DestinationAndModel(new NavigationOutcome(new Object()), (ActionEvent) null);
    DestinationAndModel d2 = new DestinationAndModel(new NavigationOutcome(new Object()), (ActionEvent) null);

    String k1 = this.registry.put(this.context, d1);
    String k2 = this.registry.put(this.context, d2);

    assertThat(k1, is(not(equalTo(k2))));

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

    assertThat(this.registry.get(this.context, "missing"), is(nullValue()));
  }

  @Test
  public void shouldNeedFacesContext() throws Exception {
    DestinationAndModel d = new DestinationAndModel(new NavigationOutcome(new Object()), (ActionEvent) null);
    this.thown.expect(IllegalStateException.class);
    this.registry.put(null, d);
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

  }

  @Test
  public void shouldResolveToNullWhenNotIsResolveView() throws Exception {
    final Object view = new Object();
    NavigationOutcome resolved = doCustomResolve(view, null, true);
    assertThat(resolved, is(nullValue()));
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

    assertThat(resolved, is(nullValue()));
  }

  @Test
  public void shouldNotWrapResolvedNavigationOutcome() throws Exception {
    final NavigationOutcome view = new NavigationOutcome("");
    NavigationOutcome resolved = doCustomResolve(view, null, false);
    assertThat(resolved, is(sameInstance(view)));
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

  @Test
  public void shouldResolvedNavigationOutcomeWithModel() throws Exception {
    final Object view = "";
    final Map<String, ?> model = Collections.singletonMap("k", "v");
    NavigationOutcome resolved = doCustomResolve(view, model, false);
    assertThat(resolved.getDestination(), is(sameInstance(view)));
    assertThat(resolved.getImplicitModel().get("k"), is(equalTo((Object) "v")));
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

      String defaultDestinationViewId = getDefaultDestinationViewId(context, fromAction, outcome);
      NavigationContext navigationContext = new NavigationContextImpl(fromAction, outcome, true, component,
          defaultDestinationViewId);
      if (this.navigationOutcomeResolver.canResolve(context, navigationContext)) {
        try {
          NavigationOutcome navigationOutcome = this.navigationOutcomeResolver.resolve(context,
              navigationContext);
          Assert.state(navigationOutcome != null, "Unable to resolve required navigation outcome '" + outcome
              + "'");
          UIViewRoot root = context.getViewRoot();
          String fromViewId = (root != null ? root.getViewId() : null);

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

      String defaultDestinationViewId = getDefaultDestinationViewId(context, fromAction, outcome);
      NavigationContext navigationContext = new NavigationContextImpl(fromAction, outcome, false, component,
          defaultDestinationViewId);
      if (this.navigationOutcomeResolver.canResolve(context, navigationContext)) {
        try {
          NavigationOutcome navigationOutcome = this.navigationOutcomeResolver.resolve(context,
              navigationContext);
          if (navigationOutcome != null) {
            String viewId = this.destinationAndModelRegistry.put(context, new DestinationAndModel(
                navigationOutcome, actionEvent));
            UIViewRoot newRoot = context.getApplication().getViewHandler().createView(context, viewId);

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

      return null;
    }
    if (result instanceof NavigationOutcome) {
      return (NavigationOutcome) result;
    }
    return new NavigationOutcome(result, modelAndViewContainer.getModel());
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

  }

  @NavigationMapping
  public NavigationOutcome onAnnotationLink() {
    // The the logic outcome is "annotationLink" is determined from the method name
    return new NavigationOutcome("@destination", Collections.<String, Object> singletonMap("s", "from annotation"));
  }

Examples of org.springframework.springfaces.mvc.navigation.NavigationOutcome

  }

  @Test
  public void shouldGetDestinationFromNavigationOutcome() throws Exception {
    Object destination = new Object();
    NavigationOutcome outcome = new NavigationOutcome(destination);
    DestinationAndModel dam = new DestinationAndModel(outcome, (ActionEvent) null);
    assertThat(dam.getDestination(), is(sameInstance(destination)));
  }
TOP
Copyright © 2018 www.massapi.com. 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.