本文整理汇总了Python中pyjamas.DOM.createTBody方法的典型用法代码示例。如果您正苦于以下问题:Python DOM.createTBody方法的具体用法?Python DOM.createTBody怎么用?Python DOM.createTBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.DOM
的用法示例。
在下文中一共展示了DOM.createTBody方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, **kwargs):
if not kwargs.has_key('CellFormatter'):
kwargs['CellFormatter'] = CellFormatter(self)
if not kwargs.has_key('RowFormatter'):
kwargs['RowFormatter'] = RowFormatter(self)
self.tableListeners = []
self.dbltableListeners = []
self.widgetMap = {}
if kwargs.has_key('Element'):
self.tableElem = kwargs.pop('Element')
fc = DOM.getFirstChild(self.tableElem)
if fc:
self.bodyElem = fc
else:
self.bodyElem = DOM.createTBody()
DOM.appendChild(self.tableElem, self.bodyElem)
else:
self.tableElem = DOM.createTable()
self.bodyElem = DOM.createTBody()
DOM.appendChild(self.tableElem, self.bodyElem)
self.setElement(self.tableElem)
self.sinkEvents(Event.ONCLICK | Event.ONDBLCLICK)
Panel.__init__(self, **kwargs)
示例2: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, vertical=False, **kwargs):
self.setVertical(kwargs.pop('Vertical', vertical))
if 'StyleName' not in kwargs or kwargs['StyleName'] == 'gwt-MenuBar':
kwargs['StyleName'] = self.getDefaultStyleName()
self.body = None
self.items = []
self.parentMenu = None
self.popup = None
self.selectedItem = None
self.shownChildMenu = None
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)
outer = DOM.createDiv()
DOM.appendChild(outer, table)
self.setElement(outer)
Widget.__init__(self, **kwargs)
示例3: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [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)
示例4: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, **kwargs):
self.body = None
self.visibleStack = -1
self.indices = {}
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)
self.setElement(table)
if not kwargs.has_key('Spacing'): kwargs['Spacing'] = 0
if not kwargs.has_key('Padding'): kwargs['Padding'] = 0
if not kwargs.has_key('StyleName'): kwargs['StyleName'] = "gwt-StackPanel"
DOM.sinkEvents(table, Event.ONCLICK)
ComplexPanel.__init__(self, **kwargs)
示例5: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [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()
示例6: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, rowStyles=None, containerIndex=1, **kwargs):
""" Creates a new panel using the specified style names to
apply to each row. Each row will contain three cells
(Left, Center, and Right). The Center cell in the
containerIndex row will contain the {@link Widget}.
@param rowStyles an array of style names to apply to each row
@param containerIndex the index of the container row
"""
if rowStyles is None:
rowStyles = self.DEFAULT_ROW_STYLENAMES
if kwargs.has_key('Element'):
self.table = kwargs.pop('Element')
fc = DOM.getFirstChild(self.table)
if fc:
self.tbody = fc
else:
self.tbody = DOM.createTBody()
DOM.appendChild(self.table, self.tbody)
else:
# Add a tbody
self.table = DOM.createTable()
self.tbody = DOM.createTBody()
DOM.appendChild(self.table, self.tbody)
DOM.setAttribute(self.table, "cellSpacing", "0")
DOM.setAttribute(self.table, "cellPadding", "0")
if not kwargs.has_key('StyleName'): kwargs['StyleName']=self.DEFAULT_STYLENAME
SimplePanel.__init__(self, self.table, **kwargs)
# Add each row
for i in range(len(rowStyles)):
row = self.createTR(rowStyles[i])
DOM.appendChild(self.tbody, row)
if i == containerIndex:
self.containerElem = DOM.getFirstChild(DOM.getChild(row, 1))
示例7: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, **kwargs):
element = None
if kwargs.has_key('Element'):
element = kwargs.pop('Element')
if element is None:
element = DOM.createTable()
self.table = element
self.setElement(self.table)
self.body = DOM.createTBody()
self.spacing = None
self.padding = None
DOM.appendChild(self.table, self.body)
ComplexPanel.__init__(self, **kwargs)
示例8: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [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)
示例9: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [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)
示例10: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [as 别名]
def __init__(self, **kwargs):
kwargs['Spacing'] = kwargs.get('Spacing', 0)
kwargs['Padding'] = kwargs.get('Padding', 0)
kwargs['HorizontalAlignment'] = kwargs.get('HorizontalAlignment',
HasHorizontalAlignment.ALIGN_LEFT)
kwargs['VerticalAlignment'] = kwargs.get('VerticalAlignment',
HasVerticalAlignment.ALIGN_TOP)
element = kwargs.pop('Element', None) or DOM.createTable()
fc = DOM.getFirstChild(element)
if fc:
self.body = fc
else:
self.body = DOM.createTBody()
self.table = element
self.setElement(self.table)
DOM.appendChild(self.table, self.body)
ComplexPanel.__init__(self, **kwargs)
示例11: __init__
# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import createTBody [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)