@Override public String toString() { return this.getClass().getName().substring(this.getClass().getName().lastIndexOf(".")+1) + "[id=" + this.id + ", name=" + this.name + ((this.configurationDefinition != null) ? (", config=" + this.configurationDefinition.getName()) : "") + ((this.propertyGroupDefinition != null) ? (", group=" + this.propertyGroupDefinition.getName()) : "") + "]"; } }
org.rhq.core.domain.configuration.definition.PropertyGroupDefinition groupDef = new PropertyGroupDefinition( group.getName()); groupDef.setDisplayName((group.getDisplayName() != null) ? group.getDisplayName() : StringUtils .deCamelCase(group.getName())); groupDef.setDescription(group.getDescription()); groupDef.setDefaultHidden(group.isHiddenByDefault()); groupDef.setOrder(groupOrderIndex++); List<JAXBElement<? extends ConfigurationProperty>> groupProperties = group.getConfigurationProperty(); int propertyOrderIndex = 0;
private HtmlSimpleTogglePanel addGroupPanel(AbstractConfigurationComponent config, PropertyGroupDefinition group) { addDebug(config, true, ".addGroupPanel()"); HtmlSimpleTogglePanel groupPanel = FacesComponentUtility.addSimpleTogglePanel(config, config, null); // TODO: On AJAX requests, set "opened" attribute to its previous state. groupPanel.setOpened(!group.isDefaultHidden()); groupPanel.setHeaderClass(PROPERTY_GROUP_HEADER_STYLE_CLASS); groupPanel.setBodyClass(PROPERTY_GROUP_BODY_STYLE_CLASS); // Custom header that includes the name and description HtmlPanelGroup headerPanel = FacesComponentUtility.createBlockPanel(config, null); FacesComponentUtility.addOutputText(headerPanel, config, group.getDisplayName(), null); FacesComponentUtility .addOutputText(headerPanel, config, group.getDescription(), "group-description-text-panel"); groupPanel.getFacets().put("header", headerPanel); // custom "close" widget HtmlPanelGroup closePanel = FacesComponentUtility.createBlockPanel(config, null); closePanel.setStyle("text-align: right; font-weight: normal; font-size: 0.8em; whitespace: nowrap;"); FacesComponentUtility.addGraphicImage(closePanel, config, "/images/ico_trigger_wht_collapse.gif", "collapse"); FacesComponentUtility.addOutputText(closePanel, config, " Collapse", null); groupPanel.getFacets().put("closeMarker", closePanel); // custom "open" widget HtmlPanelGroup openPanel = FacesComponentUtility.createBlockPanel(config, null); openPanel.setStyle("text-align: right; font-weight: normal; font-size: 0.8em; whitespace: nowrap;"); FacesComponentUtility.addGraphicImage(openPanel, config, "/images/ico_trigger_wht_expand.gif", "expand"); FacesComponentUtility.addOutputText(openPanel, config, " Expand", null); groupPanel.getFacets().put("openMarker", openPanel); addDebug(config, true, ".addGroupPanel()"); return groupPanel; }
/** * Retrieve property definitions for properties in a group with the provided name. The list is sorted by property * definition order index, then by name. * * <p/>NOTE: updates of the result List will not be reflected in the database! * * @param groupName the name of the group * * @return the set of properties in a group with the provided name */ @NotNull public List<PropertyDefinition> getPropertiesInGroup(String groupName) { List<PropertyDefinition> propertyDefinitions = new ArrayList<PropertyDefinition>(); for (PropertyDefinition propertyDefinition : this.propertyDefinitions.values()) { PropertyGroupDefinition group = propertyDefinition.getPropertyGroupDefinition(); if ((group != null) && group.getName().equals(groupName)) { propertyDefinitions.add(propertyDefinition); } } Collections.sort(propertyDefinitions, new PropertyDefinitionComparator()); return propertyDefinitions; }
String groupName = groupDefinition.getName(); if (groupName.startsWith("attribute:")) { String attr = groupName.substring("attribute:".length());
@Override public String toString() { return "SimpleProperty[" + getName() + "] (Type: " + getType() + ")" + ((getPropertyGroupDefinition() != null) ? ("(Group: " + getPropertyGroupDefinition().getName() + ")") : ""); } }
String groupName = pgd.getName(); namePropLocator = null; if (groupName.startsWith("children:")) { // children, where the key in key=value from the path is known
private void addGroupedProperties(AbstractConfigurationComponent config) { addDebug(config, true, ".addGroupedProperties()"); List<PropertyGroupDefinition> groups = config.getConfigurationDefinition().getGroupDefinitions(); for (PropertyGroupDefinition group : groups) { HtmlSimpleTogglePanel groupPanel = addGroupPanel(config, group); AbstractPropertyBagUIComponentTreeFactory propertyListUIComponentTreeFactory = new GroupUIComponentTreeFactory( config, group.getName()); groupPanel.getChildren().add(propertyListUIComponentTreeFactory.createUIComponentTree(null)); } addDebug(config, false, ".addGroupedProperties()"); }
List<PropertyDefinition> groupedDefinitions = existingDefinition.getPropertiesInGroup(group.getName()); String groupName = group.getName(); List<PropertyDefinition> defs = newDefinition.getPropertiesInGroup(group.getName()); Map<String, PropertyDefinition> exPDefs = existingDefinition.getPropertyDefinitions(); for (PropertyDefinition def : defs) {