isHidable(), def.hidable, boolean.class);
DesignAttributeHandler.writeAttribute("hidden", attributes,
isHidden(), def.hidden, boolean.class);
+ DesignAttributeHandler.writeAttribute("hiding-toggle-caption",
+ attributes, getHidingToggleCaption(),
+ SharedUtil.propertyIdToHumanFriendly(getPropertyId()),
+ String.class);
DesignAttributeHandler.writeAttribute("property-id", attributes,
getPropertyId(), null, Object.class);
}
setHidden(DesignAttributeHandler.readAttribute("hidden",
attributes, boolean.class));
}
+ if (design.hasAttr("hiding-toggle-caption")) {
+ setHidingToggleCaption(DesignAttributeHandler.readAttribute(
+ "hiding-toggle-caption", attributes, String.class));
+ }
// Read size info where necessary.
if (design.hasAttr("width")) {
setWidth(DesignAttributeHandler.readAttribute("width",
+ " <col sortable=true width='100' property-id='Column1'>"
+ " <col sortable=false max-width='200' expand='2' property-id='Column2'>"
+ " <col sortable=true editable=false min-width='15' expand='1' property-id='Column3'>"
- + " <col sortable=true hidable=true property-id='Column4'>"
+ + " <col sortable=true hidable=true hiding-toggle-caption='col 4' property-id='Column4'>"
+ " <col sortable=true hidden=true property-id='Column5'>"
+ "</colgroup>" //
+ "<thead />" //
.setExpandRatio(2).setSortable(false);
grid.addColumn("Column3", String.class).setMinimumWidth(15)
.setExpandRatio(1).setEditable(false);
- grid.addColumn("Column4", String.class).setHidable(true);
+ grid.addColumn("Column4", String.class).setHidable(true)
+ .setHidingToggleCaption("col 4");
grid.addColumn("Column5", String.class).setHidden(true);
// Remove the default header
+ " <col sortable=true width='100' property-id='Column1'>"
+ " <col sortable=true max-width='200' expand='2'>" // property-id="property-1"
+ " <col sortable=true min-width='15' expand='1' property-id='Column3'>"
+ + " <col sortable=true hidden=true hidable=true hiding-toggle-caption='col 4'>" // property-id="property-3"
+ "</colgroup>" //
+ "</table></v-grid>";
Grid grid = new Grid();
.setExpandRatio(2);
grid.addColumn("Column3", String.class).setMinimumWidth(15)
.setExpandRatio(1);
+ grid.addColumn("property-3", String.class).setHidable(true)
+ .setHidden(true).setHidingToggleCaption("col 4");
testRead(design, grid);
}
col2.isSortable());
assertEquals(baseError + "Editable", col1.isEditable(),
col2.isEditable());
-
+ assertEquals(baseError + "Hidable", col1.isHidable(),
+ col2.isHidable());
+ assertEquals(baseError + "Hidden", col1.isHidden(), col2.isHidden());
+ assertEquals(baseError + "HidingToggleCaption",
+ col1.getHidingToggleCaption(),
+ col2.getHidingToggleCaption());
}
}
}