@Override public Collection<DesignComponent> getChildren() { PropertyValue itemsValue = getComponent().readProperty(FormCD.PROP_ITEMS); ArrayList<DesignComponent> items = new ArrayList<DesignComponent>(); Debug.collectAllComponentReferences(itemsValue, items); return items; }
@Override public Collection<DesignComponent> getChildren() { PropertyValue elementsValue = getComponent().readProperty(ListCD.PROP_ELEMENTS); List<DesignComponent> elements = new ArrayList<DesignComponent>(); Debug.collectAllComponentReferences(elementsValue, elements); return elements; }
@Override public Collection<DesignComponent> getChildren() { PropertyValue elementsValue = getComponent().readProperty(ChoiceGroupCD.PROP_ELEMENTS); ArrayList<DesignComponent> elements = new ArrayList<DesignComponent>(); Debug.collectAllComponentReferences(elementsValue, elements); // PropertyValue typeValue = getComponent().readProperty(ChoiceGroupCD.PROP_CHOICE_TYPE); // if (!PropertyValue.Kind.USERCODE.equals(typeValue.getKind())) { // int type = MidpTypes.getInteger(typeValue); // if (type == ChoiceSupport.VALUE_POPUP && elements.size() > 0) { // return elements.subList(0, 1); // } // } return elements; }
protected void collectRequiredComponents (Collection<DesignComponent> requiredComponents) { PropertyValue propertyValue = getComponent ().readProperty (PROP_COMMANDS); ArrayList<DesignComponent> commandEventSources = new ArrayList<DesignComponent> (); Debug.collectAllComponentReferences (propertyValue, commandEventSources); for (DesignComponent component : commandEventSources) RootCode.collectRequiredComponents (component, requiredComponents); } },
protected void collectRequiredComponents (Collection<DesignComponent> requiredComponents) { PropertyValue propertyValue = getComponent ().readProperty (PROP_COMMANDS); ArrayList<DesignComponent> itemCommandEventSources = new ArrayList<DesignComponent> (); Debug.collectAllComponentReferences (propertyValue, itemCommandEventSources); for (DesignComponent component : itemCommandEventSources) RootCode.collectRequiredComponents (component, requiredComponents); } },
private void filterResources(DesignComponent component,Collection<DesignComponent> resources) { for (DesignComponent child : component.getComponents()) { filterResources(child, resources); } Collection<DesignComponent> references = new ArrayList<DesignComponent>(); for (PropertyDescriptor pd : component.getComponentDescriptor().getPropertyDescriptors()) { Debug.collectAllComponentReferences(component.readProperty(pd.getName()), references); resources.removeAll(references); references.clear(); } }
private static boolean isComponentReferencedInRootTree (DesignComponent treeComponent, DesignComponent referenceComponent) { ArrayList<DesignComponent> referenced = new ArrayList<DesignComponent> (); ComponentDescriptor descriptor = treeComponent.getComponentDescriptor (); if (descriptor != null) { for (PropertyDescriptor propertyDescriptor : descriptor.getPropertyDescriptors ()) { PropertyValue propertyValue = treeComponent.readProperty (propertyDescriptor.getName ()); referenced.clear (); Debug.collectAllComponentReferences (propertyValue, referenced); if (referenced.contains (referenceComponent)) return true; } } for (DesignComponent child : treeComponent.getComponents ()) if (isComponentReferencedInRootTree (child, referenceComponent)) return true; return false; }
protected void collectRequiredComponents(Collection<DesignComponent> requiredComponents) { DesignComponent component = getComponent(); ComponentDescriptor descriptor = component.getComponentDescriptor(); if (descriptor != null) for (PropertyDescriptor property : descriptor.getPropertyDescriptors()) Debug.collectAllComponentReferences(component.readProperty(property.getName()), requiredComponents); } }
private static void collectUsedReferences (HashSet<DesignComponent> referencedComponents, DesignComponent component) { ComponentDescriptor descriptor = component.getComponentDescriptor (); Collection<PropertyDescriptor> propertyDescriptors = descriptor.getPropertyDescriptors (); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (! propertyDescriptor.isUseForSerialization ()) continue; PropertyValue propertyValue = component.readProperty (propertyDescriptor.getName ()); Debug.collectAllComponentReferences (propertyValue, referencedComponents); } }
Debug.collectAllComponentReferences (value, item.components = new HashSet<DesignComponent> ());
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { PropertyValue value = component.readProperty (propertyDescriptor.getName ()); Debug.collectAllComponentReferences (value, references); references = new HashSet<DesignComponent> (); for (String propertyName : propertiesUsingChildrenOnly) Debug.collectAllComponentReferences (component.readProperty (propertyName), references); HashSet<DesignComponent> children = new HashSet<DesignComponent> (component.getComponents ()); for (DesignComponent reference : references)