本文整理汇总了Java中com.ibm.xsp.util.TypedUtil.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java TypedUtil.getChildren方法的具体用法?Java TypedUtil.getChildren怎么用?Java TypedUtil.getChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.xsp.util.TypedUtil
的用法示例。
在下文中一共展示了TypedUtil.getChildren方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExtraFacet
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public UIComponent getExtraFacet(AbstractDataView dataView, int index){
// the "extra" facets are row facets [see AbstractDataView.getRowFacetNames()]
List<UIComponent> children = TypedUtil.getChildren(dataView);
if( children.isEmpty() ){
// Note, children will only be empty in JUnit tests
// where UIDataView.buildContents is not called.
return null;
}
UIComponent row = children.get(0);
if(index==0) {
UIComponent c = row.getFacet(UIDataView.FACET_EXTRA_N);
if(c!=null) {
return c;
}
}
return row.getFacet(UIDataView.FACET_EXTRA_N+index);
}
示例2: removeChildren
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public static void removeChildren(UIComponent component) {
_logger.finer("start removeChildren");
try {
List<UIComponent> children = TypedUtil.getChildren(component);
if (children.size() > 0) {
_logger.finer("removChildren " + component.getId() + " has " + component.getChildCount() + " children");
int counter = 0;
for (UIComponent child : children) {
counter++;
_logger.finer("processing child #" + counter + " of " + component.getId());
_logger.finer(child.getId() + " has " + child.getChildCount() + " children, calling removeChildren");
removeChildren(child);
}
_logger.finer("out of loop for " + component.getId() + " processed " + counter + " components");
removeComponent(component);
} else {
_logger.finer("removing childless component " + component.getId() + " whose parent is "
+ component.getParent().getId());
component.setRendered(false);
removeComponent(component);
}
_logger.finer("finish removeChildren");
} catch (Exception e) {
_logger.log(Level.WARNING, "Unhandled Exception", e);
}
}
示例3: writeOneColumnRows
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
@Override
protected void writeOneColumnRows(FacesContext context, ResponseWriter w, FormLayout c, UIComponent parent, ComputedFormData formData) throws IOException {
List<UIComponent> children = TypedUtil.getChildren(parent);
for(UIComponent child: children) {
if(!child.isRendered()) {
continue;
}
if(child instanceof UIFormLayoutRow) {
newLine(w);
writeFormRow(context, w, c, formData, (UIFormLayoutRow)child);
} else {
if( !(child instanceof FormLayout) ){
writeChildRows(context, w, c, child, formData);
}// do not recurse through FormLayout descendants
}
}
}
示例4: delayedRemoveChildren
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
private void delayedRemoveChildren() {
if( this.getChildCount() > 0 ){
List<UIComponent> kids = TypedUtil.getChildren(this);
// give the child an opportunity to remove itself from the children list.
// note getChildCount will be changing.
for (int i = 0; i < this.getChildCount(); i++) {
UIComponent child = kids.get(i);
if(child instanceof UIDojoTabPane){
UIDojoTabPane pane = (UIDojoTabPane) child;
if( pane.isDelayedRemoveTab() ){
pane.delayedRemove();
if( (i < this.getChildCount()) && pane != kids.get(i) ){
i--;
}
}
}// else probably xp:eventHandler
}
}
}
示例5: removeChildren
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public static void removeChildren(final UIComponent component) {
_logger.finer("start removeChildren");
try {
List<UIComponent> children = TypedUtil.getChildren(component);
if (children.size() > 0) {
_logger.finer("removChildren " + component.getId() + " has " + component.getChildCount() + " children");
int counter = 0;
for (UIComponent child : children) {
counter++;
_logger.finer("processing child #" + counter + " of " + component.getId());
_logger.finer(child.getId() + " has " + child.getChildCount() + " children, calling removeChildren");
removeChildren(child);
}
_logger.finer("out of loop for " + component.getId() + " processed " + counter + " components");
removeComponent(component);
} else {
_logger.finer("removing childless component " + component.getId() + " whose parent is " + component.getParent().getId());
component.setRendered(false);
removeComponent(component);
}
_logger.finer("finish removeChildren");
} catch (Exception e) {
_logger.log(Level.WARNING, "Unhandled Exception", e);
}
}
示例6: initViewDefinition
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
protected void initViewDefinition(FacesContext context, AbstractDataView dataView, ViewDefinition viewDef) {
List<UIComponent> children = TypedUtil.getChildren(dataView);
viewDef.dataView = dataView;
viewDef.dataModel = dataView.getDataModel();
viewDef.showItemsFlat = dataView.isShowItemsFlat();
viewDef.detailsOnClient = dataView.isDetailsOnClient() || (Boolean)getProperty(PROP_SHOWHIDEONCLIENT);
viewDef.collapsibleDetails = dataView.isCollapsibleDetail();
viewDef.expandedDetailDefault = dataView.isExpandedDetail();
if(viewDef.collapsibleDetails) {
viewDef.showHideDetailFunctionName = ExtLibUtil.encodeJSFunctionName(dataView.getClientId(context));
}
viewDef.summaryColumn = dataView.getSummaryColumn();
if(!children.isEmpty()) {
UIComponent row = children.get(0);
viewDef.summaryFacet = row.getFacet(AbstractDataView.FACET_SUMMARY); // row facet
viewDef.detailFacet = row.getFacet(AbstractDataView.FACET_DETAIL);// row facet
}
viewDef.hasSummary = viewDef.summaryColumn!=null || viewDef.summaryFacet!=null;
viewDef.hasDetail = viewDef.detailFacet!=null;
viewDef.nColumns = (viewDef.hasCheckBoxColumn?1:0) // CheckBox
+ 1 // Data - always
+ (viewDef.collapsibleDetails?1:0); // Collapsible details
viewDef.viewRowRefresh = dataView.isRowRefresh(context);
viewDef.rows = dataView.getRows();
}
示例7: findTypeAheadChild
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
private XspTypeAhead findTypeAheadChild(UIComponent component) {
if(component.getChildCount()>0) {
for (UIComponent child : TypedUtil.getChildren(component)) {
if( child instanceof XspTypeAhead ){
return (XspTypeAhead) child;
}
}
}
return null;
}
示例8: isEmptyChildren
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
protected boolean isEmptyChildren(UIComponent c) {
if(c.getChildCount()>0) {
// We should check the children one by one...
for(UIComponent child: TypedUtil.getChildren(c)) {
if(!isEmptyComponent(child)) {
return false;
}
}
}
// No children, so the list is empty
return true;
}
示例9: moveToLast
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public static void moveToLast(UIComponent component) {
List<UIComponent> siblings = TypedUtil.getChildren(component.getParent());
if (!siblings.isEmpty()) {
int movedCompIndex = siblings.indexOf(component);
UIComponent movedComp = siblings.remove(movedCompIndex);
siblings.add(movedComp);
}
}
示例10: findEdit
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
private UIInput findEdit(UIComponent parent) {
for(UIComponent c: TypedUtil.getChildren(parent)) {
if(c instanceof UIInput) {
return (UIInput)c;
}
if(c.getChildCount()>0) {
UIInput e = findEdit(c);
if(e!=null) {
return e;
}
}
}
return null;
}
示例11: moveToLocation
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public static void moveToLocation(UIComponent component, Integer location) {
List<UIComponent> siblings = TypedUtil.getChildren(component.getParent());
if (!siblings.isEmpty()) {
int movedCompIndex = siblings.indexOf(component);
UIComponent movedComp = siblings.remove(movedCompIndex);
siblings.add(location, movedComp);
}
}
示例12: getPopupContent
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public UIMobilePageContent getPopupContent() {
List<UIComponent> children = TypedUtil.getChildren(this);
if(!children.isEmpty()) {
return (UIMobilePageContent)children.get(0);
}
return null;
}
示例13: deleteChildEventHandlers
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
private void deleteChildEventHandlers(FacesContext context) {
List<UIComponent> children = TypedUtil.getChildren(this);
for (int i = 0; i < children.size(); i++) {
UIComponent child = children.get(i);
if( child instanceof UIEventHandler ){
children.remove(i);
i--;
}
}
}
示例14: moveToAfter
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
public static void moveToAfter(UIComponent component, UIComponent afterComp) {
List<UIComponent> afterCompSiblings = TypedUtil.getChildren(afterComp.getParent());
List<UIComponent> compSiblings = TypedUtil.getChildren(component.getParent());
if (!afterCompSiblings.isEmpty()) {
int movedCompIndex = compSiblings.indexOf(component);
UIComponent movedComp = compSiblings.remove(movedCompIndex);
int afterCompIndex = afterCompSiblings.indexOf(afterComp) + 1;
afterCompSiblings.add(afterCompIndex, movedComp);
}
}
示例15: isEmptyChildren
import com.ibm.xsp.util.TypedUtil; //导入方法依赖的package包/类
protected boolean isEmptyChildren(UIComponent c) {
if (c.getChildCount() > 0) {
// We should check the children one by one...
for (UIComponent child : TypedUtil.getChildren(c)) {
if (!isEmptyComponent(child)) {
return false;
}
}
}
// No children, so the list is empty
return true;
}