mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 19:27:57 +08:00
Desktop RoleEditor - Performance problem in attributes frame #PL-2055
This commit is contained in:
parent
bd03add14f
commit
42261dc038
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
@ -71,4 +71,10 @@
|
||||
|
||||
</style>
|
||||
|
||||
<!-- empty styles for role-edit frame -->
|
||||
|
||||
<style name="allowedItem">
|
||||
|
||||
</style>
|
||||
|
||||
</theme>
|
||||
|
@ -22,10 +22,12 @@
|
||||
|
||||
<xs:complexType name="uiDefaultsType">
|
||||
<xs:sequence>
|
||||
<xs:element type="colorType" name="color" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="fontType" name="font" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="insetsType" name="insets" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="dimensionType" name="dimension" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="color" type="colorType"/>
|
||||
<xs:element name="font" type="fontType"/>
|
||||
<xs:element name="insets" type="insetsType"/>
|
||||
<xs:element name="dimension" type="dimensionType"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
|
||||
@ -58,13 +60,15 @@
|
||||
|
||||
<xs:complexType name="styleType">
|
||||
<xs:sequence>
|
||||
<xs:element type="colorDecoratorType" name="foreground" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="colorDecoratorType" name="background" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="fontDecoratorType" name="font" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="borderType" name="border" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="customDecoratorType" name="custom" maxOccurs="1" minOccurs="0"/>
|
||||
<xs:element name="components" maxOccurs="1" minOccurs="0"/>
|
||||
<xs:element name="icon" type="iconDecoratorType" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element type="customDecoratorType" name="custom" maxOccurs="1" minOccurs="0"/>
|
||||
<xs:choice maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:element type="colorDecoratorType" name="foreground"/>
|
||||
<xs:element type="colorDecoratorType" name="background"/>
|
||||
<xs:element type="fontDecoratorType" name="font"/>
|
||||
<xs:element name="border" type="borderType"/>
|
||||
<xs:element name="icon" type="iconDecoratorType"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute type="xs:string" name="component" use="optional"/>
|
||||
<xs:attribute type="xs:string" name="name" use="required"/>
|
||||
|
@ -123,21 +123,22 @@ public class AttributePermissionsFrame extends AbstractFrame {
|
||||
modifyCheckBox.setAlignment(Alignment.MIDDLE_CENTER);
|
||||
modifyCheckBox.setFrame(AttributePermissionsFrame.this);
|
||||
modifyCheckBox.setWidth(CHECKER_COLUMN_WIDTH);
|
||||
attachListener(modifyCheckBox, AttributePermissionVariant.MODIFY);
|
||||
|
||||
readOnlyCheckBox = uiFactory.createComponent(CheckBox.NAME);
|
||||
readOnlyCheckBox.setAlignment(Alignment.MIDDLE_CENTER);
|
||||
readOnlyCheckBox.setFrame(AttributePermissionsFrame.this);
|
||||
readOnlyCheckBox.setWidth(CHECKER_COLUMN_WIDTH);
|
||||
attachListener(readOnlyCheckBox, AttributePermissionVariant.READ_ONLY);
|
||||
|
||||
hideCheckBox = uiFactory.createComponent(CheckBox.NAME);
|
||||
hideCheckBox.setAlignment(Alignment.MIDDLE_CENTER);
|
||||
hideCheckBox.setFrame(AttributePermissionsFrame.this);
|
||||
hideCheckBox.setWidth(CHECKER_COLUMN_WIDTH);
|
||||
attachListener(hideCheckBox, AttributePermissionVariant.HIDE);
|
||||
|
||||
updateCheckers(permissionVariant);
|
||||
|
||||
attachListener(modifyCheckBox, AttributePermissionVariant.MODIFY);
|
||||
attachListener(readOnlyCheckBox, AttributePermissionVariant.READ_ONLY);
|
||||
attachListener(hideCheckBox, AttributePermissionVariant.HIDE);
|
||||
}
|
||||
|
||||
public Label getAttributeLabel() {
|
||||
@ -223,7 +224,7 @@ public class AttributePermissionsFrame extends AbstractFrame {
|
||||
}
|
||||
}
|
||||
|
||||
private final List<AttributePermissionControl> permissionControls = new LinkedList<AttributePermissionControl>();
|
||||
private final List<AttributePermissionControl> permissionControls = new LinkedList<>();
|
||||
|
||||
@Override
|
||||
public void init(Map<String, Object> params) {
|
||||
@ -245,7 +246,7 @@ public class AttributePermissionsFrame extends AbstractFrame {
|
||||
attributeTargetsDs.addListener(new CollectionDsListenerAdapter<MultiplePermissionTarget>() {
|
||||
@Override
|
||||
public void itemChanged(Datasource<MultiplePermissionTarget> ds,
|
||||
MultiplePermissionTarget prevItem, MultiplePermissionTarget item) {
|
||||
MultiplePermissionTarget prevItem, final MultiplePermissionTarget item) {
|
||||
if (!selectedEntityPanel.isVisible() && (item != null))
|
||||
selectedEntityPanel.setVisible(true);
|
||||
if (selectedEntityPanel.isVisible() && (item == null))
|
||||
@ -266,7 +267,6 @@ public class AttributePermissionsFrame extends AbstractFrame {
|
||||
metadata.getSession().getClass(Permission.class), EntityOp.CREATE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public void applyFilter() {
|
||||
attributeTargetsDs.refresh();
|
||||
if (attributeTargetsDs.getItemIds().isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user