当前位置: 首页>>代码示例>>Java>>正文


Java TextHeader类代码示例

本文整理汇总了Java中com.google.gwt.user.cellview.client.TextHeader的典型用法代码示例。如果您正苦于以下问题:Java TextHeader类的具体用法?Java TextHeader怎么用?Java TextHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TextHeader类属于com.google.gwt.user.cellview.client包,在下文中一共展示了TextHeader类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAddRemoveColumn

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
@Test
public void testAddRemoveColumn() {
    final Column column = mock(Column.class);
    when(column.getDataStoreName()).thenReturn("id");
    final ColumnMeta meta = new ColumnMeta(column,
                                           "caption");
    meta.setHeader(new TextHeader("header"));
    columnPicker.addColumn(meta);
    assertTrue(columnPicker.getColumnMetaList().contains(meta));
    verify(dataGrid).addColumn(column,
                               meta.getHeader());
    assertEquals(1,
                 dataGrid.getColumnCount());
    columnPicker.removeColumn(meta);
    assertFalse(columnPicker.getColumnMetaList().contains(meta));
    verify(dataGrid).removeColumn(0);
    assertEquals(0,
                 dataGrid.getColumnCount());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:ColumnPickerTest.java

示例2: testSortColumn

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
@Test
public void testSortColumn() {
    final Column column1 = mock(Column.class);
    final ColumnMeta meta1 = new ColumnMeta(column1,
                                            "caption1",
                                            true,
                                            1);
    meta1.setHeader(new TextHeader("header1"));
    final Column column0 = mock(Column.class);
    final ColumnMeta meta0 = new ColumnMeta(column0,
                                            "caption0",
                                            true,
                                            0);
    meta0.setHeader(new TextHeader("header0"));
    columnPicker.addColumns(Arrays.asList(meta1,
                                          meta0));
    assertEquals(2,
                 columnPicker.getColumnMetaList().size());
    verify(dataGrid).addColumn(column0,
                               meta0.getHeader());
    verify(dataGrid).addColumn(column1,
                               meta1.getHeader());
    assertEquals(2,
                 dataGrid.getColumnCount());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:ColumnPickerTest.java

示例3: testColumnPreference

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
@Test
public void testColumnPreference() {
    final Column column = mock(Column.class);
    when(column.getDataStoreName()).thenReturn("id");
    final ColumnMeta meta = new ColumnMeta(column,
                                           "caption");
    meta.setHeader(new TextHeader("header"));
    columnPicker.addColumn(meta);
    final List<GridColumnPreference> columnsState = columnPicker.getColumnsState();
    assertEquals(1,
                 columnsState.size());
    final GridColumnPreference preference = columnsState.get(0);
    assertEquals(preference.getName(),
                 column.getDataStoreName());
    assertEquals(0,
                 preference.getPosition().intValue());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:ColumnPickerTest.java

示例4: createColumnTextCell

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:UberfireColumnPickerTest.java

示例5: createOffsetColumn

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
private void createOffsetColumn() {
	offSetColumn = new TextColumn<T>() {
		@Override
		public String getValue(T object) {
			return null;
		}
	};
	offSetHeader = new TextHeader("");
	offSetHeader.setHeaderStyleNames("treeGridOffsetHeader");
}
 
开发者ID:treblereel,项目名称:TreeGridGWT,代码行数:11,代码来源:TreeGrid.java

示例6: addColumntoTemplateTable

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
private void addColumntoTemplateTable(Column<TemplateDto, ?> column, String headerText) {
	Header<String> header = new TextHeader(headerText);
	templateTable.addColumn(column, header);
}
 
开发者ID:wte4j,项目名称:wte4j,代码行数:5,代码来源:TemplateListPanel.java

示例7: testAdjustColumnWidths

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
@Test
public void testAdjustColumnWidths() {
    final Column column1 = createColumn("col1",
                                        "col1");
    final ColumnMeta meta1 = new ColumnMeta(column1,
                                            "caption1",
                                            true,
                                            1);
    meta1.setHeader(new TextHeader("header1"));
    final Column column2 = createColumn("col2",
                                        "col2");
    final ColumnMeta meta2 = new ColumnMeta(column2,
                                            "caption2",
                                            true,
                                            0);
    meta2.setHeader(new TextHeader("header2"));
    final Column column3 = createColumn("col3",
                                        "col3");
    final ColumnMeta meta3 = new ColumnMeta(column3,
                                            "caption3",
                                            true,
                                            0);
    meta3.setHeader(new TextHeader("header3"));

    when(dataGrid.getColumnWidth(column1)).thenReturn("35px");
    when(dataGrid.getColumnWidth(column2)).thenReturn(null);
    when(dataGrid.getColumnWidth(column3)).thenReturn(null);

    List<ColumnMeta> columnMetasList = new ArrayList<ColumnMeta>();
    columnMetasList.add(meta1);
    columnMetasList.add(meta2);
    columnMetasList.add(meta3);
    columnPicker.addColumns(columnMetasList);

    verify(dataGrid).setColumnWidth(column1,
                                    "35px");
    verify(dataGrid).setColumnWidth(column2,
                                    50,
                                    Style.Unit.PCT);
    verify(dataGrid).setColumnWidth(column3,
                                    50,
                                    Style.Unit.PCT);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:44,代码来源:ColumnPickerTest.java

示例8: setup

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
private void setup() {
    //Setup table
    table.setStriped(true);
    table.setCondensed(true);
    table.setBordered(true);

    //Columns
    repositoryIdColumn = new TextColumn<MavenRepositoryMetadata>() {

        @Override
        public String getValue(final MavenRepositoryMetadata metadata) {
            return metadata.getId();
        }
    };
    repositoryUrlColumn = new TextColumn<MavenRepositoryMetadata>() {

        @Override
        public String getValue(final MavenRepositoryMetadata metadata) {
            return metadata.getUrl();
        }
    };
    repositorySourceColumn = new TextColumn<MavenRepositoryMetadata>() {

        @Override
        public String getValue(final MavenRepositoryMetadata metadata) {
            switch (metadata.getSource()) {
                case LOCAL:
                    return ProjectResources.CONSTANTS.RepositorySourceLocal();
                case PROJECT:
                    return ProjectResources.CONSTANTS.RepositorySourceProject();
                case SETTINGS:
                    return ProjectResources.CONSTANTS.RepositorySourceSettings();
                case DISTRIBUTION_MANAGEMENT:
                    return ProjectResources.CONSTANTS.RepositorySourceDistributionManagement();
            }
            return ProjectResources.CONSTANTS.RepositorySourceUnknown();
        }
    };

    table.addColumn(repositoryIdColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositoryId()));
    table.addColumn(repositoryUrlColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositoryUrl()));
    table.addColumn(repositorySourceColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositorySource()));

    //Link data
    dataProvider.addDataDisplay(table);
    dataProvider.setList(repositories);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:51,代码来源:ConflictingRepositoriesPopupViewImpl.java

示例9: setup

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
private void setup() {
    //Setup table
    table.setStriped(true);
    table.setCondensed(true);
    table.setBordered(true);

    //Columns
    final CheckboxCell cbCell = new CheckboxCell();
    repositoryIncludeColumn = new Column<ModuleRepositories.ModuleRepository, Boolean>(cbCell) {
        @Override
        public Boolean getValue(final ModuleRepositories.ModuleRepository repository) {
            return repository.isIncluded();
        }
    };

    repositoryIdColumn = new TextColumn<ModuleRepositories.ModuleRepository>() {

        @Override
        public String getValue(final ModuleRepositories.ModuleRepository repository) {
            return repository.getMetadata().getId();
        }
    };
    repositoryUrlColumn = new TextColumn<ModuleRepositories.ModuleRepository>() {

        @Override
        public String getValue(final ModuleRepositories.ModuleRepository repository) {
            return repository.getMetadata().getUrl();
        }
    };
    repositorySourceColumn = new TextColumn<ModuleRepositories.ModuleRepository>() {

        @Override
        public String getValue(final ModuleRepositories.ModuleRepository repository) {
            switch (repository.getMetadata().getSource()) {
                case LOCAL:
                    return ProjectResources.CONSTANTS.RepositorySourceLocal();
                case PROJECT:
                    return ProjectResources.CONSTANTS.RepositorySourceProject();
                case SETTINGS:
                    return ProjectResources.CONSTANTS.RepositorySourceSettings();
                case DISTRIBUTION_MANAGEMENT:
                    return ProjectResources.CONSTANTS.RepositorySourceDistributionManagement();
            }
            return ProjectResources.CONSTANTS.RepositorySourceUnknown();
        }
    };

    table.addColumn(repositoryIncludeColumn,
                    new TextHeader(ProjectEditorResources.CONSTANTS.RepositoryInclude()));
    table.addColumn(repositoryIdColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositoryId()));
    table.addColumn(repositoryUrlColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositoryUrl()));
    table.addColumn(repositorySourceColumn,
                    new TextHeader(ProjectResources.CONSTANTS.RepositorySource()));

    //Link data
    dataProvider.addDataDisplay(table);
    dataProvider.setList(repositories);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:61,代码来源:RepositoriesWidgetViewImpl.java

示例10: addColumn

import com.google.gwt.user.cellview.client.TextHeader; //导入依赖的package包/类
/**
 * Adds the column to the grid.
 *
 * @param <K> the entity.
 * @param name the column name.
 * @param sorting the sorting flag.
 * @param column the column.
 * @param footer the footer.
 * @return the corresponding column.
 */
public <K extends Comparable<K>> Column<T, ?> addColumn(String name, boolean sorting, final AbstractEntityColumn<T, K, ?> column, Header footer) {
    addColumn(column, new TextHeader(name), footer);
    if (sorting) {
        addColumnSortHandler(new ColumnSortHandler<T>(dataProvider.getList(), column));
    }
    return column;
}
 
开发者ID:lorislab,项目名称:smonitor,代码行数:18,代码来源:EntityDataGrid.java


注:本文中的com.google.gwt.user.cellview.client.TextHeader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。