public void setCategoryFieldEditable(boolean editable) { categoryField.setEditable(editable); FieldGroup newRuntime = (FieldGroup) getComponent("runtime"); if (newRuntime != null) { newRuntime.setEditable(editable); } } }
@Override protected void postInit() { super.postInit(); if (!PersistenceHelper.isNew(getItem())) { substUser.setEditable(false); } }
protected void setComponentsEditable() { if (getItem().getStartDate() != null) { procDefinitionLookup.setEditable(false); } if (getItem().getStartedBy() != null && !userSession.getCurrentOrSubstitutedUser().equals(getItem().getStartedBy())) { entityNameLookup.setEditable(false); entityIdPickerField.setEditable(false); entityEditorNameField.setEditable(false); } }
@Override public Component generateField(Datasource datasource, String propertyId) { formatField = componentsFactory.createComponent(LookupField.class); Map<String, String> options = new HashMap<>(); for (String format : defaultFormats) { options.put(format, format); } formatField.setDatasource(datasource, propertyId); formatField.setOptionsMap(options); formatField.setNewOptionAllowed(true); formatField.setNewOptionHandler(caption -> { addFormatItem(caption); formatField.setValue(caption); }); formatField.setEditable(security.isEntityOpPermitted(ReportValueFormat.class, EntityOp.UPDATE)); return formatField; } });
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 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 initDefaultScreenField() { boolean screenSelectionEnabled = webConfig.getUserCanChooseDefaultScreen(); if (!screenSelectionEnabled) { defaultScreenField.setEditable(false); defaultScreenField.setDescription(getMessage("defaultScreenSelectionDisabled")); } Map<String, String> map = new LinkedHashMap<>(); for (MenuItem item : collectPermittedScreens(menuConfig.getRootItems())) { map.put(menuConfig.getItemCaption(item.getId()), item.getScreen()); } defaultScreenField.setOptionsMap(map); String defaultScreen = userSettingService.loadSetting(ClientType.WEB, "userDefaultScreen"); if (StringUtils.isEmpty(defaultScreen) || !screenSelectionEnabled) { defaultScreen = webConfig.getDefaultScreenId(); } defaultScreenField.setValue(defaultScreen); }
protected void showChartsNotIncluded() { reportLookup.setEditable(false); chartBox.removeAll(); Label label = componentsFactory.createComponent(Label.class); label.setValue(getMessage("showChart.noChartComponent")); label.setAlignment(Alignment.MIDDLE_CENTER); label.setStyleName("h1"); chartBox.add(label); }
public void create() { LoggedEntity entity = metadata.create(LoggedEntity.class); entity.setAuto(false); entity.setManual(false); setSelectAllCheckBox(false); loggedEntityDs.addItem(entity); loggedEntityTable.setEditable(true); loggedEntityTable.setSelected(entity); enableControls(); entityNameField.setEditable(true); entityNameField.focus(); }
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); }
appThemeField.setEditable(changeThemeEnabled);
String caption = getPropertyCaption(datasource.getMetaClass(), metaProperty); field.setCaption(caption); field.setEditable(!readOnly); field.setRequired(required); field.setDatasource(datasource, metaProperty.getName());