当前位置: 首页>>代码示例>>Python>>正文


Python DOM.createTR方法代码示例

本文整理汇总了Python中pyjamas.DOM.createTR方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.createTR方法的具体用法?Python DOM.createTR怎么用?Python DOM.createTR使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.DOM的用法示例。


在下文中一共展示了DOM.createTR方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: add

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def add(self, widget, stackText="", asHTML=False):
        widget.removeFromParent()
        index = self.getWidgetCount()

        tr = DOM.createTR()
        td = DOM.createTD()
        DOM.appendChild(self.body, tr)
        DOM.appendChild(tr, td)
        self.setStyleName(td, "gwt-StackPanelItem", True)
        self._setIndex(td, index)
        DOM.setAttribute(td, "height", "1px")

        tr = DOM.createTR()
        td = DOM.createTD()
        DOM.appendChild(self.body, tr)
        DOM.appendChild(tr, td)
        DOM.setAttribute(td, "height", "100%")
        DOM.setAttribute(td, "vAlign", "top")

        CellPanel.add(self, widget, td)

        self.setStackVisible(index, False)
        if self.visibleStack == -1:
            self.showStack(0)

        if stackText != "":
            self.setStackText(self.getWidgetCount() - 1, stackText, asHTML)
开发者ID:Afey,项目名称:pyjs,代码行数:29,代码来源:StackPanel.py

示例2: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, vertical=False, **kwargs):
        if not kwargs.has_key('StyleName'): kwargs['StyleName']="gwt-MenuBar"

        self.body = None
        self.items = []
        self.parentMenu = None
        self.popup = None
        self.selectedItem = None
        self.shownChildMenu = None
        self.vertical = False
        self.autoOpen = False

        if kwargs.has_key('Element'):
            table = kwargs.pop('Element')
            fc = DOM.getFirstChild(table)
            if fc:
                self.body = fc
            else:
                self.body = DOM.createTBody()
                DOM.appendChild(table, self.body)
        else:
            table = DOM.createTable()
        self.body = DOM.createTBody()
        DOM.appendChild(table, self.body)

        if not vertical:
            tr = DOM.createTR()
            DOM.appendChild(self.body, tr)

        self.vertical = vertical

        outer = DOM.createDiv()
        DOM.appendChild(outer, table)
        self.setElement(outer)
        Widget.__init__(self, **kwargs)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:37,代码来源:MenuBar.py

示例3: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, text, disclosurePanel):
        Widget.__init__(self)
        self.disclosurePanel = disclosurePanel
        self.imageBase = pygwt.getModuleBaseURL()

        self.root = DOM.createTable()
        self.tbody = DOM.createTBody()
        self.tr = DOM.createTR()
        self.imageTD = DOM.createTD()
        self.labelTD = DOM.createTD()
        self.imgElem = DOM.createImg()

        self.updateState()

        self.setElement(self.root)
        DOM.appendChild(self.root, self.tbody)
        DOM.appendChild(self.tbody, self.tr)
        DOM.appendChild(self.tr, self.imageTD)
        DOM.appendChild(self.tr, self.labelTD)
        DOM.appendChild(self.imageTD, self.imgElem)

        self.setText(text)

        disclosurePanel.addEventHandler(self)
        self.updateState()
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:27,代码来源:DisclosurePanel.py

示例4: insertRow

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def insertRow(self, beforeRow):
        if beforeRow != self.getRowCount():
            self.checkRowBounds(beforeRow)

        tr = DOM.createTR()
        DOM.insertChild(self.bodyElem, tr, beforeRow)
        return beforeRow
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:HTMLTable.py

示例5: insert

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def insert(self, widget, container, beforeIndex=None):
        """ has two modes of operation:
            widget, beforeIndex
            widget, container, beforeIndex.
            if beforeIndex argument is not given, the 1st mode is assumed.
            this technique is less costly than using *args.
        """
        if widget.getParent() == self:
            return

        if beforeIndex is None:
            beforeIndex = container
            container = self.getBody()

        widget.removeFromParent()

        tr = DOM.createTR()
        td = DOM.createTD()

        DOM.insertChild(container, tr, beforeIndex)
        DOM.appendChild(tr, td)

        CellPanel.insert(self, widget, td, beforeIndex)

        self.setCellHorizontalAlignment(widget, self.horzAlign)
        self.setCellVerticalAlignment(widget, self.vertAlign)
开发者ID:Afey,项目名称:pyjs,代码行数:28,代码来源:VerticalPanel.py

示例6: _checkVerticalContainer

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
 def _checkVerticalContainer(self):
     """ use this to delay effect of self.vertical being set.
         self.setVertical can now be used, rather than self.vertical
         force-set in constructor
     """
     if DOM.getChildCount(self.body) == 0:
         DOM.appendChild(self.body, DOM.createTR())
开发者ID:anandology,项目名称:pyjamas,代码行数:9,代码来源:MenuBar.py

示例7: insertItem

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
 def insertItem(self, item, index):
     if self.vertical:
         tr = DOM.createTR()
         DOM.insertChild(self.body, tr, index)
     else:
         self._checkVerticalContainer()
         tr = DOM.getChild(self.body, 0)
     DOM.insertChild(tr, item.getElement(), index)
     item.setParentMenu(self)
     item.setSelectionStyle(False)
     self.items.insert(index, item)
开发者ID:Afey,项目名称:pyjs,代码行数:13,代码来源:MenuBar.py

示例8: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, **kwargs):

        if not kwargs.has_key('Spacing'): kwargs['Spacing'] = 0
        if not kwargs.has_key('Padding'): kwargs['Padding'] = 0

        self.horzAlign = HasHorizontalAlignment.ALIGN_LEFT
        self.vertAlign = HasVerticalAlignment.ALIGN_TOP

        CellPanel.__init__(self, **kwargs)

        self.tableRow = DOM.createTR()
        DOM.appendChild(self.getBody(), self.tableRow)
开发者ID:certik,项目名称:pyjamas,代码行数:14,代码来源:HorizontalPanel.py

示例9: insert

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def insert(self, widget, beforeIndex):
        widget.removeFromParent()

        tr = DOM.createTR()
        td = DOM.createTD()

        DOM.insertChild(self.getBody(), tr, beforeIndex)
        DOM.appendChild(tr, td)

        CellPanel.insert(self, widget, td, beforeIndex)

        self.setCellHorizontalAlignment(widget, self.horzAlign)
        self.setCellVerticalAlignment(widget, self.vertAlign)
开发者ID:anandology,项目名称:pyjamas,代码行数:15,代码来源:VerticalPanel.py

示例10: addItem

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def addItem(self, item, asHTML=None, popup=None):
        if not hasattr(item, "setSubMenu"):
            item = MenuItem(item, asHTML, popup)

        if self.vertical:
            tr = DOM.createTR()
            DOM.appendChild(self.body, tr)
        else:
            tr = DOM.getChild(self.body, 0)

        DOM.appendChild(tr, item.getElement())

        item.setParentMenu(self)
        item.setSelectionStyle(False)
        self.items.append(item)
        return item
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:18,代码来源:MenuBar.py

示例11: createTR

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
 def createTR(self, styleName) :
     """ Create a new row with a specific style name. The row
         will contain three cells (Left, Center, and Right), each
         prefixed with the specified style name.
      
         This method allows Widgets to reuse the code on a DOM
         level, without creating a DecoratorPanel Widget.
      
         @param styleName the style name
         @return the new row {@link Element}
     """
     trElem = DOM.createTR()
     self.setStyleName(trElem, styleName)
     DOM.appendChild(trElem, self.createTD(styleName + "Left"))
     DOM.appendChild(trElem, self.createTD(styleName + "Center"))
     DOM.appendChild(trElem, self.createTD(styleName + "Right"))
     return trElem
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:19,代码来源:DecoratorPanel.py

示例12: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, text, images=True):
        Widget.__init__(self)
        self.setImageBase(images)

        self.root = DOM.createTable()
        self.tbody = DOM.createTBody()
        self.tr = DOM.createTR()
        self.imageTD = DOM.createTD()
        self.labelTD = DOM.createTD()
        self.imgElem = DOM.createImg()

        self.setElement(self.root)
        DOM.appendChild(self.root, self.tbody)
        DOM.appendChild(self.tbody, self.tr)
        DOM.appendChild(self.tr, self.imageTD)
        DOM.appendChild(self.tr, self.labelTD)
        DOM.appendChild(self.imageTD, self.imgElem)

        self.setText(text)
开发者ID:Afey,项目名称:pyjs,代码行数:21,代码来源:DisclosurePanel.py

示例13: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, text):
        Widget.__init__(self)
        self.imageBase = pygwt.getModuleBaseURL()

        self.root = DOM.createTable()
        self.tbody = DOM.createTBody()
        self.tr = DOM.createTR()
        self.imageTD = DOM.createTD()
        self.labelTD = DOM.createTD()
        self.imgElem = DOM.createImg()

        self.setElement(self.root)
        DOM.appendChild(self.root, self.tbody)
        DOM.appendChild(self.tbody, self.tr)
        DOM.appendChild(self.tr, self.imageTD)
        DOM.appendChild(self.tr, self.labelTD)
        DOM.appendChild(self.imageTD, self.imgElem)

        self.setText(text)
开发者ID:anandology,项目名称:pyjamas,代码行数:21,代码来源:DisclosurePanel.py

示例14: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, **kwargs):

        CellPanel.__init__(self, **kwargs)

        self.tableRow = DOM.createTR()
        DOM.appendChild(self.getBody(), self.tableRow)
开发者ID:anandology,项目名称:pyjamas,代码行数:8,代码来源:HorizontalPanel.py

示例15: __init__

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTR [as 别名]
    def __init__(self, html=None, **ka):
        self.children = []
        self.attached = False
        self.contentPanel = None
        self.itemTable = None
        self.contentElem = None
        self.imgElem = None
        self.childSpanElem = None
        self.open = False
        self.parent = None
        self.selected = False
        self.tree = None
        self.userObject = None

        element = ka.pop('Element', None) or DOM.createDiv()
        self.setElement(element)

        self.itemTable = DOM.createTable()
        self.contentElem = DOM.createSpan()
        self.childSpanElem = DOM.createSpan()
        self.imgElem = DOM.createImg()

        tbody = DOM.createTBody()
        tr = DOM.createTR()
        tdImg = DOM.createTD()
        tdContent = DOM.createTD()
        DOM.appendChild(self.itemTable, tbody)
        DOM.appendChild(tbody, tr)
        DOM.appendChild(tr, tdImg)
        DOM.appendChild(tr, tdContent)
        DOM.setStyleAttribute(tdImg, "verticalAlign", "middle")
        DOM.setStyleAttribute(tdContent, "verticalAlign", "middle")
        DOM.setStyleAttribute(self.getElement(), "cursor", "pointer")

        DOM.appendChild(self.getElement(), self.itemTable)
        DOM.appendChild(self.getElement(), self.childSpanElem)
        DOM.appendChild(tdImg, self.imgElem)
        DOM.appendChild(tdContent, self.contentElem)

        # XXX - can't set pos relative on a div node,
        # or white_space on an HTML Table..
        try:
            DOM.setAttribute(self.getElement(), "position", "relative")
        except:
            pass
        DOM.setStyleAttribute(self.contentElem, "display", "inline")
        DOM.setStyleAttribute(self.getElement(), "whiteSpace", "nowrap")
        try:
            DOM.setAttribute(self.itemTable, "whiteSpace", "nowrap")
        except:
            pass
        DOM.setStyleAttribute(self.childSpanElem, "whiteSpace", "nowrap")
        self.setStyleName(self.contentElem, "gwt-TreeItem", True)

        #if not ka.has_key('StyleName'): ka['StyleName']="gwt-TreeItem"

        if html is not None:
            try:
                # messy. pyjd can do unicode, pyjs can't
                if isinstance(html, unicode):
                    ka['HTML'] = html
                elif isinstance(html, basestring):
                    ka['HTML'] = html
                else:
                    ka['Widget'] = html
            except:
                if isinstance(html, basestring):
                    ka['HTML'] = html
                else:
                    ka['Widget'] = html

        UIObject.__init__(self, **ka)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:74,代码来源:TreeItem.py


注:本文中的pyjamas.DOM.createTR方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。