void (final @NotNull Element itemElement, final @NotNull GroupItem group, final boolean skipExisting) { // Class name. It's OK if class does not exist. final String className = LwXmlReader.getRequiredString(itemElement, ATTRIBUTE_CLASS); if (skipExisting && getItem(className) != null) { return; } // Icon (optional) final String iconPath = LwXmlReader.getString(itemElement, ATTRIBUTE_ICON); // Tooltip text (optional) final String toolTipText = LwXmlReader.getString(itemElement, ATTRIBUTE_TOOLTIP_TEXT); // can be null boolean autoCreateBinding = LwXmlReader.getOptionalBoolean(itemElement, ATTRIBUTE_AUTO_CREATE_BINDING, false); boolean canAttachLabel = LwXmlReader.getOptionalBoolean(itemElement, ATTRIBUTE_CAN_ATTACH_LABEL, false); boolean isContainer = LwXmlReader.getOptionalBoolean(itemElement, ATTRIBUTE_IS_CONTAINER, false); // Default constraint final GridConstraints constraints; final Element defaultConstraints = itemElement.getChild(ELEMENT_DEFAULT_CONSTRAINTS); if (defaultConstraints != null) { constraints = processDefaultConstraintsElement(defaultConstraints); } else { constraints = new GridConstraints(); } final HashMap<String, StringDescriptor> propertyName2initialValue = new HashMap<>(); { final Element initialValues = itemElement.getChild(ELEMENT_INITIAL_VALUES); if (initialValues != null) { for (final Element e : initialValues.getChildren(ELEMENT_PROPERTY)) { final String name = LwXmlReader.getRequiredString(e, ATTRIBUTE_NAME); // TODO[all] currently all initial values are strings final StringDescriptor value = StringDescriptor.create(LwXmlReader.getRequiredString(e, ATTRIBUTE_VALUE)); propertyName2initialValue.put(name, value); } } } final boolean removable = LwXmlReader.getOptionalBoolean(itemElement, ATTRIBUTE_REMOVABLE, true); final ComponentItem item = new ComponentItem( myProject, className, iconPath, toolTipText, constraints, propertyName2initialValue, removable, autoCreateBinding, canAttachLabel ); item.setIsContainer(isContainer); addItem(group, item); }