本文整理汇总了Python中pyjamas.ui.TextBox.TextBox.setValue方法的典型用法代码示例。如果您正苦于以下问题:Python TextBox.setValue方法的具体用法?Python TextBox.setValue怎么用?Python TextBox.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.TextBox.TextBox
的用法示例。
在下文中一共展示了TextBox.setValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EventLinkPopup
# 需要导入模块: from pyjamas.ui.TextBox import TextBox [as 别名]
# 或者: from pyjamas.ui.TextBox.TextBox import setValue [as 别名]
class EventLinkPopup(PopupPanel):
def __init__(self, editor):
PopupPanel.__init__(self, glass=True)
self.m_origAnchorStart = None
self.m_origAnchorEnd = None
self.m_origTargetText = ""
self.m_editor = editor
vpanel = VerticalPanel()
vpanel.setWidth("350px")
self.m_webPageText = TextBox()
self.m_webPageText.setText("http:#")
self.m_webPageText.setWidth("320px")
vpanel.add(self.m_webPageText)
lbl = Label("Display:")
self.m_targetText = TextBox()
self.m_targetText.setWidth("100%")
lpanel = HorizontalPanel()
lpanel.add(lbl)
lpanel.add(self.m_targetText)
vpanel.add(lpanel)
self.m_fillOutCB = CheckBox("Change entire link")
self.m_fillOutCB.setVisible(False)
self.m_fillOutCB.addClickListener(self)
vpanel.add(self.m_fillOutCB)
self.m_okBut = Button("Ok", self)
self.m_okBut.addStyleName("float-left")
self.m_cancelBut = Button("Cancel", self)
self.m_cancelBut.addStyleName("float-left")
hpanel = HorizontalPanel()
hpanel.add(self.m_okBut)
hpanel.add(self.m_cancelBut)
vpanel.add(hpanel)
self.add(vpanel)
self.setStyleName("gwt-DialogBox")
def refresh(self):
try:
self.m_editor.getSelection()
self.m_range = self.m_editor.getRange()
if self.m_range is None:
return False
else:
self.m_selTexts = self.m_range.getSelectedTextElements()
if self.m_selTexts is None:
return False
else:
self.m_origTargetText = self.m_range.getText()
self.m_targetText.setText(self.m_origTargetText)
anchor = self.getAnchor(self.m_selTexts)
if anchor is not None:
href = anchor.getHref().strip()
if href:
self.m_webPageText.setText(href)
self.m_origAnchorStart = self.getAnchorLimit(
self.m_range.getStartPoint().getTextNode(),
anchor, False)
self.m_origAnchorEnd = self.getAnchorLimit(
self.m_range.getStartPoint().getTextNode(),
anchor, True)
if self.m_range.getStartPoint().equals(self.m_origAnchorStart) and self.m_range.getStartPoint().equals(self.m_origAnchorEnd):
self.m_origAnchorStart = None
self.m_origAnchorEnd = None
else:
self.m_fillOutCB.setVisible(True)
self.m_fillOutCB.setValue(True)
self.m_origTargetText = self.fetchStringFromTexts(
self.m_origAnchorStart, self.m_origAnchorEnd)
self.m_targetText.setText(self.m_origTargetText)
except:
print "exception"
traceback.print_exc()
return False
return True
#.........这里部分代码省略.........