Esempio n. 1
0
    def refresh(self, data=None):
        self.clear()

        nameAttributeProxy = _NameAttributeProxy(component=self.component, nodeItem=self.nodeItem)
        nameWidget = AttributeWidget.constructAttributeWidget( nameAttributeProxy, parentWidget=self)
        self.addAttrWidget("name", nameWidget)

        locationAttributeProxy = _LocationAttributeProxy(component=self.component, nodeItem=self.nodeItem, nameWidget=nameWidget)
        locationWidget = AttributeWidget.constructAttributeWidget( locationAttributeProxy, parentWidget=self)
        self.addAttrWidget("location", locationWidget)


        def displayAttribute(attribute):
            attributeWidget = AttributeWidget.constructAttributeWidget( attribute, parentWidget=self)
            self.addAttrWidget(attribute.getName(), attributeWidget)

        for i in range(self.component.getNumAttributeGroups()):
            grp  = self.component.getAttributeGroupByIndex(i)
            self.addSeparator(grp.getName())
            for j in range(grp.getNumAttributes()):
                displayAttribute(grp.getAttributeByIndex(j))

        # Add a stretch so that the widgets pack at the top.
        self.addStretch(2)
Esempio n. 2
0
 def displayAttribute(attribute):
     attributeWidget = AttributeWidget.constructAttributeWidget( attribute, parentWidget=self)
     self.addAttrWidget(attribute.getName(), attributeWidget)