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


Java UIComponent.getClass方法代碼示例

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


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

示例1: isFlattenableCoreComponent

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * Determine if we can flatten a core JSF component.
 * @param component The component
 * @return true if the component is a core JSF component and we can
 * flatten it successfully.
 */
private static boolean isFlattenableCoreComponent(UIComponent component)
{
  // Optimize the cases of UINamingContainer (<f:subview>) and UIPanel -
  // we will treat these components as FlattenedComponents because they do not render
  // any DOM.
  // Also note that as of JSF 2.0, UINamingContainer components are built
  // by f:subview, as well as composite components.
  Class<? extends UIComponent> componentClass = component.getClass();

  if (UINamingContainer.class == componentClass)
  {
    // Check to see if this component was created as a composite
    // component, which we cannot flatten
    return component.getFacet(UIComponent.COMPOSITE_FACET_NAME) == null;
  }

  // Note that JSF 2.0 creates UIPanel wrappers around multiple components
  // inside of <f:facet>
  return UIPanel.class == componentClass;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:27,代碼來源:UIXComponent.java

示例2: ChangeComponentProxy

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * Constructs an ChangeComponentProxy with the specified UIComponent instance.
 * @throws IllegalArgumentException if specified uiComponent were to be null.
 */
public ChangeComponentProxy(
  FacesContext facesContext,
  UIComponent uiComponent)
{
  if (uiComponent == null)
    throw new IllegalArgumentException(_LOG.getMessage(
      "CANNOT_CONSTRUCT_CHANGECOMPONENTPROXY_WITH_NULL_UICOMPONENT"));
  _class = uiComponent.getClass();
  _className = _class.getName();
  _state = uiComponent.saveState(facesContext);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:16,代碼來源:ChangeComponentProxy.java

示例3: addComponentChange

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void addComponentChange(
  FacesContext facesContext,
  UIComponent uiComponent,
  ComponentChange change)
{
  // if our component is a stamped component by UIXIterator, we 
  // don't want to persist the changes 
  UIComponent parent = uiComponent.getParent();
  UIComponent root = facesContext.getViewRoot();
  while (parent != null && parent != root)
  {
    if (parent.getClass() == UIXIterator.class) 
    {
      _LOG.info("DONT_PERSIST_STAMPED_COMPONENT_INSIDE_ITERATOR");      
      return;
    }
    parent = parent.getParent();      
  }
      
  if (facesContext == null || uiComponent == null || change == null)
    throw new IllegalArgumentException(_LOG.getMessage(
      "CANNOT_ADD_CHANGE_WITH_FACECONTEXT_OR_UICOMPONENT_OR_NULL"));

  // add the change to the component
  addComponentChangeImpl(facesContext, uiComponent, change);

  // add a corresponding DocumentChange if possible
  _addEquivalentDocumentChange(facesContext, uiComponent, change);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:34,代碼來源:BaseChangeManager.java

示例4: ComponentSystemEventListenerWrapper

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
ComponentSystemEventListenerWrapper(ComponentSystemEventListener listener, UIComponent component)
{
  _delegate = listener;
  _componentClass = component.getClass();
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:6,代碼來源:UIXComponentBase.java


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