當前位置: 首頁>>代碼示例>>Java>>正文


Java UIViewRoot.setRenderKitId方法代碼示例

本文整理匯總了Java中javax.faces.component.UIViewRoot.setRenderKitId方法的典型用法代碼示例。如果您正苦於以下問題:Java UIViewRoot.setRenderKitId方法的具體用法?Java UIViewRoot.setRenderKitId怎麽用?Java UIViewRoot.setRenderKitId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.faces.component.UIViewRoot的用法示例。


在下文中一共展示了UIViewRoot.setRenderKitId方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTestTree

import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
protected UIViewRoot createTestTree(
             UIComponent compToTest, String testName, int count)
  throws IOException
{
  if (_fileWriter != null)
  {
    _fileWriter.write("\nRunning test " + testName + "\n");
    _fileWriter.write("----------------------------------\n");
  }
  UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
  root.setRenderKitId(getRenderKitId());

  CoreDocument doc = new CoreDocument();
  doc.setId("docId");
  root.getChildren().add(doc);
  CoreForm form = new CoreForm();
  form.setId("formId");
  doc.getChildren().add(form);

  PerfComp perfer = new PerfComp(count, testName);
  form.getChildren().add(perfer);
  perfer.getChildren().add(compToTest);

  return root;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:27,代碼來源:RenderKitPerfTestCase.java

示例2: setUp

import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
@Override
protected void setUp() throws IOException
{
  _facesContext = createMockFacesContext(MApplication.sharedInstance(), true);
  _requestContext = createRequestContext();
  _requestContext.setSkinFamily(_skinFamily);
  _requestContext.setAgent(_agent);
  _requestContext.setRightToLeft(_rightToLeft);
  _requestContext.setOutputMode(_outputMode);
  _requestContext.setAccessibilityMode(_accMode);
  _facesContext.setCurrentPhaseId(PhaseId.RENDER_RESPONSE);

  UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
  root.setRenderKitId(getRenderKitId());
  _facesContext.setViewRoot(root);

  ExtendedRenderKitService service =
    _getExtendedRenderKitService(_facesContext);

  if (service != null)
    service.encodeBegin(_facesContext);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:23,代碼來源:RenderKitTestCase.java

示例3: _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

示例4: 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

示例5: 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

示例6: setUp

import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
protected void setUp() throws Exception
{
  RequestContext rc = RequestContext.getCurrentInstance();
  if (rc != null)
  {
    rc.release();
  }
  
  _bootstrap = new RenderKitBootstrap();
  _bootstrap.init();
  
  RenderKitBootstrap.clearFactories();
  RenderKitBootstrap.setFactories(_bootstrap.getFacesConfigInfo());

  _facesContext = new MFacesContext(MApplication.sharedInstance(), true);
  _requestContext = new MRequestContext();
  _requestContext.setSkinFamily("minimal");
  _requestContext.setAgent(RenderKitBootstrap.getGeckoAgent());
  _requestContext.setRightToLeft(false);
  _requestContext.setAccessibilityMode(null);
  _facesContext.getExternalContext().getApplicationMap().put(TrinidadSkinProvider.TRINDIAD_SKIN_PROVIDER_KEY, new TrinidadSkinProvider());
  _facesContext.getExternalContext().getApplicationMap().put(ExternalSkinProvider.EXTERNAL_SKIN_PROVIDER_KEY, new ExternalSkinProvider());
  _facesContext.getExternalContext().getApplicationMap().put(SkinProvider.SKIN_PROVIDER_INSTANCE_KEY, new SkinProviderRegistry());

  UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
  root.setRenderKitId("org.apache.myfaces.trinidad.core");
  root.setLocale(Locale.getDefault());
  _facesContext.setViewRoot(root);
  
  try
  {
    new CoreRenderingContext();
  }
  catch (IllegalStateException ex)
  {
    return;
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:39,代碼來源:XhtmlLafUtilsTest.java

示例7: _initRequestContextAndGenerateCss

import javax.faces.component.UIViewRoot; //導入方法依賴的package包/類
/**
 * This method sets skinFamily into request context and executes
 * encode of a simple page. This results in generation of the css
 * for the skin family specified.
 * This code is similar to what we do in RenderKitTestCase.BaseTest
 * @see org.apache.myfaces.trinidadinternal.renderkit.RenderKitTestCase.BaseTest
 * @param skinFamily
 */
private void _initRequestContextAndGenerateCss(String skinFamily)
{
  try
  {
    _requestContext = new MRequestContext();
    _requestContext.setSkinFamily(skinFamily);
    _requestContext.setRightToLeft(false);
    _requestContext.setAgent(RenderKitBootstrap.getGeckoAgent());

    UIViewRoot root = RenderKitBootstrap.createUIViewRoot(_facesContext);
    root.setRenderKitId("org.apache.myfaces.trinidad.core");
    _facesContext.setViewRoot(root);
    _facesContext.setResponseWriter(new TestResponseWriter(new NullWriter(),
                                                           XhtmlResponseWriter.XHTML_CONTENT_TYPE,
                                                           "UTF-8",
                                                           this,
                                                           null));
    CoreDocument doc = new CoreDocument();
    doc.setId("docId");
    root.getChildren().add(doc);
    CoreForm form = new CoreForm();
    form.setId("formId");
    doc.getChildren().add(form);

    ExtendedRenderKitService service = Service.getService(_facesContext.getRenderKit(),
                                                          ExtendedRenderKitService.class);
    if (service != null)
      service.encodeBegin(_facesContext);

    RenderUtils.encodeRecursive(_facesContext, root);
  }
  catch (Exception e)
  {
    System.out.println("Exception in _initRequestContextAndGenerateCss");
    e.printStackTrace();
  }
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:46,代碼來源:SkinProviderTest.java


注:本文中的javax.faces.component.UIViewRoot.setRenderKitId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。