本文整理匯總了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);
}
示例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;
}
示例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;
}
示例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;
}
示例5: clear
import javax.faces.component.UIComponent; //導入方法依賴的package包/類
@Override
public void clear()
{
for(UIComponent value : values())
{
value.setParent(null);
}
super.clear();
}
示例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);
}