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


Java TreeTable类代码示例

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


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

示例1: initPermissionColoredColumns

import com.haulmont.cuba.gui.components.TreeTable; //导入依赖的package包/类
@Override
public void initPermissionColoredColumns(TreeTable<BasicPermissionTarget> screenPermissionsTree) {
    screenPermissionsTree.addGeneratedColumn("permissionVariant", entity -> {
        PermissionVariant permissionVariant = entity.getPermissionVariant();
        if (permissionVariant == PermissionVariant.NOTSET)
            return null;

        String labelValue = "<span class=\"role-permission-" + permissionVariant.getColor() + "\">" +
                messages.getMessage(permissionVariant) + "</span>";

        Label label = componentsFactory.createComponent(Label.class);
        label.setHtmlEnabled(true);
        label.setValue(labelValue);

        return label;
    });
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:18,代码来源:ScreenPermissionsFrameCompanion.java

示例2: initPermissionColoredColumns

import com.haulmont.cuba.gui.components.TreeTable; //导入依赖的package包/类
@Override
public void initPermissionColoredColumns(TreeTable<BasicPermissionTarget> specificPermissionsTree) {
    specificPermissionsTree.addGeneratedColumn("permissionVariant", entity -> {
        PermissionVariant permissionVariant = entity.getPermissionVariant();
        if (permissionVariant == PermissionVariant.NOTSET)
            return null;

        Label label = componentsFactory.createComponent(Label.class);
        label.setHtmlEnabled(true);
        String labelValue = "<span class=\"role-permission-" + permissionVariant.getColor() + "\">" +
                messages.getMessage(permissionVariant) + "</span>";
        label.setValue(labelValue);

        return label;
    });
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:17,代码来源:SpecificPermissionsFrameCompanion.java

示例3: initPermissionColoredColumns

import com.haulmont.cuba.gui.components.TreeTable; //导入依赖的package包/类
@Override
public void initPermissionColoredColumns(TreeTable screenPermissionsTree) {
    screenPermissionsTree.addGeneratedColumn("permissionVariant", new Table.ColumnGenerator<BasicPermissionTarget>() {
        @Override
        public Component generateCell(BasicPermissionTarget entity) {
            Label label = AppConfig.getFactory().createComponent(Label.class);
            JLabel jLabel = (JLabel) DesktopComponentsHelper.unwrap(label);

            StringBuilder builder = new StringBuilder();

            PermissionVariant permissionVariant = entity.getPermissionVariant();

            if (permissionVariant != PermissionVariant.NOTSET) {
                builder.append("<html>");
                builder.append("<font color=\"").append(permissionVariant.getColor()).append("\">")
                        .append(messages.getMessage(permissionVariant)).append("</font>");

                builder.append("</html>");
            }

            jLabel.setText(builder.toString());

            return label;
        }
    }, Label.class);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:ScreenPermissionsFrameCompanion.java

示例4: initPermissionColoredColumns

import com.haulmont.cuba.gui.components.TreeTable; //导入依赖的package包/类
@Override
public void initPermissionColoredColumns(TreeTable specificPermissionsTree) {
    specificPermissionsTree.addGeneratedColumn("permissionVariant", new Table.ColumnGenerator<BasicPermissionTarget>() {
        @Override
        public Component generateCell(BasicPermissionTarget entity) {
            Label label = AppConfig.getFactory().createComponent(Label.class);
            JLabel jLabel = (JLabel) DesktopComponentsHelper.unwrap(label);

            StringBuilder builder = new StringBuilder();

            PermissionVariant permissionVariant = entity.getPermissionVariant();

            if (permissionVariant != PermissionVariant.NOTSET) {
                builder.append("<html>");
                builder.append("<font color=\"").append(permissionVariant.getColor()).append("\">")
                        .append(messages.getMessage(permissionVariant)).append("</font>");

                builder.append("</html>");
            }

            jLabel.setText(builder.toString());

            return label;
        }
    }, Label.class);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:SpecificPermissionsFrameCompanion.java

示例5: createComponent

import com.haulmont.cuba.gui.components.TreeTable; //导入依赖的package包/类
@Override
public void createComponent() {
    resultComponent = (TreeTable) factory.createComponent(TreeTable.NAME);
    loadId(resultComponent, element);
    createButtonsPanel(resultComponent, element);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:7,代码来源:TreeTableLoader.java


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