• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java NavigationCase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.faces.application.NavigationCase的典型用法代码示例。如果您正苦于以下问题:Java NavigationCase类的具体用法?Java NavigationCase怎么用?Java NavigationCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NavigationCase类属于javax.faces.application包,在下文中一共展示了NavigationCase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getNavigationCases

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public Map<String, Set<NavigationCase>> getNavigationCases()
{
    Map<String, Set<NavigationCase>> result = null;

    if (this.wrapped instanceof ConfigurableNavigationHandler)
    {
        result = ((ConfigurableNavigationHandler) this.wrapped).getNavigationCases();
    }

    if (result == null)
    {
        result = new HashMap<String, Set<NavigationCase>>();
    }

    if (!this.activated)
    {
        return result;
    }

    return new NavigationCaseMapWrapper(result, this.wrapped);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:23,代码来源:DeltaSpikeNavigationHandler.java


示例2: put

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public Set<NavigationCase> put(String key, Set<NavigationCase> value)
{
    if (value == null)
    {
        return null;
    }

    Set<NavigationCase> result = new HashSet<NavigationCase>();

    //filter entries created by createViewConfigBasedNavigationCases
    for (NavigationCase navigationCase : value)
    {
        if (!(navigationCase.getFromOutcome() == null && navigationCase.getFromAction() == null))
        {
            result.add(navigationCase);
        }
    }

    //delegate to the wrapped instance -> the innermost handler needs to receive it
    //(because mojarra uses ConfigurableNavigationHandler#getNavigationCases
    // to add cases for std. nav.rules from the outside)
    return this.wrapped.getNavigationCases().put(key, result);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:25,代码来源:NavigationCaseMapWrapper.java


示例3: handleNavigation

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * Handles redirection. After POST action is done on the page and redirect
 * to the same page is found, informs navigation handler to do GET in order
 * to avoid f.e. Form Resubmission.
 *
 * @param context
 *            - FacesContext
 * @param from
 *            - navigate from
 * @param outcome
 *            - navigate to
 */
@Override
public void handleNavigation(FacesContext context, String from,
        String outcome) {
    NavigationCase navCase = getNavigationCase(context, from, outcome);
    
    if (notNull(context, navCase, from, outcome)
            && isRedirectNeeded(context, outcome)
            && isSamePageRedirect(navCase, context)) {
        outcome = navCase.getToViewId(context) + FACES_REDIRECT;
    }
    
    parent.handleNavigation(context, from, outcome);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:26,代码来源:RedirectNavigationHandler.java


示例4: getNavigationCase

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * @param context
 * @param fromAction
 * @param outcome
 * @return
 */
@Override
public NavigationCase getNavigationCase(FacesContext context,
        String fromAction, String outcome) {
    if (parent instanceof ConfigurableNavigationHandler) {
        return ((ConfigurableNavigationHandler) parent).getNavigationCase(
                context, fromAction, outcome);
    } else {
        return null;
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:17,代码来源:RedirectNavigationHandler.java


示例5: getNavigationCases

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * @return
 */
@Override
public Map<String, Set<NavigationCase>> getNavigationCases() {
    if (parent instanceof ConfigurableNavigationHandler) {
        return ((ConfigurableNavigationHandler) parent)
                .getNavigationCases();
    } else {
        return null;
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:13,代码来源:RedirectNavigationHandler.java


示例6: getNavigationCase

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public NavigationCase getNavigationCase(FacesContext context, String fromAction,
    String outcome)
{
  if (!(_delegate instanceof ConfigurableNavigationHandler))
    return null;
  
  return ((ConfigurableNavigationHandler)_delegate).getNavigationCase(context, fromAction, outcome);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:10,代码来源:NavigationHandlerImpl.java


示例7: getNavigationCases

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public Map<String, Set<NavigationCase>> getNavigationCases()
{
  if (!(_delegate instanceof ConfigurableNavigationHandler))
    return _emptyCaces;
  
  return ((ConfigurableNavigationHandler)_delegate).getNavigationCases();
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:NavigationHandlerImpl.java


示例8: determineTargetURL

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * Translate the outcome attribute value to the target URL.
 *
 * @param context
 *            the current FacesContext
 * @param outcome
 *            the value of the outcome attribute
 * @return the target URL of the navigation rule (or the outcome if there's
 *         not navigation rule)
 */
private String determineTargetURL(FacesContext context, Button button, String outcome) {
	ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
			.getNavigationHandler();
	NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
	/*
	 * Param Name: javax.faces.PROJECT_STAGE Default Value: The default
	 * value is ProjectStage#Production but IDE can set it differently in
	 * web.xml Expected Values: Development, Production, SystemTest,
	 * UnitTest Since: 2.0
	 *
	 * If we cannot get an outcome we use an Alert to give a feedback to the
	 * Developer if this build is in the Development Stage
	 */
	if (navCase == null) {
		if (FacesContext.getCurrentInstance().getApplication().getProjectStage().equals(ProjectStage.Development)) {
			return "alert('WARNING! " + C.W_NONAVCASE_BUTTON + "');";
		} else {
			return "";
		}
	} // throw new FacesException("The outcome '"+outcome+"' cannot be
		// resolved."); }
	String vId = navCase.getToViewId(context);

	Map<String, List<String>> params = getParams(navCase, button);
	String url;
	url = context.getApplication().getViewHandler().getBookmarkableURL(context, vId, params,
			button.isIncludeViewParams() || navCase.isIncludeViewParams());
	return url;
}
 
开发者ID:stephanrauh,项目名称:JSFLibraryGenerator,代码行数:40,代码来源:ButtonRenderer.java


示例9: getParams

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * Find all parameters to include by looking at nested uiparams and params
 * of navigation case
 */
protected static Map<String, List<String>> getParams(NavigationCase navCase, Button button) {
	Map<String, List<String>> params = new LinkedHashMap<String, List<String>>();

	// UIParams
	for (UIComponent child : button.getChildren()) {
		if (child.isRendered() && (child instanceof UIParameter)) {
			UIParameter uiParam = (UIParameter) child;

			if (!uiParam.isDisable()) {
				List<String> paramValues = params.get(uiParam.getName());
				if (paramValues == null) {
					paramValues = new ArrayList<String>();
					params.put(uiParam.getName(), paramValues);
				}

				paramValues.add(String.valueOf(uiParam.getValue()));
			}
		}
	}

	// NavCase Params
	Map<String, List<String>> navCaseParams = navCase.getParameters();
	if (navCaseParams != null && !navCaseParams.isEmpty()) {
		for (Map.Entry<String, List<String>> entry : navCaseParams.entrySet()) {
			String key = entry.getKey();

			// UIParams take precedence
			if (!params.containsKey(key)) {
				params.put(key, entry.getValue());
			}
		}
	}

	return params;
}
 
开发者ID:stephanrauh,项目名称:JSFLibraryGenerator,代码行数:40,代码来源:ButtonRenderer.java


示例10: getNavigationCase

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/** Calls the default implementation */
@Override
public NavigationCase getNavigationCase(FacesContext context,
		String fromAction, String outcome) {
	if (wrappedNavigationHandler instanceof ConfigurableNavigationHandler) {
		return ((ConfigurableNavigationHandler) wrappedNavigationHandler)
				.getNavigationCase(context, fromAction, outcome);
	} else {
		return null;
	}
}
 
开发者ID:stephanrauh,项目名称:JSF-on-Spring-Boot,代码行数:12,代码来源:BeyondViewScopeNavigationHandler.java


示例11: getNavigationCases

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/** Calls the default implementation */
@Override
public Map<String, Set<NavigationCase>> getNavigationCases() {
	if (wrappedNavigationHandler instanceof ConfigurableNavigationHandler) {
		return ((ConfigurableNavigationHandler) wrappedNavigationHandler)
				.getNavigationCases();
	} else {
		return null;
	}
}
 
开发者ID:stephanrauh,项目名称:JSF-on-Spring-Boot,代码行数:11,代码来源:BeyondViewScopeNavigationHandler.java


示例12: encodeHref

import javax.faces.application.NavigationCase; //导入依赖的package包/类
private String encodeHref(FacesContext context, AbstractNavLink navlink) {
	String href = navlink.getHref();

	String url;

	if (href != null) {
		url = getResourceURL(context, href);
		return url;
	} else {
		String outcome = navlink.getOutcome();
		if (outcome==null) {
			return null;
		}

		ConfigurableNavigationHandler cnh = (ConfigurableNavigationHandler) context.getApplication()
				.getNavigationHandler();
		NavigationCase navCase = cnh.getNavigationCase(context, null, outcome);
		if (navCase == null) {
			return null;
		}
		String vId = navCase.getToViewId(context);

		Map<String, List<String>> params = getParams(navCase, navlink);

		url = context.getApplication().getViewHandler().getBookmarkableURL(context, vId, params,
				navlink.isIncludeViewParams() || navCase.isIncludeViewParams());

		if (url != null) {
			String frag = navlink.getFragment();
			if (frag != null) {
				url += "#" + frag;
			}
			return url;
		} else {
			return "#";
		}
	}

}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:40,代码来源:NavLinkRenderer.java


示例13: getParams

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * Find all parameters to include by looking at nested uiparams and params
 * of navigation case
 */
protected Map<String, List<String>> getParams(NavigationCase navCase, AbstractNavLink button) {
	Map<String, List<String>> params = new LinkedHashMap<String, List<String>>();

	// UIParams
	for (UIComponent child : ((UIComponent) button).getChildren()) {
		if (child.isRendered() && (child instanceof UIParameter)) {
			UIParameter uiParam = (UIParameter) child;

			if (!uiParam.isDisable()) {
				List<String> paramValues = params.get(uiParam.getName());
				if (paramValues == null) {
					paramValues = new ArrayList<String>();
					params.put(uiParam.getName(), paramValues);
				}

				paramValues.add(String.valueOf(uiParam.getValue()));
			}
		}
	}

	// NavCase Params
	Map<String, List<String>> navCaseParams = navCase.getParameters();
	if (navCaseParams != null && !navCaseParams.isEmpty()) {
		for (Map.Entry<String, List<String>> entry : navCaseParams.entrySet()) {
			String key = entry.getKey();

			// UIParams take precedence
			if (!params.containsKey(key)) {
				params.put(key, entry.getValue());
			}
		}
	}

	return params;
}
 
开发者ID:TheCoder4eu,项目名称:BootsFaces-OSP,代码行数:40,代码来源:NavLinkRenderer.java


示例14: NavigationCaseMapWrapper

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * Constructor for wrapping the given navigation-cases
 *
 * @param navigationCases current navigation-cases
 * @param wrapped wrapped navigation-handler
 */
public NavigationCaseMapWrapper(Map<String, Set<NavigationCase>> navigationCases, NavigationHandler wrapped)
{
    this.wrappedNavigationCaseMap = navigationCases;
    this.wrapped = wrapped;
    this.viewConfigBasedNavigationCaseCache = createViewConfigBasedNavigationCases(false);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:13,代码来源:NavigationCaseMapWrapper.java


示例15: get

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * XML configuration overrules {@link org.apache.deltaspike.core.api.config.view.ViewConfig}s
 */
@Override
public Set<NavigationCase> get(Object key)
{
    Set<NavigationCase> result = this.wrappedNavigationCaseMap.get(key);

    if (result == null)
    {
        return createViewConfigBasedNavigationCases(true).get(key);
    }
    return result;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:15,代码来源:NavigationCaseMapWrapper.java


示例16: values

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * @return a combination of navigation-cases configured via XML and
 *         {@link org.apache.deltaspike.core.api.config.view.ViewConfig}s
 */
@Override
public Collection<Set<NavigationCase>> values()
{
    Collection<Set<NavigationCase>> result = new HashSet<Set<NavigationCase>>();

    result.addAll(this.wrappedNavigationCaseMap.values());
    result.addAll(createViewConfigBasedNavigationCases(true).values());
    return result;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:14,代码来源:NavigationCaseMapWrapper.java


示例17: entrySet

import javax.faces.application.NavigationCase; //导入依赖的package包/类
/**
 * @return a combination of navigation-cases configured via XML and
 *         {@link org.apache.deltaspike.core.api.config.view.ViewConfig}s
 */
@Override
public Set<Entry<String, Set<NavigationCase>>> entrySet()
{
    Set<Entry<String, Set<NavigationCase>>> result = new HashSet<Entry<String, Set<NavigationCase>>>();

    result.addAll(this.wrappedNavigationCaseMap.entrySet());
    result.addAll(createViewConfigBasedNavigationCases(true).entrySet());
    return result;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:14,代码来源:NavigationCaseMapWrapper.java


示例18: DelegatingSet

import javax.faces.application.NavigationCase; //导入依赖的package包/类
private DelegatingSet(Collection<? extends NavigationCase> c,
                      ConfigurableNavigationHandler wrapped,
                      String navigationCaseKey)
{
    super(c);
    this.wrapped = wrapped;
    this.navigationCaseKey = navigationCaseKey;
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:9,代码来源:NavigationCaseMapWrapper.java


示例19: add

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public boolean add(NavigationCase navigationCase)
{
    Set<NavigationCase> navigationCases = this.wrapped.getNavigationCases().get(this.navigationCaseKey);

    if (navigationCases == null)
    {
        navigationCases = new HashSet<NavigationCase>();
        this.wrapped.getNavigationCases().put(this.navigationCaseKey, navigationCases);
    }

    return navigationCases.add(navigationCase);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:14,代码来源:NavigationCaseMapWrapper.java


示例20: handleNavigation

import javax.faces.application.NavigationCase; //导入依赖的package包/类
@Override
public void handleNavigation(
  FacesContext context,
  String       fromAction,
  String       outcome)
{
  if (_disableNavigationHandler(context))
  {
    _delegate.handleNavigation(context, fromAction, outcome);
    return;
  }
 
  RequestContext afc = RequestContext.getCurrentInstance();
  
  // We are interested for "dialog:" prefixed outcomes 
  if ((outcome != null) && (outcome.startsWith(afc.getDialogService().getDialogNavigationPrefix())))
  {
    // Handle "dialog:" URLs
    
    // First we try find a classic navigation case from faces-config.xml
    NavigationCase navigationCase = getNavigationCase(context, fromAction, outcome);
    
    // Then if there is no rule (but we are in dialog here) try interpret 
    // outcome as view id - JSF 2.0 Implicit Navigation.
    if (navigationCase == null)
    {
      navigationCase = getNavigationCase(context, fromAction, 
          outcome.substring(afc.getDialogService().getDialogNavigationPrefix().length()));
    } 
    
    UIViewRoot newRoot = null;
    UIViewRoot oldRoot = context.getViewRoot();
    
    if (navigationCase == null)
    {
      // Execute the old (pre-ConfigurableNavigation) code in case the navigation case
      // could not be determined
      
      // ViewMap is cleared during navigation, so save it here (we will be undoing the navigation
      // by restoring the old view root below)
      Map<String,Object> viewMap = oldRoot.getViewMap(false);
      Map<String,Object> cloneMap = (viewMap == null) ? null : new HashMap<String, Object>(viewMap);
      
      _delegate.handleNavigation(context, fromAction, outcome);
      
      newRoot = context.getViewRoot();
      
      if (newRoot != oldRoot)
      {
        // Navigate back to the original root
        context.setViewRoot(oldRoot);
        
        // Restore the old ViewMap because it gets cleared during setViewRoot()
        if (cloneMap != null)
        {
          oldRoot.getViewMap().putAll(cloneMap);
        }
      }
    }
    else
    {
      newRoot = context.getApplication().getViewHandler().createView(context, navigationCase.getToViewId(context));
    }
   
    if (newRoot != oldRoot)
    {
      // Give ourselves a new page flow scope
      afc.getPageFlowScopeProvider().pushPageFlowScope(context, true);
      // And ask the component to launch a dialog
      afc.getDialogService().queueLaunchEvent(newRoot);
    }
  }
  else
  {
     // not a dialog, call the wrapped NavigationHandler
    _delegate.handleNavigation(context, fromAction, outcome);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:79,代码来源:NavigationHandlerImpl.java



注:本文中的javax.faces.application.NavigationCase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IAxis类代码示例发布时间:2022-05-23
下一篇:
Java RepositoryLocalServiceUtil类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap