本文整理汇总了Java中com.google.gwt.user.cellview.client.Header类的典型用法代码示例。如果您正苦于以下问题:Java Header类的具体用法?Java Header怎么用?Java Header使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Header类属于com.google.gwt.user.cellview.client包,在下文中一共展示了Header类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createColumnTextCell
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
private ColumnMeta createColumnTextCell(final String value,
String dataStoreName) {
Column<String, String> testColumn = new Column<String, String>(new TextCell()) {
@Override
public String getValue(String object) {
return value;
}
};
testColumn.setSortable(true);
testColumn.setDataStoreName(dataStoreName);
final Header<String> header = new TextHeader(value);
ColumnMeta<String> columnMeta = new ColumnMeta(testColumn,
dataStoreName);
columnMeta.setHeader(header);
return columnMeta;
}
示例2: createColumnCheckboxCell
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
private ColumnMeta createColumnCheckboxCell(String dataStoreName) {
CheckboxCell checkboxCell = new CheckboxCell(true,
false);
Column<String, Boolean> checkColumn = new Column<String, Boolean>(checkboxCell) {
@Override
public Boolean getValue(String object) {
return true;
}
};
Header<Boolean> selectPageHeader = new Header<Boolean>(checkboxCell) {
@Override
public Boolean getValue() {
return true;
}
};
checkColumn.setSortable(false);
checkColumn.setDataStoreName(dataStoreName);
ColumnMeta<String> checkColMeta = new ColumnMeta<String>(checkColumn,
"");
checkColMeta.setHeader(selectPageHeader);
return checkColMeta;
}
示例3: constructBooleanColumn
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
protected float constructBooleanColumn(DataGrid<T> table, String title,
final BooleanValueProvider<T> valueProvider,
Comparator<T> comparator, Boolean isSortAscending, float prefWidth) {
Header<SafeHtml> header = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(title));
Column<T, Boolean> column = new Column<T, Boolean>(new UneditableCheckboxCell()) {
@Override
public Boolean getValue(T item) {
return valueProvider.getValue(item);
}
};
column.setFieldUpdater(new FieldUpdater<T,Boolean>() {
@Override
public void update(int index, T object, Boolean value) {
onRowClicked(getObjectId(object));
}
});
table.addColumn(column, header);
table.setColumnWidth(column, prefWidth, Unit.PX);
processColumnSort(table, column, comparator, isSortAscending);
return prefWidth;
}
示例4: constructActions
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
protected float constructActions(DataGrid<T> table, float prefWidth) {
if (enableActions) {
if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));
deleteColumn = constructDeleteColumn("");
table.addColumn(deleteColumn, deleteHeader);
table.setColumnWidth(deleteColumn, ACTION_COLUMN_WIDTH, Unit.PX);
return ACTION_COLUMN_WIDTH;
}
else {
return 0;
}
}
else {
return 0;
}
}
示例5: resetFocusOnCell
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
@Override
protected boolean resetFocusOnCell() {
boolean focused = false;
if (hasFilterHeaders() && filterFocusedCellColumn > -1 && filterFocusedCellRow > -1) {
TableSectionElement thead = getTableHeadElement();
NodeList<TableRowElement> rows = thead.getRows();
if (filterFocusedCellRow < rows.getLength()) {
TableRowElement row = rows.getItem(filterFocusedCellRow);
NodeList<TableCellElement> cells = row.getCells();
if (filterFocusedCellColumn < cells.getLength()) {
TableCellElement cell = cells.getItem(filterFocusedCellColumn);
if (getHeaderBuilder().isHeader(cell)) {
Header<?> header = getHeaderBuilder().getHeader(cell);
Context context = new Context(0, 0, header.getKey());
focused = resetFocusOnFilterCellImpl(context, header, cell);
}
}
}
}
if (!focused) {
focused = super.resetFocusOnCell();
}
return focused;
}
示例6: constructActions
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
@Override
protected float constructActions(DataGrid<FormField> table, float prefWidth) {
if (enableActions) {
if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(Utils.constants.delete()));
deleteColumn = constructDeleteColumn("");
table.addColumn(deleteColumn, deleteHeader);
table.setColumnWidth(deleteColumn, DELETE_COLUMN_WIDTH, Unit.PX);
return DELETE_COLUMN_WIDTH;
}
else {
return 0;
}
}
else {
return 0;
}
}
示例7: constructActions
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
@Override
protected float constructActions(DataGrid<T> table, float prefWidth) {
float result = 0;
if (!embedded
&& (downloadPropsColumn == null || table.getColumnIndex(downloadPropsColumn) == -1)) {
Header<SafeHtml> downloadRecordSchemaHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(Utils.constants.configuration()));
downloadPropsColumn = constructDownloadSchemaColumn("");
table.addColumn(downloadPropsColumn, downloadRecordSchemaHeader);
table.setColumnWidth(downloadPropsColumn, ACTION_COLUMN_WIDTH, Unit.PX);
result += ACTION_COLUMN_WIDTH;
}
result += super.constructActions(table, prefWidth);
return result;
}
示例8: constructActions
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
@Override
protected float constructActions(DataGrid<ConfigurationSchemaDto> table, float prefWidth) {
float result = super.constructActions(table, prefWidth);
if (!embedded && (downloadBaseSchemaColumn == null
|| table.getColumnIndex(downloadBaseSchemaColumn) == -1)) {
Header<SafeHtml> downloadBaseSchemaHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadBaseSchema()));
downloadBaseSchemaColumn = constructDownloadBaseSchemaColumnColumn("");
table.addColumn(downloadBaseSchemaColumn, downloadBaseSchemaHeader);
table.setColumnWidth(downloadBaseSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
result += ACTION_COLUMN_WIDTH;
}
if (!embedded && (downloadOverrideSchemaColumn == null
|| table.getColumnIndex(downloadOverrideSchemaColumn) == -1)) {
Header<SafeHtml> downloadOverrideSchemaHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(Utils.constants.downloadOverrideSchema()));
downloadOverrideSchemaColumn = constructDownloadOverrideSchemaColumnColumn("");
table.addColumn(downloadOverrideSchemaColumn, downloadOverrideSchemaHeader);
table.setColumnWidth(downloadOverrideSchemaColumn, ACTION_COLUMN_WIDTH, Style.Unit.PX);
result += ACTION_COLUMN_WIDTH;
}
return result;
}
示例9: constructActions
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
@Override
protected float constructActions(DataGrid<EndpointProfileDto> table, float prefWidth) {
if (enableActions) {
float result = 0;
if (deleteColumn == null || table.getColumnIndex(deleteColumn) == -1) {
Header<SafeHtml> deleteHeader = new SafeHtmlHeader(
SafeHtmlUtils.fromSafeConstant(
embedded ? Utils.constants.remove() : Utils.constants.delete()));
deleteColumn = constructDeleteColumn("");
table.addColumn(deleteColumn, deleteHeader);
table.setColumnWidth(deleteColumn, 40, Style.Unit.PX);
result += 40;
}
return result;
} else {
return 0;
}
}
示例10: DraggedColumn
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
protected DraggedColumn(Column<T, ?> aColumn, Header<?> aHeader, int aColumnIndex, AbstractCellTable<T> aTable, Element aCellElement, Element aTargetElement) {
super();
column = aColumn;
columnIndex = aColumnIndex;
header = aHeader;
table = aTable;
cellElement = aCellElement;
targetElement = aTargetElement;
}
示例11: moveColumn
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
public void moveColumn(int aFromIndex, int aToIndex) {
Header<?> footer = getColumnFooter(aFromIndex);
Header<?> header = getColumnHeader(aFromIndex);
String width = getColumnWidth(aFromIndex);
Column<T, ?> column = getColumn(aFromIndex);
clearColumnWidth(aFromIndex);
removeColumn(aFromIndex);
addColumn(aToIndex, column, width, header, footer, false);
headerLeft.getWidthPropagator().changed();
}
示例12: getColumnHeader
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
public Header<?> getColumnHeader(int aIndex) {
if (aIndex >= 0 && aIndex < getDataColumnCount()) {
return aIndex >= 0 && aIndex < headerLeft.getColumnCount() ? headerLeft.getHeader(aIndex)
: headerRight.getHeader(aIndex - headerLeft.getColumnCount());
} else
return null;
}
示例13: getColumnFooter
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
public Header<?> getColumnFooter(int aIndex) {
if (aIndex >= 0 && aIndex < getDataColumnCount()) {
return aIndex >= 0 && aIndex < headerLeft.getColumnCount() ? headerLeft.getFooter(aIndex)
: headerRight.getFooter(aIndex - headerLeft.getColumnCount());
} else
return null;
}
示例14: appendExtraStyles
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
/**
* Append the extra style names for the header.
*
* @param header
* the header that may contain extra styles, it can be null
* @param classesBuilder
* the string builder for the TD classes
*/
private <H> void appendExtraStyles(Header<H> header, StringBuilder classesBuilder) {
if (header == null) {
return;
}
String headerStyleNames = header.getHeaderStyleNames();
if (headerStyleNames != null) {
classesBuilder.append(" ");
classesBuilder.append(headerStyleNames);
}
}
示例15: buildHeader
import com.google.gwt.user.cellview.client.Header; //导入依赖的package包/类
/**
* Renders the header of one column, with the given options.
*
* @param out
* the table row to build into
* @param header
* the {@link Header} to render
* @param column
* the column to associate with the header
* @param sortedColumn
* the column that is currently sorted
* @param isSortAscending
* true if the sorted column is in ascending order
* @param isFirst
* true if this the first column
* @param isLast
* true if this the last column
*/
private void buildHeader(TableRowBuilder out, Header<?> header, Column<PasswordCard, ?> column, Column<?, ?> sortedColumn, boolean isSortAscending, boolean isFirst,
boolean isLast) {
// Choose the classes to include with the element.
com.google.gwt.user.cellview.client.AbstractCellTable.Style style = dataGrid.getResources().style();
boolean isSorted = (sortedColumn == column);
StringBuilder classesBuilder = new StringBuilder(style.header());
if (isFirst) {
classesBuilder.append(" " + style.firstColumnHeader());
}
if (isLast) {
classesBuilder.append(" " + style.lastColumnHeader());
}
if (column.isSortable()) {
classesBuilder.append(" " + style.sortableHeader());
}
if (isSorted) {
classesBuilder.append(" " + (isSortAscending ? style.sortedHeaderAscending() : style.sortedHeaderDescending()));
}
// Create the table cell.
TableCellBuilder th = out.startTH().className(classesBuilder.toString());
// Associate the cell with the column to enable sorting of the
// column.
enableColumnHandlers(th, column);
// Render the header.
Context context = new Context(0, 0, header.getKey());
renderSortableHeader(th, context, header, isSorted, isSortAscending);
// End the table cell.
th.endTH();
}