📄 rowcollectionitem.java
字号:
/* RowCollectionItem.java
{{IS_NOTE
Purpose:
Description:
History:
Jul 31, 2007 3:24:34 PM , Created by jumperchen
}}IS_NOTE
Copyright (C) 2007 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
This program is distributed under GPL Version 2.0 in the hope that
it will be useful, but WITHOUT ANY WARRANTY.
}}IS_RIGHT
*/
package org.zkoss.zkplus.databind;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.UiException;
import org.zkoss.zul.Grid;
import org.zkoss.zul.ListModel;
import org.zkoss.zul.Row;
/* package */class RowCollectionItem implements CollectionItem {
public Component getComponentAtIndexByOwner(Component comp, int index) {
if (comp instanceof Grid) {
final Grid grid = (Grid) comp;
return (Component) grid.getRows().getChildren().get(index);
} else {
throw new UiException("Unsupported type for RowCollectionItem: "
+ comp);
}
}
public Component getComponentCollectionOwner(Component comp) {
if (comp instanceof Row) {
final Row row = (Row) comp;
return row.getGrid();
} else {
throw new UiException("Unsupported type for RowCollectionItem: "
+ comp);
}
}
public ListModel getModelByOwner(Component comp) {
if (comp instanceof Grid) {
final Grid grid = (Grid) comp;
return grid.getModel();
} else {
throw new UiException("Unsupported type for RowCollectionItem: "
+ comp);
}
}
public void setupBindingRenderer(Component comp, DataBinder binder) {
if (comp instanceof Row) {
final Row row = (Row) comp;
final Grid grid = row.getGrid();
if (grid.getRowRenderer() == null) {
grid.setRowRenderer(new BindingRowRenderer(row, binder));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -