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


Python DOM.getInnerText方法代码示例

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


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

示例1: onDragStart

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def onDragStart(self, event):
     dt = event.dataTransfer
     target = DOM.eventGetTarget(event)
     clientX = event.clientX
     clientY = event.clientY
     absx = clientX + Window.getScrollLeft()
     absy = clientY + Window.getScrollTop()
     package = json.encode({"text": DOM.getInnerText(target),
                            "offsetX": absx - DOM.getAbsoluteLeft(target),
                            "offsetY": absy - DOM.getAbsoluteTop(target)})
     dt.setData('text', package)
     # using "copy" here because Windows Chrome does not like "move"
     dt.allowedEffects = 'copy'
     self.movingWidget = None
     for widget in self.children:
         if target == widget.getElement():
             self.movingWidget = widget
开发者ID:anandology,项目名称:pyjamas,代码行数:19,代码来源:DNDTest.py

示例2: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self, row, column):
     self.checkCellBounds(row, column)
     element = self.cellFormatter.getElement(row, column)
     return DOM.getInnerText(element)
开发者ID:Afey,项目名称:pyjs,代码行数:6,代码来源:HTMLTable.py

示例3: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self):
     return DOM.getInnerText(self.contentElem)
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:4,代码来源:TreeItem.py

示例4: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self):
     return DOM.getInnerText(self.labelElem)
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:CheckBox.py

示例5: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self):
     return DOM.getInnerText(self.getElement())
开发者ID:certik,项目名称:pyjamas,代码行数:4,代码来源:__init__.py

示例6: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self):
     """Gets the face's contents as text."""
     return DOM.getInnerText(self.getFace())
开发者ID:Afey,项目名称:pyjs,代码行数:5,代码来源:CustomButton.py

示例7: getItemText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getItemText(self, index):
     child = DOM.getChild(self.getElement(), index)
     return DOM.getInnerText(child)
开发者ID:Afey,项目名称:pyjs,代码行数:5,代码来源:ListBox.py

示例8: setTemplateText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
    def setTemplateText(self, text):
        """
        Set the template text; if the template is not HTML, a subclass
        could override this to pre-process the text into HTML before
        passing it to the default implementation.
        """
        if self.allowEdit:
            self.originalText = text
        # If we have children, remove them all first since we are
        # trashing their DOM
        for child in List(self.children):
            self.remove(child)

        DOM.setInnerHTML(self.getElement(), text)
        self.elementsById = {}
        self.links = []
        self.metaTags = {}
        self.forms = []
        self.metaTagList = []

        # Make the ids unique and store a pointer to each named element
        for node in DOM.walkChildren(self.getElement()):
            #console.log("Passing node with name %s", node.nodeName)
            if node.nodeName == "META":
                name = node.getAttribute("name")
                content = node.getAttribute("content")
                console.log("Found meta %o name %s content %s",
                            node, name, content)
                self.metaTags[name] = content
                self.metaTagList.append(node)
            elif node.nodeName == "BODY":
                self.body = node
            elif node.nodeName == "TITLE":
                self.title = DOM.getInnerText(node)
            elif node.nodeName == "FORM":
                self.forms.append(node)

            nodeId = DOM.getAttribute(node, "id")
            if nodeId:
                self.elementsById[nodeId] = node
                DOM.setAttribute(node, "id", self.id + ":" + node.id)
            nodeHref = DOM.getAttribute(node, "href")
            if nodeHref:
                self.links.append(node)

        self.loaded = True
        if self.attached:
            self.attachWidgets()
            self.widgetsAttached = True

        if self.allowEdit:
            self.editor = None
            self.editButton = Label("edit "+unescape(self.templateName))
            self.editButton.addStyleName("link")
            self.editButton.addStyleName("ContentPanelEditLink")
            self.editButton.addClickListener(EventDelegate("onClick", self,
                                             self.onEditContentClick))
            ComplexPanel.insert(self, self.editButton, self.getElement(),
                                len(self.children))

        self.notifyLoadListeners()
开发者ID:Afey,项目名称:pyjs,代码行数:63,代码来源:TemplatePanel.py

示例9: getText

# 需要导入模块: from pyjamas import DOM [as 别名]
# 或者: from pyjamas.DOM import getInnerText [as 别名]
 def getText(self):
     return DOM.getInnerText(self.anchorElem)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:4,代码来源:Hyperlink.py


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