protected void applyPermissions(boolean editable) { if (!editable) { allowCheckBox.setEditable(false); disallowCheckBox.setEditable(false); } }
public void setEditable(boolean editable) { allowCheckBox.setEditable(editable); disallowCheckBox.setEditable(editable); }
protected void applyPermissions(boolean editable) { if (!editable) { hideCheckBox.setEditable(false); showCheckBox.setEditable(false); readOnlyCheckBox.setEditable(false); addPermissionBtn.setEnabled(false); } }
protected void applyPermissions(boolean editable) { allAllowCheck.setEditable(editable); allDenyCheck.setEditable(editable); for(EntityOperationControl entityOperationControl : operationControls) { entityOperationControl.getAllowChecker().setEditable(editable); entityOperationControl.getDenyChecker().setEditable(editable); } }
public void setSelectAllCheckBox(boolean value) { canSelectAllCheckboxGenerateEvents = false; boolean isEditable = selectAllCheckBox.isEditable(); try { selectAllCheckBox.setEditable(true); selectAllCheckBox.setValue(value); } finally { canSelectAllCheckboxGenerateEvents = true; selectAllCheckBox.setEditable(isEditable); } }
protected void enableControls() { loggedEntityTable.setEnabled(false); entityNameField.setEditable(false); autoCheckBox.setEditable(true); manualCheckBox.setEditable(true); for (Component c : attributesBoxScroll.getComponents()) ((CheckBox) c).setEditable(true); actionsPaneLayout.setVisible(true); }
protected void disableControls() { entityNameField.setEditable(false); loggedEntityTable.setEnabled(true); autoCheckBox.setEditable(false); manualCheckBox.setEditable(false); for (Component c : attributesBoxScroll.getComponents()) ((CheckBox) c).setEditable(false); actionsPaneLayout.setVisible(false); }
protected void applyPermissions(boolean editable) { allHideCheck.setEditable(editable); allModifyCheck.setEditable(editable); allReadOnlyCheck.setEditable(editable); MetaClass metaClass = attributeTargetsDs.getItem().getEntityMetaClass(); for (AttributePermissionControl attributePermissionControl : permissionControls) { attributePermissionControl.getHideCheckBox().setEditable(editable); attributePermissionControl.getHideCheckBox().setEnabled(editable); attributePermissionControl.getReadOnlyCheckBox().setEditable(editable); attributePermissionControl.getReadOnlyCheckBox().setEnabled(editable); String attributeName = attributePermissionControl.getAttributeName(); if (userSession.isEntityAttrPermitted(metaClass, attributeName, EntityAttrAccess.MODIFY)) { boolean canUpdateEntity = userSession.isEntityOpPermitted(metaClass, EntityOp.UPDATE); attributePermissionControl.getModifyCheckBox().setEditable(canUpdateEntity && editable); attributePermissionControl.getModifyCheckBox().setEnabled(canUpdateEntity && editable); } else { attributePermissionControl.getModifyCheckBox().setEditable(false); attributePermissionControl.getModifyCheckBox().setEnabled(false); } } }
protected void addAttribute(Set<LoggedAttribute> enabledAttributes, String name, boolean editable) { CheckBox checkBox = factory.createComponent(CheckBox.class); if (enabledAttributes != null && isEntityHaveAttribute(name, enabledAttributes)) { checkBox.setValue(true); } checkBox.setId(name); checkBox.setCaption(name); checkBox.setEditable(editable); checkBox.addValueChangeListener(e -> checkAllCheckboxes()); attributesBoxScroll.add(checkBox); }
protected void initTransformations() { ReportInputParameter parameter = getItem(); predefinedTransformation.setValue(parameter.getPredefinedTransformation() != null); enableControlsByTransformationType(parameter.getPredefinedTransformation() != null); predefinedTransformation.addValueChangeListener(e -> { boolean hasPredefinedTransformation = e.getValue() != null && e.getValue(); enableControlsByTransformationType(hasPredefinedTransformation); if (hasPredefinedTransformation) { parameter.setTransformationScript(null); } else { parameter.setPredefinedTransformation(null); } }); predefinedTransformation.setEditable(security.isEntityOpPermitted(ReportInputParameter.class, EntityOp.UPDATE)); }
if (Boolean.TRUE.equals(e.getValue())) { logStartField.setValue(true); logStartField.setEditable(false); } else { logStartField.setEditable(true);
protected void createTimeZoneField() { FieldGroup.FieldConfig timeZoneFc = fieldGroupRight.getFieldNN("timeZone"); HBoxLayout hbox = uiComponents.create(HBoxLayout.class); hbox.setSpacing(true); timeZoneLookup = uiComponents.create(LookupField.TYPE_STRING); timeZoneLookup.setDatasource(timeZoneFc.getTargetDatasource(), timeZoneFc.getProperty()); timeZoneLookup.setRequired(false); MetaClass userMetaClass = userDs.getMetaClass(); timeZoneLookup.setEditable(fieldGroupRight.isEditable() && security.isEntityAttrUpdatePermitted(userMetaClass, timeZoneFc.getProperty())); Map<String, String> options = new TreeMap<>(); for (String id : TimeZone.getAvailableIDs()) { TimeZone timeZone = TimeZone.getTimeZone(id); options.put(timeZones.getDisplayNameLong(timeZone), id); } timeZoneLookup.setOptionsMap(options); hbox.add(timeZoneLookup); CheckBox autoDetectField = uiComponents.create(CheckBox.class); autoDetectField.setDatasource(timeZoneFc.getTargetDatasource(), "timeZoneAuto"); autoDetectField.setCaption(messages.getMainMessage("timeZone.auto")); autoDetectField.setDescription(messages.getMainMessage("timeZone.auto.descr")); autoDetectField.setAlignment(Alignment.MIDDLE_RIGHT); autoDetectField.setEditable(fieldGroupRight.isEditable() && security.isEntityAttrUpdatePermitted(userMetaClass, "timeZoneAuto")); hbox.add(autoDetectField); hbox.expand(timeZoneLookup); timeZoneFc.setComponent(hbox); }
metadata.getClassNN(metaClassName)); List<MetaProperty> metaProperties = new ArrayList<>(metaClass.getProperties()); selectAllCheckBox.setEditable(editable); Set<LoggedAttribute> enabledAttr = null; if (item != null)
allowCheckBox.setEditable(hasPermissionsToModifyPermission); disallowCheckBox.setEditable(hasPermissionsToModifyPermission);