本文整理汇总了Python中pyjamas.ui.FlexTable.FlexTable类的典型用法代码示例。如果您正苦于以下问题:Python FlexTable类的具体用法?Python FlexTable怎么用?Python FlexTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FlexTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ProblemTab
class ProblemTab(EntityTab):
def __init__(self,app, pid):
global gw
EntityTab.__init__(self, app)
self.table = FlexTable()
self.table.setHTML(0, 0, "<b>Implement me</b>")
self.add("Foo problem "+pid)
示例2: __init__
def __init__(self):
try:
FlexTable.__init__(self)
self.cols = len(self.columns)
self.setVisible(False)
except:
raise
示例3: __init__
def __init__(self):
VerticalPanel.__init__(self, Width="500px", Height="300px")
table = FlexTable()
for i, sentence in enumerate(["The dog is red", "The cat is blue", "The bear is green"]):
table.setWidget(i, 0, CodeSwitchingSentence(sentence))
self.add(table)
示例4: listResults
def listResults(self):
#Window.alert(str(len(self.results)))
row = 0
Entry = FlexTable()
Entry.addStyleName("comments")
for r in self.results:
self.addRow(Entry,r, row)
row = row+1
self.mainPanel.add(Entry)
示例5: __init__
def __init__(self):
try:
FlexTable.__init__(self)
self.cols = len(self.columns)
self.addHeader()
self.addRow()
self.currentRow = self.rows
self.addRow()
self.getWidget(1, 0).setFocus(True)
except:
raise
示例6: __init__
def __init__(self, tokens):
"""
Note that here tokens must be a list of lists
"""
VerticalPanel.__init__(self)
table = FlexTable()
self.bio_widgets = []
for i, token_list in enumerate(tokens):
self.bio_widgets.append(BIOhighlighter(i, token_list))
table.setWidget(i, 0, self.bio_widgets[i])
self.add(table)
示例7: flextable
def flextable(data):
table = FlexTable()
rows = len(data)
columns = len(data[0])
datalist = flatten(data)
columnlist = flatten([range(columns) for x in range(rows)])
rowlist = flatten([[x for y in range(columns)]
for x in range(rows)])
tablelist = zip(rowlist,columnlist,datalist)
for x in tablelist:
table.setText(x[0],x[1],x[2])
table.setBorderWidth(2)
return table
示例8: __init__
def __init__(self, left = 50, top = 50):
DialogBox.__init__(self, modal = False)
self.setPopupPosition(left, top)
self.setText("Preferences")
ftable = FlexTable()
ftableFormatter = ftable.getFlexCellFormatter()
row = 0
try:
self.fileLocation = getCookie("fileLocation")
except:
self.fileLocation = None
row += 1
ftable.setWidget(row, 0, Label("Sheet loaded on startup", wordWrap=False))
self.fileLocationInput = TextBox()
self.fileLocationInput.addChangeListener(self.checkValid)
self.fileLocationInput.addKeyboardListener(self)
self.fileLocationInput.setVisibleLength(30)
self.fileLocationInput.setText(self.fileLocation)
ftable.setWidget(row, 1, self.fileLocationInput)
row += 1
hpanel = HorizontalPanel()
self.saveBtn = Button("Save", self.onSave)
self.saveBtn.setEnabled(False)
hpanel.add(self.saveBtn)
self.cancelBtn = Button("Cancel", self.onCancel)
hpanel.add(self.cancelBtn)
ftable.setWidget(row, 0, hpanel)
ftableFormatter.setColSpan(row, 0, 2)
self.setWidget(ftable)
示例9: __init__
def __init__(self):
VerticalPanel.__init__(self)
table = FlexTable()
sentences = self.get_stimuli()
sentence_widgets = []
self.sentence_set = BIO.BIOSentenceSet(sentences,[x.split() for x in sentences])
table.setWidget(0,0,self.sentence_set)
self.add(table)
示例10: __init__
def __init__(self,sentences,tokens):
"""
Note that here tokens must be a list of lists
"""
VerticalPanel.__init__(self)
options = ["Not Selected","Person","Location","Organization","Date","Time","Money","Percent","Url","Email","Telephone Number","English (Code Switching)"]
table = FlexTable()
self.bio_widgets = []
for i,pair in enumerate(zip(sentences,tokens)):
self.bio_widgets.append(BIOHighlighterDropDown(i,pair[0],pair[1],options))
table.setWidget(i,0,self.bio_widgets[i])
self.add(table)
示例11: __init__
def __init__(self, app):
DialogBox.__init__(self)
self.app = app
self.table=FlexTable()
self.table.setText(0, 0, "Please enter username and password")
self.table.getFlexCellFormatter().setColSpan(0, 0, 2)
self.table.setText(1, 0, "Username")
self.handle = TextBox()
h = getCookie('handle')
self.handle.setText(h)
self.table.setWidget(1, 1, self.handle)
self.table.setText(2, 0, "Password")
self.pwd = PasswordTextBox()
self.table.setWidget(2, 1, self.pwd)
self.table.setHTML(3,0,"")
self.table.getFlexCellFormatter().setColSpan(3, 0, 2)
h = HorizontalPanel()
self.table.setWidget(4,0, h)
self.table.getFlexCellFormatter().setColSpan(4, 0, 2)
h.add(Button("Ok", getattr(self, "onOk")))
h.add(Button("Cancel", getattr(self, "onClose")))
h.setSpacing(4)
self.setHTML("<b>Login</b>")
self.setWidget(self.table)
left = (Window.getClientWidth() - 200) / 2
top = (Window.getClientHeight() - 100) / 2
self.setPopupPosition(left,top)
示例12: __init__
def __init__(self, autoHide=None, modal=True, **kwargs):
# Init section
self.dragging = False
self.dragStartX = 0
self.dragStartY = 0
self.child = None
self.panel = FlexTable(
Height="100%",
BorderWidth="0",
CellPadding="0",
CellSpacing="0",
)
cf = self.panel.getCellFormatter()
cf.setHeight(1, 0, "100%")
cf.setWidth(1, 0, "100%")
cf.setAlignment(
1, 0,
HasHorizontalAlignment.ALIGN_CENTER,
HasVerticalAlignment.ALIGN_MIDDLE,
)
# Arguments section
self.modal = modal
self.caption = HTML()
self.panel.setWidget(0, 0, self.caption)
self.caption.setStyleName("Caption")
self.caption.addMouseListener(self)
# Finalize
kwargs['StyleName'] = kwargs.get('StyleName', "gwt-DialogBox")
PopupPanel.__init__(self, autoHide, modal, **kwargs)
PopupPanel.setWidget(self, self.panel)
示例13: __init__
def __init__(self):
SimplePanel.__init__(self)
self._table = FlexTable(BorderWidth=1, Width="100%")
cellFormatter = self._table.getFlexCellFormatter()
rowFormatter = self._table.getRowFormatter()
self._table.setHTML(0, 0, "<b>Mammals</b>")
self._table.setText(1, 0, "Cow")
self._table.setText(1, 1, "Rat")
self._table.setText(1, 2, "Dog")
cellFormatter.setColSpan(0, 0, 3)
cellFormatter.setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER)
self._table.setWidget(2, 0, Button("Hide", getattr(self, "hideRows")))
self._table.setText(2, 1, "1,1")
self._table.setText(2, 2, "2,1")
self._table.setText(3, 0, "1,2")
self._table.setText(3, 1, "2,2")
cellFormatter.setRowSpan(2, 0, 2)
cellFormatter.setVerticalAlignment(2, 0, HasAlignment.ALIGN_MIDDLE)
self._table.setWidget(4, 0, Button("Show", getattr(self, "showRows")))
cellFormatter.setColSpan(4, 0, 3)
rowFormatter.setVisible(4, False)
self.add(self._table)
示例14: __init__
def __init__(self, **kwargs):
FlexTable.__init__(self, **kwargs)
FocusHandler.__init__(self)
self.buttons = {}
fmt = self.getFlexCellFormatter()
for i, row in enumerate(rows):
for j, letter in enumerate(row):
if letter == ' ':
l = ' '
else:
l = letter
button = Button(l, self, StyleName="kbdbutton")
self.buttons[letter] = button
self.setWidget(i, j, button)
if letter == ' ':
fmt.setColSpan(i, j, 5)
button.addStyleName("kbdbuttonspace")
示例15: __init__
def __init__(self,questions,unique_id):
"""
questions is a list of tuples
the first value is a string repreesnting the question
the second value is a boolean value that represents whether the question is true/false
`
("Are you a native Spanish speaker?",true)
("How old are you",false)
"""
VerticalPanel.__init__(self)
self.unique_id = unique_id
self.answers = []
table = FlexTable()
for i,question in enumerate(questions):
table.setWidget(i,0,HTML(question[0]))
if (question[1] == True):
radio1 = RadioButton("truefalse","Yes")
radio2 = RadioButton("truefalse","No")
self.answers.append((question[0],question[1],(radio1,radio2)))
radiotable = FlexTable()
radiotable.setWidget(0,0,radio1)
radiotable.setWidget(0,1,radio2)
table.setWidget(i,1,radiotable)
else:
textbox = TextBox()
self.answers.append((question[0],question[1],textbox))
table.setWidget(i,1,textbox)
if (not self.is_cookie_set()):
self.add(HTML("<p><strong>Please fill out this quick survey.</strong> (You will only have to do so once)</p>"))
self.add(table)