当前位置: 首页>>代码示例>>Java>>正文


Java UIViewRoot.setViewId方法代码示例

本文整理汇总了Java中javax.faces.component.UIViewRoot.setViewId方法的典型用法代码示例。如果您正苦于以下问题:Java UIViewRoot.setViewId方法的具体用法?Java UIViewRoot.setViewId怎么用?Java UIViewRoot.setViewId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.faces.component.UIViewRoot的用法示例。


在下文中一共展示了UIViewRoot.setViewId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateSubscriptionId_ShowExternalConfiguratorIsFalse

import javax.faces.component.UIViewRoot; //导入方法依赖的package包/类
@Test
public void validateSubscriptionId_ShowExternalConfiguratorIsFalse()
        throws Exception {
    // given

    model.setShowExternalConfigurator(false);

    UIViewRoot viewRoot = mock(UIViewRoot.class);
    viewRoot.setViewId(SUBSCRIPTIONADD_VIEWID);

    FacesContext context = mock(FacesContext.class);
    context.setViewRoot(viewRoot);

    // when
    UIComponent toValidate = mock(UIComponent.class);
    doReturn("").when(toValidate).getClientId();
    bean.validateSubscriptionId(context, toValidate,
            new String());

    // then
    assertEquals(Boolean.FALSE,
            Boolean.valueOf(model.isShowExternalConfigurator()));
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:24,代码来源:SubscriptionWizardConversationTest.java

示例2: _defaultCreateView

import javax.faces.component.UIViewRoot; //导入方法依赖的package包/类
private UIViewRoot _defaultCreateView(FacesContext context, String viewId)
{
  UIViewRoot result = (UIViewRoot) context.getApplication()
                          .createComponent(UIViewRoot.COMPONENT_TYPE);
  
  Locale locale = null;
  String renderKitId = null;
  
  // use the locale from the previous view if is was one which will be
  // the case if this is called from NavigationHandler. There wouldn't be
  // one for the initial case.
  if (context.getViewRoot() != null) 
  {
    locale = context.getViewRoot().getLocale();
    renderKitId = context.getViewRoot().getRenderKitId();
  }
  
  if (locale == null) 
  {
    locale = context.getApplication().getViewHandler().calculateLocale(context);
  }
  
  if (renderKitId == null) 
  {
    renderKitId = context.getApplication().getViewHandler().calculateRenderKitId(context);
  }
  
  result.setLocale(locale);
  result.setRenderKitId(renderKitId);
  result.setViewId(viewId);

  return result;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:34,代码来源:InternalViewHandlingStrategy.java

示例3: createUIViewRoot

import javax.faces.component.UIViewRoot; //导入方法依赖的package包/类
static public UIViewRoot createUIViewRoot(MFacesContext context)
{
  UIViewRoot root = new UIViewRoot();
  root.setRenderKitId("org.apache.myfaces.trinidad.core");
  root.setViewId("/test-view-id.jspx");
  root.setLocale(context.getLocale());
  return root;
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:RenderKitBootstrap.java

示例4: testInternalView

import javax.faces.component.UIViewRoot; //导入方法依赖的package包/类
public void testInternalView() throws Throwable
{
  ViewDeclarationLanguageFactoryImpl vdlf = 
      new ViewDeclarationLanguageFactoryImpl(new NullViewDeclarationLanguageFactory());
  RenderKitBootstrap.setFactories(null);
  try
  {
    UIViewRoot viewRoot = new UIViewRoot();
    String viewId = "/testURL";
    viewRoot.setViewId(viewId);
    viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
    facesContext.setViewRoot(viewRoot);
    vdlf.getViewDeclarationLanguage(viewId).renderView(facesContext, viewRoot);
    assertEquals("render", __internalViewCalled);

    vdlf.getViewDeclarationLanguage(viewId).restoreView(facesContext, viewId);
    assertEquals("restore", __internalViewCalled);

    vdlf.getViewDeclarationLanguage(viewId).createView(facesContext, viewId);
    assertEquals("create", __internalViewCalled);
  }
  finally 
  {
    __internalViewCalled = null;
    RenderKitBootstrap.clearFactories();
    facesContext.release();
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:ViewDeclarationLanguageFactoryImplTest.java


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