本文整理汇总了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;
});
}
示例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;
});
}
示例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);
}
示例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);
}
示例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);
}