當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。