1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from pyjamas import DOM
16 from pyjamas import Factory
17
18 from pyjamas.ui.Label import Label
19 from pyjamas.ui import Event
20 from pyjamas.ui.InnerHTML import InnerHTML
21 from pyjamas.ui.Widget import Widget
22
23 -class HTML(Label, InnerHTML):
24
25 _props = [
26 ("wordwrap", "Word Wrap", "WordWrap", None),
27 ("horzAlign", "Horizontal Alignment", "HorizontalAlignment", None),
28 ]
29
30 - def __init__(self, html=None, wordWrap=True, **kwargs):
36
37 @classmethod
40
42 if props.has_key("label"):
43 props['text'] = props['label']
44 del props['label']
45 if not props.has_key("text"):
46 return
47 txt = props["text"]
48 if props.get("html", False):
49 self.setHTML(txt)
50 else:
51 self.setText(txt)
52
53
54 Factory.registerClass('pyjamas.ui.HTML', 'HTML', HTML)
55