本文整理了Java中com.vaadin.v7.ui.Table.getVisibleColumns()
方法的一些代码示例,展示了Table.getVisibleColumns()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getVisibleColumns()
方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:getVisibleColumns
[英]Gets the array of visible column id:s, including generated columns.
The columns are show in the order of their appearance in this array.
[中]获取可见列id的数组,包括生成的列。
列在此数组中按其出现的顺序显示。
代码示例来源:origin: com.haulmont.cuba/cuba-web
@Override
public List<Table.Column> getNotCollapsedColumns() {
Object[] componentVisibleColumns = component.getVisibleColumns();
if (componentVisibleColumns == null)
return Collections.emptyList();
List<Table.Column> visibleColumns = new ArrayList<>(componentVisibleColumns.length);
for (Object key : componentVisibleColumns) {
if (!component.isColumnCollapsed(key)) {
Column column = columns.get(key);
if (column != null) {
visibleColumns.add(column);
}
}
}
return visibleColumns;
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
if (settingsColumnList.size() != component.getVisibleColumns().length) {
return true;
Object[] visibleColumns = component.getVisibleColumns();
for (int i = 0; i < visibleColumns.length; i++) {
Object columnId = visibleColumns[i];
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
private void writeFooter(Element table) {
Object[] columns = getVisibleColumns();
if (columns.length == 0 || columnFooters.isEmpty()) {
return;
}
Element footer = table.appendElement("tfoot").appendElement("tr");
for (Object id : columns) {
footer.appendElement("td").text(getColumnFooter(id));
}
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
@Override
protected void writeItems(Element design, DesignContext context) {
if (getVisibleColumns().length == 0) {
return;
}
Element tbody = design.child(0).appendElement("tbody");
super.writeItems(tbody, context);
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
@Override
protected Element writeItem(Element tbody, Object itemId,
DesignContext context) {
Element tr = tbody.appendElement("tr");
tr.attr("item-id", String.valueOf(itemId));
Item item = getItem(itemId);
for (Object id : getVisibleColumns()) {
Element td = tr.appendElement("td");
Object value = item.getItemProperty(id).getValue();
td.html(value != null ? value.toString() : "");
}
return tr;
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
/**
* Saves common table column settings (width, visible, id).
*
* @param columnsElem setting element for the columns
*/
protected void saveCommonTableColumnSettings(Element columnsElem) {
Object[] visibleColumns = component.getVisibleColumns();
for (Object column : visibleColumns) {
Element colElem = columnsElem.addElement("columns");
colElem.addAttribute("id", column.toString());
int width = component.getColumnWidth(column);
if (width > -1)
colElem.addAttribute("width", String.valueOf(width));
boolean visible = !component.isColumnCollapsed(column);
colElem.addAttribute("visible", Boolean.toString(visible));
}
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
new Object[] { firstIx, (firstIx + count - 1) });
Object[] colids = getVisibleColumns();
if (pageBuffer != null && pageBuffer[CELL_ITEMID].length > 0) {
int bufSize = pageBuffer[CELL_ITEMID].length;
代码示例来源:origin: com.haulmont.cuba/cuba-web
protected void applyColumnSettings(Element element) {
Element columnsElem = element.element("columns");
Object[] oldColumns = component.getVisibleColumns();
List<Object> newColumns = new ArrayList<>();
代码示例来源:origin: com.haulmont.cuba/cuba-web
for (Object column : component.getVisibleColumns()) {
modelIds.add(String.valueOf(column));
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
private void writeHeader(Element table, Table def, DesignContext context) {
Object[] columns = getVisibleColumns();
if (columns.length == 0
|| (columnIcons.isEmpty() && columnHeaders.isEmpty())) {
return;
}
Element header = table.appendElement("thead").appendElement("tr");
for (Object id : columns) {
Element th = header.appendElement("th");
th.html(getColumnHeader(id));
DesignAttributeHandler.writeAttribute("icon", th.attributes(),
getColumnIcon(id), def.getColumnIcon(null), Resource.class,
context);
}
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
new Object[] { firstIndex, (firstIndex + rows - 1) });
final Object[] colids = getVisibleColumns();
final int cols = colids.length;
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
private void writeColumns(Element table, Table def, DesignContext context) {
Object[] columns = getVisibleColumns();
if (columns.length == 0) {
return;
}
Element colgroup = table.appendElement("colgroup");
for (Object id : columns) {
Element col = colgroup.appendElement("col");
col.attr("property-id", id.toString());
if (getColumnAlignment(id) == Align.CENTER) {
col.attr("center", true);
} else if (getColumnAlignment(id) == Align.RIGHT) {
col.attr("right", true);
}
DesignAttributeHandler.writeAttribute("width", col.attributes(),
getColumnWidth(id), def.getColumnWidth(null), int.class,
context);
DesignAttributeHandler.writeAttribute("expand", col.attributes(),
getColumnExpandRatio(id), def.getColumnExpandRatio(null),
float.class, context);
DesignAttributeHandler.writeAttribute("collapsible",
col.attributes(), isColumnCollapsible(id),
def.isColumnCollapsible(null), boolean.class, context);
DesignAttributeHandler.writeAttribute("collapsed", col.attributes(),
isColumnCollapsed(id), def.isColumnCollapsed(null),
boolean.class, context);
}
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
@Override
public void writeDesign(Element design, DesignContext context) {
Table def = context.getDefaultInstance(this);
DesignAttributeHandler.writeAttribute("sortable", design.attributes(),
isSortEnabled(), def.isSortEnabled(), boolean.class, context);
Element table = null;
boolean hasColumns = getVisibleColumns().length != 0;
if (hasColumns) {
table = design.appendElement("table");
writeColumns(table, def, context);
writeHeader(table, def, context);
}
super.writeDesign(design, context);
if (hasColumns) {
writeFooter(table);
}
}
代码示例来源:origin: com.haulmont.cuba/cuba-web
Object[] visibleColumns = component.getVisibleColumns();
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility
@Test
public void hideColumnsForChooseDialog() {
// GIVEN
ConfiguredWorkbenchDefinition workbenchDefinition = new ConfiguredWorkbenchDefinition();
workbenchDefinition.setDialogWorkbench(true);
final TreePresenterDefinition treePresenterDefinition = new TreePresenterDefinition();
final PropertyColumnDefinition c1 = new PropertyColumnDefinition();
c1.setName("c1");
c1.setPropertyName("p1");
c1.setDisplayInChooseDialog(true);
final PropertyColumnDefinition c2 = new PropertyColumnDefinition();
c2.setName("c2");
c2.setPropertyName("p2");
c2.setDisplayInChooseDialog(false);
treePresenterDefinition.addColumn(c1);
treePresenterDefinition.addColumn(c2);
workbenchDefinition.addContentView(treePresenterDefinition);
treePresenterDefinition.setViewType("tree");
treePresenterDefinition.setActive(true);
workbenchDefinition.getContentViews().add(treePresenterDefinition);
// WHEN
final View view = presenter.start(workbenchDefinition, mock(ImageProviderDefinition.class), mock(EventBus.class));
presenter.onViewTypeChanged("tree");
// THEN
Table table = fetchVaadinTable(view.asVaadinComponent());
assertTrue(Arrays.asList(table.getVisibleColumns()).contains("p1"));
assertFalse(Arrays.asList(table.getVisibleColumns()).contains("p2"));
}
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
target.addAttribute("cols", getVisibleColumns().length);
target.addAttribute("rows", rows);
内容来源于网络,如有侵权,请联系作者删除!