예제 #1
0
 def get_content_generate(self, parent_direction):
     child_content = ""
     children = self.get_with_def('children', [])
     if children is None or len(children) == 0:
         return child_content
     for child in children:
         if child is None or child['type'] is None:
             continue
         if child['type'] is 'container':
             child_content += ContainerWidget(
                 child, self.config).generate(parent_direction)
         elif child['type'] is 'input':
             child_content += InputWidget(
                 child, self.config).generate(parent_direction)
         elif child['type'] is 'text':
             child_content += TextWidget(
                 child, self.config).generate(parent_direction)
         elif child['type'] is 'icon':
             child_content += ImageWidget(
                 child, self.config).generate(parent_direction)
         elif child['type'] is 'spaceView':
             child_content += BaseWidget(
                 child, self.config).generate(parent_direction)
         elif child['type'] is 'button':
             child_content += ButtonWidget(
                 child, self.config).generate(parent_direction)
         else:
             child_content += UnkonwWidget(
                 child, self.config).generate(parent_direction)
     return child_content
예제 #2
0
 def __init__(self, data, config={}):
     BaseWidget.__init__(self, data, config)
예제 #3
0
 def __init__(self, data, config):
     BaseWidget.__init__(self, data, config)
     self.attribute_mapper.append(WebAttrMapperAppBarTitle())
     self.attribute_mapper.append(WebAttrMapperAppBarLeft())
     self.attribute_mapper.append(WebAttrMapperAppBarRight())