Search in sources :

Example 1 with ClientPropertyProperty

use of com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty in project intellij-community by JetBrains.

the class RadComponent method writeClientProperties.

private void writeClientProperties(final XmlWriter writer) {
    if (myModule == null) {
        return;
    }
    boolean haveClientProperties = false;
    try {
        ClientPropertiesProperty cpp = ClientPropertiesProperty.getInstance(getProject());
        for (Property prop : cpp.getChildren(this)) {
            ClientPropertyProperty clientProp = (ClientPropertyProperty) prop;
            final Object value = getDelegee().getClientProperty(clientProp.getName());
            if (value != null) {
                if (!haveClientProperties) {
                    writer.startElement(UIFormXmlConstants.ELEMENT_CLIENT_PROPERTIES);
                    haveClientProperties = true;
                }
                writer.startElement(clientProp.getName());
                writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_CLASS, value.getClass().getName());
                writer.addAttribute(UIFormXmlConstants.ATTRIBUTE_VALUE, value.toString());
                writer.endElement();
            }
        }
    } finally {
        if (haveClientProperties) {
            writer.endElement();
        }
    }
}
Also used : ClientPropertyProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty) ClientPropertiesProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty) Property(com.intellij.uiDesigner.propertyInspector.Property) ClientPropertyProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty) ClientPropertiesProperty(com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty) IntroStringProperty(com.intellij.uiDesigner.propertyInspector.properties.IntroStringProperty) IntrospectedProperty(com.intellij.uiDesigner.propertyInspector.IntrospectedProperty)

Aggregations

IntrospectedProperty (com.intellij.uiDesigner.propertyInspector.IntrospectedProperty)1 Property (com.intellij.uiDesigner.propertyInspector.Property)1 ClientPropertiesProperty (com.intellij.uiDesigner.propertyInspector.properties.ClientPropertiesProperty)1 ClientPropertyProperty (com.intellij.uiDesigner.propertyInspector.properties.ClientPropertyProperty)1 IntroStringProperty (com.intellij.uiDesigner.propertyInspector.properties.IntroStringProperty)1