Java Code Examples for com.google.gwt.user.cellview.client.Column#setHorizontalAlignment()

The following examples show how to use com.google.gwt.user.cellview.client.Column#setHorizontalAlignment() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SecurityDomainRealmEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void setupTable() {
    table = new DefaultCellTable<>(5);
    table.setSelectionModel(selectionModel);

    // columns
    Column<ModelNode, String> realmColumn = createColumn("realm");
    Column<ModelNode, String> principalTransformColumn = createColumn("principal-transformer");
    Column<ModelNode, String> roleDecoderColumn = createColumn("role-decoder");
    Column<ModelNode, String> roleMapperColumn = createColumn("role-mapper");
    realmColumn.setSortable(true);
    realmColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    principalTransformColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    roleDecoderColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    roleMapperColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(realmColumn, "Realm");
    table.addColumn(principalTransformColumn, "Principal Transform");
    table.addColumn(roleDecoderColumn, "Role Decoder");
    table.addColumn(roleMapperColumn, "Role Mapper");
    table.setColumnWidth(realmColumn, 30, Style.Unit.PCT);
    table.setColumnWidth(principalTransformColumn, 30, Style.Unit.PCT);
    table.setColumnWidth(roleDecoderColumn, 20, Style.Unit.PCT);
    table.setColumnWidth(roleMapperColumn, 20, Style.Unit.PCT);
}
 
Example 2
Source File: MechanismProviderFilteringSaslServerFilterEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void setupTable() {
    table = new DefaultCellTable<>(5, nameProvider);
    table.setSelectionModel(selectionModel);

    // columns
    Column<ModelNode, String> providerNameColumn = createColumn("provider-name");
    Column<ModelNode, String> mechanismNameColumn = createColumn("mechanism-name");
    Column<ModelNode, String> providerVersionColumn = createColumn("provider-version");
    Column<ModelNode, String> versionComparisonColumn = createColumn("version-comparison");
    providerNameColumn.setSortable(true);
    providerNameColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    mechanismNameColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    providerVersionColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    versionComparisonColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(providerNameColumn, "Provider Name");
    table.addColumn(mechanismNameColumn, "Mechanism Name");
    table.addColumn(providerVersionColumn, "Provider Version");
    table.addColumn(versionComparisonColumn, "Version Comparison");
    table.setColumnWidth(providerNameColumn, 30, Style.Unit.PCT);
    table.setColumnWidth(mechanismNameColumn, 30, Style.Unit.PCT);
    table.setColumnWidth(providerVersionColumn, 20, Style.Unit.PCT);
    table.setColumnWidth(versionComparisonColumn, 20, Style.Unit.PCT);
}
 
Example 3
Source File: ConstantPermissionMappingEditor.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void setupTable() {
    table = new DefaultCellTable<>(5);
    table.setSelectionModel(selectionModel);

    // columns
    Column<ModelNode, String> classNameColumn = createColumn("class-name");
    Column<ModelNode, String> moduleColumn = createColumn("module");
    Column<ModelNode, String> targetNameColumn = createColumn("target-name");
    Column<ModelNode, String> actionColumn = createColumn("action");
    classNameColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    moduleColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    targetNameColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    actionColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(classNameColumn, "Class name");
    table.addColumn(moduleColumn, "Module");
    table.addColumn(targetNameColumn, "Target name");
    table.addColumn(actionColumn, "Action");
    table.setColumnWidth(classNameColumn, 40, Style.Unit.PCT);
    table.setColumnWidth(moduleColumn, 20, Style.Unit.PCT);
    table.setColumnWidth(targetNameColumn, 25, Style.Unit.PCT);
    table.setColumnWidth(actionColumn, 15, Style.Unit.PCT);
}
 
Example 4
Source File: GenericListComplexAttribute.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void setupTable() {
    table = new DefaultCellTable<>(10);
    table.setSelectionModel(selectionModel);

    // columns
    for (Property propDescription: resourceDescription.get(ATTRIBUTES).asPropertyList()) {
        Column<ModelNode, String> column = createColumn(propDescription.getName());
        column.setSortable(true);
        column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        table.addColumn(column, label(propDescription.getName()));
    };
}
 
Example 5
Source File: IdentityAttributeMappingView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Column<ModelNode, String> createColumn(String attributeName) {
    Column<ModelNode, String> column = new TextColumn<ModelNode>() {
        @Override
        public String getValue(ModelNode node) {
            return node.hasDefined(attributeName) ? node.get(attributeName).asString() : "";
        }
    };
    column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    return column;
}
 
Example 6
Source File: SimplePermissionMappingEditor.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void setupTable() {
    table = new DefaultCellTable<>(5);
    table.setSelectionModel(selectionModel);

    // columns
    Column<ModelNode, String> matchAll = createColumn("match-all");
    Column<ModelNode, String> principals = createColumn("principals");
    Column<ModelNode, String> roles = createColumn(ROLES);
    Column<ModelNode, ModelNode> linkOpenDetailsColumn = new Column<ModelNode, ModelNode>(
            new ViewLinkCell<>(Console.CONSTANTS.common_label_view(), this::showDetailModal)) {
        @Override
        public ModelNode getValue(ModelNode node) {
            return node;
        }
    };

    matchAll.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    principals.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    roles.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    linkOpenDetailsColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    table.addColumn(matchAll, "Match All");
    table.addColumn(principals, "Principals");
    table.addColumn(roles, "Roles");
    table.addColumn(linkOpenDetailsColumn, "Permissions");
    table.setColumnWidth(matchAll, 20, Style.Unit.PCT);
    table.setColumnWidth(principals, 30, Style.Unit.PCT);
    table.setColumnWidth(roles, 30, Style.Unit.PCT);
    table.setColumnWidth(linkOpenDetailsColumn, 20, Style.Unit.PCT);
}