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


Java Application.getViewHandler方法代碼示例

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


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

示例1: getJSFInfo

import javax.faces.application.Application; //導入方法依賴的package包/類
/**
 * gets JSF information like JSF version and Faces context.
 *
 * @return the JSF info
 */
public static Map<String, Object> getJSFInfo() {
	final LinkedHashMap<String, Object> details = new LinkedHashMap<String, Object>();
	final FacesContext context = FacesContext.getCurrentInstance();
	final Application application = context.getApplication();
	final ViewHandler viewHandler = application.getViewHandler();
	final ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(context, context.getViewRoot().getViewId());
	final LifecycleFactory LifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);

	details.put("JSF-Version", FacesContext.class.getPackage().getImplementationVersion());
	details.put("JSF-Version-Package", FacesContext.class.getPackage().getName());
	details.put("FacesContext", context.getClass());
	details.put("Application", application.getClass());
	details.put("ViewHandler", viewHandler.getClass());
	details.put("ViewDeclarationLanguage", vdl.getClass());
	details.put("LifecycleFactory", LifecycleFactory.getClass());

	return details;
}
 
開發者ID:kiswanij,項目名稱:jk-faces,代碼行數:24,代碼來源:JKJsfUtil.java

示例2: goToRightPage

import javax.faces.application.Application; //導入方法依賴的package包/類
public void goToRightPage() {
    String viewId = this.originalViewId;
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    ViewHandler viewHandler = app.getViewHandler();
    UIViewRoot root = viewHandler.createView(context, viewId);
    context.setViewRoot(root);
    if ("/datacenter/dataCenterSimulationRealTime.xhtml".equals(viewId)) {
        this.dataCenterControllerSimulator.initHostMachineSimulatorList();
    }
    if ("/datacenter/dataCenterVirtualMachinePlacement.xhtml".equals(viewId)) {
        this.dataCenterController.getDataCenterVirtualMachinePlacementSimulator().setDataCenter(dataCenterController.getDataCenter());
    }
    if ("/datacenter/vmPlacementTestRunner.xhtml".equals(viewId)) {
        this.dataCenterController.getPlacementSimulatorTestRunner().setDataCenter(dataCenterController.getDataCenter());            
    }
}
 
開發者ID:disit,項目名稱:iclos,代碼行數:18,代碼來源:Navigator.java

示例3: setId

import javax.faces.application.Application; //導入方法依賴的package包/類
@Override
public void setId(long id)
{
	// discard previous unsaved changes if any
	cancel();

	super.setId(id);
	setEnterValuesPanelExpanded(true);

	FacesContext context = FacesContext.getCurrentInstance();
	Application application = context.getApplication();
	ViewHandler viewHandler = application.getViewHandler();
	UIViewRoot viewRoot = viewHandler.createView(context, context.getViewRoot().getViewId());
	context.setViewRoot(viewRoot);
	context.renderResponse();
}
 
開發者ID:jithub2005,項目名稱:RemInD,代碼行數:17,代碼來源:UserController.java

示例4: beforePhase

import javax.faces.application.Application; //導入方法依賴的package包/類
@Override
    public void beforePhase(final PhaseEvent event) {
        FacesContext context = FacesContext.getCurrentInstance();
        String viewId = context.getViewRoot().getViewId();
        if ("/virtualMachine.xhtml".equals(viewId)
                || "/datacenter/dataCenterSimulationRealTime.xhtml"
                        .equals(viewId)
                || "/datacenter/dataCenterSimulationFaster.xhtml"
                        .equals(viewId)
                || "/analyzeMetrics.xhtml"
                        .equals(viewId)
                || "/datacenter/dataCenterVirtualMachinePlacement.xhtml"
                        .equals(viewId)
//                || "/datacenter/vmPlacementTestRunner.xhtml"
//                        .equals(viewId)
                        ) {
            Application app = context.getApplication();
            DataCenterController dataCenterController = (DataCenterController) app
                    .evaluateExpressionGet(context, "#{dataCenterController}",
                            DataCenterController.class);
            Navigator navigator = (Navigator) app.evaluateExpressionGet(
                    context, "#{navigator}", Navigator.class);
            if (dataCenterController.getDataCenterChoice() == null) {
                navigator.setOriginalViewId(viewId);
                ViewHandler viewHandler = app.getViewHandler();
                UIViewRoot viewRoot = viewHandler.createView(context,
                        "/datacenter/dataCenterChoice.xhtml");
                context.setViewRoot(viewRoot);

            }
        }
    }
 
開發者ID:disit,項目名稱:iclos,代碼行數:33,代碼來源:ForceChooseDataCenterPhaseListener.java

示例5: refresh

import javax.faces.application.Application; //導入方法依賴的package包/類
public void refresh() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot viewRoot = viewHandler.createView(context, context
            .getViewRoot().getViewId());
    context.setViewRoot(viewRoot);
    context.renderResponse(); //Optional
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:10,代碼來源:StudentViewBean.java

示例6: refresh

import javax.faces.application.Application; //導入方法依賴的package包/類
public void refresh() {
    FacesContext context = FacesContext.getCurrentInstance();
    Application application = context.getApplication();
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot viewRoot = viewHandler.createView(context, context
            .getViewRoot().getViewId());
    context.setViewRoot(viewRoot);
}
 
開發者ID:yawlfoundation,項目名稱:yawl,代碼行數:9,代碼來源:ApplicationBean.java

示例7: refresh

import javax.faces.application.Application; //導入方法依賴的package包/類
public void refresh() {
      FacesContext context = FacesContext.getCurrentInstance();
      Application application = context.getApplication();
      ViewHandler viewHandler = application.getViewHandler();
      UIViewRoot viewRoot = viewHandler.createView(context, context
           .getViewRoot().getViewId());
      context.setViewRoot(viewRoot);
    //  context.renderResponse(); //Optional
}
 
開發者ID:yawlfoundation,項目名稱:yawl,代碼行數:10,代碼來源:ApplicationBean.java

示例8: loadEmptyPage

import javax.faces.application.Application; //導入方法依賴的package包/類
public static UIViewRoot loadEmptyPage(AbstractXspTest test, FacesContext context) throws Exception{
    String pageName = "/pages/pregenerated/empty.xsp";
    Application application = lazyApplication(test);
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot root = viewHandler.createView(context, pageName);
    if( null == root ){
        throw new RuntimeException("JUnit test could not load the empty page "+pageName);
    }
    context.setViewRoot(root);
    return root;
}
 
開發者ID:OpenNTF,項目名稱:XPagesExtensionLibrary,代碼行數:12,代碼來源:TestProject.java

示例9: loadView

import javax.faces.application.Application; //導入方法依賴的package包/類
public static UIViewRoot loadView(AbstractXspTest test,
        FacesContext context, String viewId) throws Exception{
    
    String pageName = toPageName(viewId);
    Application application = lazyApplication(test);
    ViewHandler viewHandler = application.getViewHandler();
    UIViewRoot root = viewHandler.createView(context, pageName);
    if( null != root ){
        context.setViewRoot(root);
    }
    return root;
}
 
開發者ID:OpenNTF,項目名稱:XPagesExtensionLibrary,代碼行數:13,代碼來源:TestProject.java

示例10: refresh

import javax.faces.application.Application; //導入方法依賴的package包/類
public void refresh() {
  FacesContext context = FacesContext.getCurrentInstance();
  Application application = context.getApplication();
  ViewHandler viewHandler = application.getViewHandler();
  UIViewRoot viewRoot = viewHandler.createView(context, context
   .getViewRoot().getViewId());
  context.setViewRoot(viewRoot);
  context.renderResponse(); //Optional
}
 
開發者ID:NCIP,項目名稱:national-biomedical-image-archive,代碼行數:10,代碼來源:SecurityCheckFilter.java

示例11: _appendIcon

import javax.faces.application.Application; //導入方法依賴的package包/類
private void _appendIcon(
  FacesContext     context,
  ResponseWriter   rw,
  String           iconUri,
  boolean          isRtl,
  RenderingContext rc
  ) throws IOException
{
  String styleAppender = "";
  rw.startElement("img", null);
  rw.writeAttribute("border", "0", null);
  rw.writeAttribute("align", "absmiddle", null);

  if (isPDA(rc))
  {
    if (isRtl)
    {
      rw.writeAttribute("style", "padding-left: 5px;", null);
    }
    else
    {
      rw.writeAttribute("style", "padding-right: 5px;", null);
    }
  }
  else
  {
    if (isRtl)
    {
      rw.writeAttribute("style", "padding-left: 5px; float: right;", null);
    }
    else
    {
      rw.writeAttribute("style", "padding-right: 5px; float: left;", null);
    }
  }

  Application application = context.getApplication();
  ViewHandler handler = application.getViewHandler();
  String resolvedIconUri = handler.getResourceURL(context, iconUri);
  renderEncodedResourceURI(context, "src", resolvedIconUri);
  rw.endElement("img");
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:43,代碼來源:NavigationPaneRenderer.java


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