private boolean sortable = false;
- private String headerText = "";
+ private String headerCaption = "";
private double minimumWidthPx = GridColumnState.DEFAULT_MIN_WIDTH;
private double maximumWidthPx = GridColumnState.DEFAULT_MAX_WIDTH;
/**
* Constructs a new column with a simple TextRenderer.
*
- * @param headerText
- * The header text for this column
+ * @param caption
+ * The header caption for this column
*
* @throws IllegalArgumentException
- * if given header text is null
+ * if given header caption is null
*/
- public Column(String headerText) throws IllegalArgumentException {
+ public Column(String caption) throws IllegalArgumentException {
this();
- setHeaderText(headerText);
+ setHeaderCaption(caption);
}
/**
*
* @param renderer
* The renderer to use for rendering the cells
- * @param headerText
- * The header text for this column
+ * @param caption
+ * The header caption for this column
*
* @throws IllegalArgumentException
- * if given Renderer or header text is null
+ * if given Renderer or header caption is null
*/
- public Column(String headerText, Renderer<? super C> renderer)
+ public Column(String caption, Renderer<? super C> renderer)
throws IllegalArgumentException {
this(renderer);
- setHeaderText(headerText);
+ setHeaderCaption(caption);
}
/**
}
/**
- * Sets a header text for this column.
+ * Sets a header caption for this column.
*
- * @param headerText
- * The header text for this column
+ * @param caption
+ * The header caption for this column
* @return the column itself
*
* @throws IllegalArgumentException
- * if given header text is null
+ * if given caption text is null
*/
- public Column<C, T> setHeaderText(String headerText) {
- if (headerText == null) {
- throw new IllegalArgumentException(
- "Header text cannot be null.");
+ public Column<C, T> setHeaderCaption(String caption) {
+ if (caption == null) {
+ throw new IllegalArgumentException("Caption cannot be null.");
}
- if (!this.headerText.equals(headerText)) {
- this.headerText = headerText;
+ if (!this.headerCaption.equals(caption)) {
+ this.headerCaption = caption;
if (grid != null) {
updateHeader();
}
private void updateHeader() {
HeaderRow row = grid.getHeader().getDefaultRow();
if (row != null) {
- row.getCell(this).setText(headerText);
+ row.getCell(this).setText(headerCaption);
}
}
public String toString() {
String details = "";
- if (headerText != null && !headerText.isEmpty()) {
- details += "header:\"" + headerText + "\" ";
+ if (headerCaption != null && !headerCaption.isEmpty()) {
+ details += "header:\"" + headerCaption + "\" ";
} else {
details += "header:empty ";
}
/**
* Returns the current default row of the header section. The default row is
* a special header row providing a user interface for sorting columns.
- * Setting a header text for column updates cells in the default header.
+ * Setting a header caption for column updates cells in the default header.
*
* @return the default row or null if no default row set
*/
};
column.setWidth(50 + c * 25);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
grid.addColumn(column);
}
}
};
grid.addColumn(column);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
}
// Some date
}
};
grid.addColumn(column);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
}
// Row number as a HTML string
}
};
grid.addColumn(column);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
}
// Random integer value
}
};
grid.addColumn(column);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
}
// Random integer value between 0 and 5
}
};
grid.addColumn(column);
- column.setHeaderText("Header (0," + c + ")");
+ column.setHeaderCaption("Header (0," + c + ")");
}
HeaderRow row = grid.getDefaultHeaderRow();
addMenuCommand("Text Header", new ScheduledCommand() {
@Override
public void execute() {
- column.setHeaderText("Text Header");
+ column.setHeaderCaption("Text Header");
}
}, "Component", "Columns", "Column " + i, "Header Type");
addMenuCommand("HTML Header", new ScheduledCommand() {