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


Java UIComponent.setParent方法代碼示例

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


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

示例1: add

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public void add(int index, UIComponent element)
{
  if (element == null)
    throw new NullPointerException();

  if ((index < 0) || (index > size()))
    throw new IndexOutOfBoundsException(_LOG.getMessage(
      "INDEX_SIZE", new Object[]{index, size()}));

  UIComponent oldParent = element.getParent();
  if (oldParent != null)
  {
    int adjustedIndex = __removeFromParent(element, index);
    // Only adjust the index when the child is re-added to the same parent
    if (oldParent == _parent)
    {
      index = adjustedIndex; 
    }
  }
  
  // do not change the order of these calls, see TRINIDAD-1674 for more info
  super.add(index, element);
  element.setParent(_parent);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:26,代碼來源:ChildArrayList.java

示例2: remove

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public boolean remove(Object element)
{
  if (element == null)
    throw new NullPointerException();
  
  if (!(element instanceof UIComponent))
    return false;

  if (super.remove(element))
  {
    UIComponent child = (UIComponent) element;
    child.setParent(null);
    return true;
  }

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

示例3: set

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public UIComponent set(int index, UIComponent element)
{
  if (element == null)
    throw new NullPointerException();
  
  if ((index < 0) || (index >= size()))
    throw new IndexOutOfBoundsException();

  UIComponent child = element;
  UIComponent previous = get(index);

  previous.setParent(null);
  
  child.setParent(_parent);
  super.set(index, element);
  
  return previous;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:20,代碼來源:ChildArrayList.java

示例4: put

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public UIComponent put(String key, UIComponent value)
{
  if ((key == null) || (value == null))
  {
    throw new NullPointerException();
  }

  UIComponent previous = super.get(key);
  if (previous != null)
  {
    previous.setParent(null);
  }
  
  if (value.getParent() != null)
  {
    ChildArrayList.__removeFromParent(value, -1);
  }
  
  // calling setParent triggers an addEvent, which might have listeners, 
  // so first put the component in the map, then set the parent
  UIComponent comp = super.put(key, value);
  value.setParent(_parent);
  return comp;
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:26,代碼來源:FacetHashMap.java

示例5: clear

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public void clear()
{
  for(UIComponent value : values())
  {
    value.setParent(null);
  }

  super.clear();
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:11,代碼來源:FacetHashMap.java

示例6: remove

import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public UIComponent remove(Object key)
{
  UIComponent previous = super.remove(key);
  if (previous != null)
  {
    previous.setParent(null);
  }
  
  return (previous);
}
 
開發者ID:apache,項目名稱:myfaces-trinidad,代碼行數:12,代碼來源:FacetHashMap.java


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