Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.Property


    }

    private void merge(AbstractPropertyMap base, AbstractPropertyMap changes) {
        for (Map.Entry<String, Property> changesEntry : changes.getMap().entrySet()) {
            String changesPropertyName = changesEntry.getKey();
            Property changesProperty = changesEntry.getValue();

            if (changesProperty instanceof PropertySimple) {
                PropertySimple changesPropertySimple = (PropertySimple) changesProperty;

                if ((changesPropertySimple.getOverride() == null) || (!changesPropertySimple.getOverride())) {
View Full Code Here


                + "' does not contain an item at index " + listIndex + ".");
            return;
        }

        // First remove the corresponding JSF component from the component tree.
        Property memberProperty = propertyList.getList().get(listIndex);
        String memberComponentId = PropertyIdGeneratorUtility.getIdentifier(memberProperty, listIndex,
            AbstractPropertyBagUIComponentTreeFactory.PANEL_ID_SUFFIX);
        UIComponent listMemberComponent = configurationComponent.findComponent(memberComponentId);
        if (listMemberComponent == null) {
            throw new IllegalStateException("JSF component with id '" + memberComponentId + "' not found for list '"
View Full Code Here

            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Map '" + mapName
                + "' does not contain a member property named '" + memberName + "'.");
            return;
        }

        Property memberProperty = propertyMap.getMap().get(memberName);
        String memberComponentId = PropertyIdGeneratorUtility.getIdentifier(memberProperty, null,
            AbstractPropertyBagUIComponentTreeFactory.PANEL_ID_SUFFIX);
        UIComponent mapMemberComponent = configurationComponent.findComponent(memberComponentId);
        if (mapMemberComponent == null) {
            throw new IllegalStateException("JSF component with id '" + memberComponentId + "' not found for map '"
View Full Code Here

public class ConfigurationUtility
{
    public static PropertyDefinition getPropertyDefinitionForProperty(Property property,
                                                                      ConfigurationDefinition configurationDefinition) {
        LinkedList<Property> propertyHierarchy = getPropertyHierarchy(property);
        Property topLevelProperty = propertyHierarchy.get(0);
        PropertyDefinition propertyDefinition =
                configurationDefinition.getPropertyDefinitions().get(topLevelProperty.getName());
        for (int i = 1; i < propertyHierarchy.size(); i++)
        {
            Property subProperty = propertyHierarchy.get(i);
            if (propertyDefinition instanceof PropertyDefinitionMap) {
                propertyDefinition = ((PropertyDefinitionMap)propertyDefinition).get(subProperty.getName());
            } else if (propertyDefinition instanceof PropertyDefinitionList) {
                propertyDefinition = ((PropertyDefinitionList)propertyDefinition).getMemberDefinition();
            }
        }
        return propertyDefinition;
View Full Code Here

    }

    public static LinkedList<Property> getPropertyHierarchy(Property property)
    {
        LinkedList<Property> propertyHierarchy = new LinkedList<Property>();
        Property parentProperty = property;
        while ((parentProperty = getParentProperty(parentProperty)) != null) {
            propertyHierarchy.addFirst(parentProperty);
        }

        propertyHierarchy.add(property);
View Full Code Here

        return propertyHierarchy;
    }

    @Nullable
    public static Property getParentProperty(Property property) {
        Property parentProperty;
        if (property.getParentList() != null) {
            parentProperty = property.getParentList();
        } else if (property.getParentMap() != null) {
            parentProperty = property.getParentMap();
        } else {
View Full Code Here

    private void addListMemberMapProperty(UIComponent parent, PropertyList listProperty,
        PropertyDefinitionMap listMemberMapPropertyDefinition, String viewEditButtonLabel, String viewEditButtonTitle,
        int index) {
        addDebug(parent, true, ".addListMemberMapProperty()");
        Property listMemberProperty = listProperty.getList().get(index);
        String listName = listProperty.getName();
        if (!(listMemberProperty instanceof PropertyMap)) {
            throw new IllegalStateException("Property '" + listName
                + "' is defined as a list of maps but contains one or more non-map members.");
        }
View Full Code Here

    private void addPropertyMapSummaryDataCells(UIComponent parent,
        PropertyDefinitionMap listMemberMapPropertyDefinition, PropertyMap listMemberMapProperty) {
        for (PropertyDefinition summaryPropertyDefinition : listMemberMapPropertyDefinition
            .getSummaryPropertyDefinitions()) {
            Property mapMemberProperty = listMemberMapProperty.get(summaryPropertyDefinition.getName());
            if (!(mapMemberProperty instanceof PropertySimple)) {
                throw new IllegalStateException("Property '" + mapMemberProperty.getName()
                    + "' is defined as a map of simples but contains one or more non-simple members.");
            }

            PropertySimple mapMemberSimpleProperty = (PropertySimple) mapMemberProperty;
            FacesComponentUtility.addVerbatimText(parent, "<td class='" + PROPERTY_MAP_SUMMARY_DATA_CELL_STYLE_CLASS
View Full Code Here

        PropertyDefinitionSimple propertyDefinitionSimple) {
        HtmlSelectBooleanCheckbox input = FacesComponentUtility.createComponent(HtmlSelectBooleanCheckbox.class,
            this.config);

        // Find the actual property corresponding to this property def, and use that to create the component id.
        Property property = this.propertyMap.get(propertyDefinitionSimple.getName());
        if (property != null) {
            // add suffix to prevent collision with value input identifier for property
            String propertyId = PropertyIdGeneratorUtility.getIdentifier(property, getListIndex(), "override");
            input.setId(propertyId);
View Full Code Here

    private Boolean isOverride(PropertyDefinition propertyDefinition) {
        if (!(propertyDefinition instanceof PropertyDefinitionSimple)) {
            return false;
        }

        Property property = this.propertyMap.get(propertyDefinition.getName());
        if (property == null) {
            return false;
        }

        Boolean override = ((PropertySimple) property).getOverride();
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.Property

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.