def onModuleLoad(self):
        self.curInfo=''
        self.curSink=None
        self.description=HTML()
        self.sink_list=SinkList()
        self.panel=DockPanel()
        
        self.loadSinks()
        self.sinkContainer = DockPanel()
        self.sinkContainer.setStyleName("ks-Sink")

        vp=VerticalPanel()
        vp.setWidth("100%")
        vp.add(self.description)
        vp.add(self.sinkContainer)

        self.description.setStyleName("ks-Info")

        self.panel.add(self.sink_list, DockPanel.WEST)
        self.panel.add(vp, DockPanel.CENTER)

        self.panel.setCellVerticalAlignment(self.sink_list, HasAlignment.ALIGN_TOP)
        self.panel.setCellWidth(vp, "100%")

        History().addHistoryListener(self)
        RootPanel().add(self.panel)
        #RootPanel().add(Logger())

        #Show the initial screen.
        initToken = History().getToken()
        if len(initToken):
            self.onHistoryChanged(initToken)
        else:
			self.showInfo()
 def __init__(self, owner):
     Composite.__init__(self)
     self.owner = owner
     self.bar = DockPanel()
     self.gotoFirst = Button("<<", self)
     self.gotoNext = Button(">", self)
     self.gotoPrev = Button("<", self)
     self.status = HTML()
     
     self.initWidget(self.bar)
     self.bar.setStyleName("navbar")
     self.status.setStyleName("status")
     
     buttons = HorizontalPanel()
     buttons.add(self.gotoFirst)
     buttons.add(self.gotoPrev)
     buttons.add(self.gotoNext)
     self.bar.add(buttons, DockPanel.EAST)
     self.bar.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT)
     self.bar.add(self.status, DockPanel.CENTER)
     self.bar.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
     self.bar.setCellHorizontalAlignment(self.status, HasAlignment.ALIGN_RIGHT)
     self.bar.setCellVerticalAlignment(self.status, HasAlignment.ALIGN_MIDDLE)
     self.bar.setCellWidth(self.status, "100%")
     
     self.gotoPrev.setEnabled(False)
     self.gotoFirst.setEnabled(False)
    def onModuleLoad(self):
        self.panel=DockPanel()
        
        east = Label("east")
        self.panel.add(east, DockPanel.EAST)
        self.panel.add(Label("west"), DockPanel.WEST)
        self.panel.add(Label("north"), DockPanel.NORTH)
        self.panel.add(Label("south"), DockPanel.SOUTH)
        self.south2 = Label("south2")
        self.panel.add(self.south2, DockPanel.SOUTH)
        self.center = Label("center")
        self.panel.add(self.center, DockPanel.CENTER)

        self.panel.setWidth("300px")
        self.panel.setHeight("300px")

        self.panel.setBorderWidth("1px")

        self.panel.setCellVerticalAlignment(east, HasAlignment.ALIGN_BOTTOM)
        self.panel.setCellHorizontalAlignment(east, HasAlignment.ALIGN_RIGHT)


        self.r = Button("remove", self)
        self.a = Button("add", self)

        RootPanel().add(self.panel)
        RootPanel().add(self.r)
        RootPanel().add(self.a)
class DynaTableWidget(Composite):

    def __init__(self, provider, columns, columnStyles, rowCount):
        Composite.__init__(self)
    
        self.acceptor = RowDataAcceptorImpl(self)
        self.outer = DockPanel()
        self.startRow = 0
        self.grid = Grid()
        self.navbar = NavBar(self)
        
        self.provider = provider
        self.initWidget(self.outer)
        self.grid.setStyleName("table")
        self.outer.add(self.navbar, DockPanel.NORTH)
        self.outer.add(self.grid, DockPanel.CENTER)
        self.initTable(columns, columnStyles, rowCount)
        self.setStyleName("DynaTable-DynaTableWidget")
        
    def initTable(self, columns, columnStyles, rowCount):
        self.grid.resize(rowCount + 1, len(columns))
        for i in range(len(columns)):
            self.grid.setText(0, i, columns[i])
            if columnStyles:
                self.grid.cellFormatter.setStyleName(0, i, columnStyles[i] + "header")

    def setStatusText(self, text):
        self.navbar.status.setText(text)
        
    def clearStatusText(self, text):
        self.navbar.status.setHTML(" ")
        
    def refresh(self):
        self.navbar.gotoFirst.setEnabled(False)
        self.navbar.gotoPrev.setEnabled(False)
        self.navbar.gotoNext.setEnabled(False)
        
        self.setStatusText("Please wait...")
        self.provider.updateRowData(self.startRow, self.grid.getRowCount() - 1, self.acceptor)
        
    def setRowCount(self, rows):
        self.grid.resizeRows(rows)
        
    def getDataRowCount(self):
        return self.grid.getRowCount() - 1
Beispiel #5
0
    def __init__(self):
        Sink.__init__(self)
        self.curImage=0
        self.image=Image()
        self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
        self.nextButton = Image(self.baseURL() + "rembrandt/forward.gif")
        self.prevButton = Image(self.baseURL() + "rembrandt/back.gif")
        self.sImages=["rembrandt/JohannesElison.jpg", "rembrandt/LaMarcheNocturne.jpg", "rembrandt/SelfPortrait1628.jpg", "rembrandt/SelfPortrait1640.jpg", "rembrandt/TheArtistInHisStudio.jpg", "rembrandt/TheReturnOfTheProdigalSon.jpg"]

        for i in range(len(self.sImages)):
            self.sImages[i]=self.baseURL() + self.sImages[i]
        
        self.image.addLoadListener(self)
        self.prevButton.addClickListener(self)
        self.nextButton.addClickListener(self)
        
        topPanel = DockPanel()
        topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        topPanel.add(self.prevButton, DockPanel.WEST)
        topPanel.add(self.nextButton, DockPanel.EAST)
        topPanel.add(self.loadingImage, DockPanel.CENTER)
        
        panel = VerticalPanel()
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.add(HTML("<h2>A Bit of Rembrandt</h2>", True))
        panel.add(topPanel)
        panel.add(self.image)
        
        panel.setWidth("100%")
        self.initWidget(panel)
        self.image.setStyleName("ks-images-Image")
        self.nextButton.setStyleName("ks-images-Button")
        self.prevButton.setStyleName("ks-images-Button")
        
        self.loadImage(0)           
 def __init__(self, provider, columns, columnStyles, rowCount):
     Composite.__init__(self)
 
     self.acceptor = RowDataAcceptorImpl(self)
     self.outer = DockPanel()
     self.startRow = 0
     self.grid = Grid()
     self.navbar = NavBar(self)
     
     self.provider = provider
     self.initWidget(self.outer)
     self.grid.setStyleName("table")
     self.outer.add(self.navbar, DockPanel.NORTH)
     self.outer.add(self.grid, DockPanel.CENTER)
     self.initTable(columns, columnStyles, rowCount)
     self.setStyleName("DynaTable-DynaTableWidget")
    def __init__(self, classes, class_content):
        Composite.__init__(self)
        self.class_content = class_content

        t = Trees(self, classes)
        clspan = DockPanel()
        clspan.setWidth("100%%")
        self.clstext = HTML()
        txtscroll = ScrollPanel(self.clstext)
        clsscroll = ScrollPanel(t)
        clspan.add(clsscroll, DockPanel.WEST)
        clspan.add(txtscroll, DockPanel.EAST)
        clspan.setCellWidth(txtscroll, "100%%")
        clspan.setCellWidth(clsscroll, "260px")
        t.setWidth("250px")
        title = bigtitle('Classes')
        self.initWidget(section(title, 'classes', clspan))

        self.clspan = clspan
        self.txtscroll = txtscroll
        self.clsscroll = clsscroll
        self.t = t
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>Timer</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Timer</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Timer.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Timer.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('Timer'),
]

        class_content = {
'Timer': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Timer">class <strong>Timer</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Timer-__init__"><strong>__init__</strong></a>(self, time, notify)</dt></dl>

<dl><dt><a name="Timer-cancel"><strong>cancel</strong></a>(self)</dt></dl>

<dl><dt><a name="Timer-getID"><strong>getID</strong></a>(self)</dt></dl>

<dl><dt><a name="Timer-notify"><strong>notify</strong></a>(self, *args)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')


        functions = ['<dl><dt><a name="-timeout_add"><strong>timeout_add</strong></a>(...)</dt></dl>\n']
        title = bigtitle('Functions')
        contents = section(title, 'functions', HTML('\n'.join(functions)))
        tp.add(contents, 'Functions')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>DeferredCommand</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>DeferredCommand</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/DeferredCommand.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/DeferredCommand.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('DeferredCommand'),
]

        class_content = {
'DeferredCommand': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="DeferredCommand">class <strong>DeferredCommand</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="DeferredCommand-add"><strong>add</strong></a>(self, cmd)</dt></dl>

<dl><dt><a name="DeferredCommand-flushDeferredCommands"><strong>flushDeferredCommands</strong></a>(self)</dt></dl>

<dl><dt><a name="DeferredCommand-maybeSetDeferredCommandTimer"><strong>maybeSetDeferredCommandTimer</strong></a>(self)</dt></dl>

<dl><dt><a name="DeferredCommand-onTimer"><strong>onTimer</strong></a>(self, sender)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')


        data = [r'''<strong>deferredCommands</strong> = []''',r'''<strong>timerIsActive</strong> = False''']
        title = bigtitle('Data')
        contents = section(title, 'data', HTML('\n'.join(data)))
        tp.add(contents, 'Data')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>History</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>History</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/History.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/History.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('History'),
]

        class_content = {
'History': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="History">class <strong>History</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Simple&nbsp;<a href="#History">History</a>&nbsp;management&nbsp;class&nbsp;for&nbsp;back/forward&nbsp;button&nbsp;support.<br>
&nbsp;<br>
This&nbsp;class&nbsp;allows&nbsp;your&nbsp;AJAX&nbsp;application&nbsp;to&nbsp;use&nbsp;a&nbsp;history.&nbsp;&nbsp;Each&nbsp;time&nbsp;you<br>
call&nbsp;<a href="#History-newItem">newItem</a>(),&nbsp;a&nbsp;new&nbsp;item&nbsp;is&nbsp;added&nbsp;to&nbsp;the&nbsp;history&nbsp;and&nbsp;the&nbsp;history<br>
listeners&nbsp;are&nbsp;notified.&nbsp;&nbsp;If&nbsp;the&nbsp;user&nbsp;clicks&nbsp;the&nbsp;browser's&nbsp;forward&nbsp;or&nbsp;back&nbsp;<br>
buttons,&nbsp;the&nbsp;appropriate&nbsp;item&nbsp;(a&nbsp;string&nbsp;passed&nbsp;to&nbsp;newItem)&nbsp;is&nbsp;fetched<br>
from&nbsp;the&nbsp;history&nbsp;and&nbsp;the&nbsp;history&nbsp;listeners&nbsp;are&nbsp;notified.<br>
&nbsp;<br>
The&nbsp;address&nbsp;bar&nbsp;of&nbsp;the&nbsp;browser&nbsp;contains&nbsp;the&nbsp;current&nbsp;token,&nbsp;using&nbsp;<br>
the&nbsp;"#"&nbsp;seperator&nbsp;(for&nbsp;implementation&nbsp;reasons,&nbsp;not&nbsp;because&nbsp;we&nbsp;love&nbsp;<br>
the&nbsp;#&nbsp;mark).<br>
&nbsp;<br>
You&nbsp;may&nbsp;want&nbsp;to&nbsp;check&nbsp;whether&nbsp;the&nbsp;hash&nbsp;already&nbsp;contains&nbsp;a&nbsp;history<br>
token&nbsp;when&nbsp;the&nbsp;page&nbsp;loads&nbsp;and&nbsp;use&nbsp;that&nbsp;to&nbsp;show&nbsp;appropriate&nbsp;content;<br>
this&nbsp;allows&nbsp;users&nbsp;of&nbsp;the&nbsp;site&nbsp;to&nbsp;store&nbsp;direct&nbsp;links&nbsp;in&nbsp;their<br>
bookmarks&nbsp;or&nbsp;send&nbsp;them&nbsp;in&nbsp;emails.<br>
&nbsp;<br>
To&nbsp;make&nbsp;this&nbsp;work&nbsp;properly&nbsp;in&nbsp;all&nbsp;browsers,&nbsp;you&nbsp;must&nbsp;add&nbsp;a&nbsp;specially<br>
named&nbsp;iframe&nbsp;to&nbsp;your&nbsp;html&nbsp;page,&nbsp;like&nbsp;this:<br>
&nbsp;<br>
&lt;iframe&nbsp;id='__pygwt_historyFrame'&nbsp;style='width:0;height:0;border:0'&gt;&lt;/iframe&gt;<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="History-addHistoryListener"><strong>addHistoryListener</strong></a>(self, listener)</dt></dl>

<dl><dt><a name="History-back"><strong>back</strong></a>(self)</dt></dl>

<dl><dt><a name="History-fireHistoryChangedAndCatch"><strong>fireHistoryChangedAndCatch</strong></a>(self)</dt><dd><tt>#&nbsp;TODO</tt></dd></dl>

<dl><dt><a name="History-fireHistoryChangedImpl"><strong>fireHistoryChangedImpl</strong></a>(self, historyToken)</dt></dl>

<dl><dt><a name="History-forward"><strong>forward</strong></a>(self)</dt></dl>

<dl><dt><a name="History-getToken"><strong>getToken</strong></a>(self)</dt></dl>

<dl><dt><a name="History-newItem"><strong>newItem</strong></a>(self, historyToken)</dt></dl>

<dl><dt><a name="History-onHistoryChanged"><strong>onHistoryChanged</strong></a>(self, historyToken)</dt><dd><tt>#&nbsp;TODO&nbsp;-&nbsp;fireHistoryChangedAndCatch&nbsp;not&nbsp;implemented</tt></dd></dl>

<dl><dt><a name="History-removeHistoryListener"><strong>removeHistoryListener</strong></a>(self, listener)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')


        functions = ['<dl><dt><a name="-init"><strong>init</strong></a>()</dt></dl>\n']
        title = bigtitle('Functions')
        contents = section(title, 'functions', HTML('\n'.join(functions)))
        tp.add(contents, 'Functions')


        data = [r'''<strong>historyListeners</strong> = []''',r'''<strong>historyToken</strong> = ''''']
        title = bigtitle('Data')
        contents = section(title, 'data', HTML('\n'.join(data)))
        tp.add(contents, 'Data')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>Location</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Location</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Location.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/Location.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        modules = [r'''<a href="docpyjslib.html">pyjslib</a>''']
        contents = self.multicolumn(modules)
        title = bigtitle('Modules')
        contents = section(title, 'module', contents)
        tp.add(contents, 'Modules')


        classes = [
Proto('Location'),
]

        class_content = {
'Location': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Location">class <strong>Location</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Retrieve&nbsp;this&nbsp;class&nbsp;by&nbsp;calling&nbsp;Window.getLocation().<br>
&nbsp;<br>
This&nbsp;provides&nbsp;a&nbsp;pyjs&nbsp;wrapper&nbsp;for&nbsp;the&nbsp;current&nbsp;location,<br>
with&nbsp;some&nbsp;utility&nbsp;methods&nbsp;for&nbsp;convenience.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Location-__init__"><strong>__init__</strong></a>(self, location)</dt></dl>

<dl><dt><a name="Location-getHash"><strong>getHash</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHashDict"><strong>getHashDict</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHost"><strong>getHost</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHostname"><strong>getHostname</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getHref"><strong>getHref</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getPageHref"><strong>getPageHref</strong></a>(self)</dt><dd><tt>Return&nbsp;href&nbsp;with&nbsp;any&nbsp;search&nbsp;or&nbsp;hash&nbsp;stripped</tt></dd></dl>

<dl><dt><a name="Location-getPathname"><strong>getPathname</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getPort"><strong>getPort</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getProtocol"><strong>getProtocol</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearch"><strong>getSearch</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearchDict"><strong>getSearchDict</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-getSearchVar"><strong>getSearchVar</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Location-reload"><strong>reload</strong></a>(self)</dt></dl>

<dl><dt><a name="Location-setHash"><strong>setHash</strong></a>(self, hash)</dt></dl>

<dl><dt><a name="Location-setHashDict"><strong>setHashDict</strong></a>(self, hashDict)</dt></dl>

<dl><dt><a name="Location-setHref"><strong>setHref</strong></a>(self, href)</dt></dl>

<dl><dt><a name="Location-setSearch"><strong>setSearch</strong></a>(self, search)</dt></dl>

<dl><dt><a name="Location-setSearchDict"><strong>setSearchDict</strong></a>(self, searchDict)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')


        functions = ['<dl><dt><a name="-makeUrlDict"><strong>makeUrlDict</strong></a>(s)</dt></dl>\n', '<dl><dt><a name="-makeUrlStringFromDict"><strong>makeUrlStringFromDict</strong></a>(d)</dt></dl>\n']
        title = bigtitle('Functions')
        contents = section(title, 'functions', HTML('\n'.join(functions)))
        tp.add(contents, 'Functions')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        # panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML("<h1>HTTPRequest</h1>")
        description = HTML("""""")
        # panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML(
            """
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>HTTPRequest</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/HTTPRequest.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/HTTPRequest.py</a></font></td></tr></table>
    """
        )
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        # panel.setCellHeight(tp, "100%")

        modules = [r"""<a href="docpyjamas.Cookies.html">pyjamas.Cookies</a>""", r"""<a href="docsys.html">sys</a>"""]
        contents = self.multicolumn(modules)
        title = bigtitle("Modules")
        contents = section(title, "module", contents)
        tp.add(contents, "Modules")

        classes = [Proto("HTTPRequest")]

        class_content = {
            "HTTPRequest": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="HTTPRequest">class <strong>HTTPRequest</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="HTTPRequest-asyncGet"><strong>asyncGet</strong></a>(self, user, pwd, url, handler)</dt><dd><tt>#&nbsp;also&nbsp;callable&nbsp;as:&nbsp;<a href="#HTTPRequest-asyncGet">asyncGet</a>(self,&nbsp;url,&nbsp;handler)</tt></dd></dl>

<dl><dt><a name="HTTPRequest-asyncGetImpl"><strong>asyncGetImpl</strong></a>(self, user, pwd, url, handler)</dt></dl>

<dl><dt><a name="HTTPRequest-asyncPost"><strong>asyncPost</strong></a>(self, user, pwd, url, postData<font color="#909090">=None</font>, handler<font color="#909090">=None</font>)</dt><dd><tt>#&nbsp;also&nbsp;callable&nbsp;as:&nbsp;<a href="#HTTPRequest-asyncPost">asyncPost</a>(self,&nbsp;url,&nbsp;postData,&nbsp;handler)</tt></dd></dl>

<dl><dt><a name="HTTPRequest-asyncPostImpl"><strong>asyncPostImpl</strong></a>(self, user, pwd, url, postData, handler)</dt></dl>

<dl><dt><a name="HTTPRequest-createXmlHTTPRequest"><strong>createXmlHTTPRequest</strong></a>(self)</dt></dl>

<dl><dt><a name="HTTPRequest-doCreateXmlHTTPRequest"><strong>doCreateXmlHTTPRequest</strong></a>(self)</dt></dl>

<dl><dt><a name="HTTPRequest-onReadyStateChange"><strong>onReadyStateChange</strong></a>(self, xmlHttp, event, ignorearg)</dt></dl>

</td></tr></table>"""
        }

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, "Classes")

        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        # panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML("<h1>pyjslib</h1>")
        description = HTML("""""")
        # panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML(
            """
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>pyjslib</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/pyjslib.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/pyjslib.py</a></font></td></tr></table>
    """
        )
        panel.add(head, DockPanel.NORTH)

        docs = HTML(
            """<tt>#&nbsp;Copyright&nbsp;2006&nbsp;James&nbsp;Tauber&nbsp;and&nbsp;contributors<br>
#<br>
#&nbsp;Licensed&nbsp;under&nbsp;the&nbsp;Apache&nbsp;License,&nbsp;Version&nbsp;2.0&nbsp;(the&nbsp;"License");<br>
#&nbsp;you&nbsp;may&nbsp;not&nbsp;use&nbsp;this&nbsp;file&nbsp;except&nbsp;in&nbsp;compliance&nbsp;with&nbsp;the&nbsp;License.<br>
#&nbsp;You&nbsp;may&nbsp;obtain&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;License&nbsp;at<br>
#<br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><br>
#<br>
#&nbsp;Unless&nbsp;required&nbsp;by&nbsp;applicable&nbsp;law&nbsp;or&nbsp;agreed&nbsp;to&nbsp;in&nbsp;writing,&nbsp;software<br>
#&nbsp;distributed&nbsp;under&nbsp;the&nbsp;License&nbsp;is&nbsp;distributed&nbsp;on&nbsp;an&nbsp;"AS&nbsp;IS"&nbsp;BASIS,<br>
#&nbsp;WITHOUT&nbsp;WARRANTIES&nbsp;OR&nbsp;CONDITIONS&nbsp;OF&nbsp;ANY&nbsp;KIND,&nbsp;either&nbsp;express&nbsp;or&nbsp;implied.<br>
#&nbsp;See&nbsp;the&nbsp;License&nbsp;for&nbsp;the&nbsp;specific&nbsp;language&nbsp;governing&nbsp;permissions&nbsp;and<br>
#&nbsp;limitations&nbsp;under&nbsp;the&nbsp;License.</tt>"""
        )
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        # panel.setCellHeight(tp, "100%")

        classes = [Proto("Class"), Proto("Dict"), Proto("List", [Proto("Tuple"), Proto("Tuple")]), Proto("Object")]

        class_content = {
            "Tuple": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Tuple">class <strong>Tuple</strong></a>(<a href="docpyjslib.html#List">List</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Tuple-__init__"><strong>__init__</strong></a>(self, data)</dt></dl>

<hr>
Methods inherited from <a href="docpyjslib.html#List">List</a>:<br>
<dl><dt><a name="Tuple-__contains__"><strong>__contains__</strong></a>(self, value)</dt></dl>

<dl><dt><a name="Tuple-__delitem__"><strong>__delitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="Tuple-__getitem__"><strong>__getitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="Tuple-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="Tuple-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="Tuple-__setitem__"><strong>__setitem__</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="Tuple-append"><strong>append</strong></a>(self, item)</dt></dl>

<dl><dt><a name="Tuple-getArray"><strong>getArray</strong></a>(self)</dt><dd><tt>Access&nbsp;the&nbsp;javascript&nbsp;Array&nbsp;that&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;this&nbsp;<a href="#list">list</a></tt></dd></dl>

<dl><dt><a name="Tuple-index"><strong>index</strong></a>(self, value, start<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="Tuple-insert"><strong>insert</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="Tuple-pop"><strong>pop</strong></a>(self, index<font color="#909090">=-1</font>)</dt></dl>

<dl><dt><a name="Tuple-remove"><strong>remove</strong></a>(self, value)</dt></dl>

<dl><dt><a name="Tuple-slice"><strong>slice</strong></a>(self, lower, upper)</dt></dl>

<dl><dt><a name="Tuple-sort"><strong>sort</strong></a>(self, compareFunc<font color="#909090">=None</font>, keyFunc<font color="#909090">=None</font>, reverse<font color="#909090">=False</font>)</dt></dl>

</td></tr></table>""",
            "list": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><strong>list</strong> = <a name="list">class List</a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="List-__contains__"><strong>__contains__</strong></a>(self, value)</dt></dl>

<dl><dt><a name="List-__delitem__"><strong>__delitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="List-__getitem__"><strong>__getitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="List-__init__"><strong>__init__</strong></a>(self, data<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="List-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="List-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="List-__setitem__"><strong>__setitem__</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="List-append"><strong>append</strong></a>(self, item)</dt></dl>

<dl><dt><a name="List-getArray"><strong>getArray</strong></a>(self)</dt><dd><tt>Access&nbsp;the&nbsp;javascript&nbsp;Array&nbsp;that&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;this&nbsp;<a href="#list">list</a></tt></dd></dl>

<dl><dt><a name="List-index"><strong>index</strong></a>(self, value, start<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="List-insert"><strong>insert</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="List-pop"><strong>pop</strong></a>(self, index<font color="#909090">=-1</font>)</dt></dl>

<dl><dt><a name="List-remove"><strong>remove</strong></a>(self, value)</dt></dl>

<dl><dt><a name="List-slice"><strong>slice</strong></a>(self, lower, upper)</dt></dl>

<dl><dt><a name="List-sort"><strong>sort</strong></a>(self, compareFunc<font color="#909090">=None</font>, keyFunc<font color="#909090">=None</font>, reverse<font color="#909090">=False</font>)</dt></dl>

</td></tr></table>""",
            "Object": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Object">class <strong>Object</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"></td></tr></table>""",
            "List": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="List">class <strong>List</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="List-__contains__"><strong>__contains__</strong></a>(self, value)</dt></dl>

<dl><dt><a name="List-__delitem__"><strong>__delitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="List-__getitem__"><strong>__getitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="List-__init__"><strong>__init__</strong></a>(self, data<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="List-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="List-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="List-__setitem__"><strong>__setitem__</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="List-append"><strong>append</strong></a>(self, item)</dt></dl>

<dl><dt><a name="List-getArray"><strong>getArray</strong></a>(self)</dt><dd><tt>Access&nbsp;the&nbsp;javascript&nbsp;Array&nbsp;that&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;this&nbsp;<a href="#list">list</a></tt></dd></dl>

<dl><dt><a name="List-index"><strong>index</strong></a>(self, value, start<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="List-insert"><strong>insert</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="List-pop"><strong>pop</strong></a>(self, index<font color="#909090">=-1</font>)</dt></dl>

<dl><dt><a name="List-remove"><strong>remove</strong></a>(self, value)</dt></dl>

<dl><dt><a name="List-slice"><strong>slice</strong></a>(self, lower, upper)</dt></dl>

<dl><dt><a name="List-sort"><strong>sort</strong></a>(self, compareFunc<font color="#909090">=None</font>, keyFunc<font color="#909090">=None</font>, reverse<font color="#909090">=False</font>)</dt></dl>

</td></tr></table>""",
            "tuple": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><strong>tuple</strong> = <a name="tuple">class Tuple</a>(<a href="docpyjslib.html#List">List</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Tuple-__init__"><strong>__init__</strong></a>(self, data)</dt></dl>

<hr>
Methods inherited from <a href="docpyjslib.html#List">List</a>:<br>
<dl><dt><a name="Tuple-__contains__"><strong>__contains__</strong></a>(self, value)</dt></dl>

<dl><dt><a name="Tuple-__delitem__"><strong>__delitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="Tuple-__getitem__"><strong>__getitem__</strong></a>(self, index)</dt></dl>

<dl><dt><a name="Tuple-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="Tuple-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="Tuple-__setitem__"><strong>__setitem__</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="Tuple-append"><strong>append</strong></a>(self, item)</dt></dl>

<dl><dt><a name="Tuple-getArray"><strong>getArray</strong></a>(self)</dt><dd><tt>Access&nbsp;the&nbsp;javascript&nbsp;Array&nbsp;that&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;this&nbsp;<a href="#list">list</a></tt></dd></dl>

<dl><dt><a name="Tuple-index"><strong>index</strong></a>(self, value, start<font color="#909090">=0</font>)</dt></dl>

<dl><dt><a name="Tuple-insert"><strong>insert</strong></a>(self, index, value)</dt></dl>

<dl><dt><a name="Tuple-pop"><strong>pop</strong></a>(self, index<font color="#909090">=-1</font>)</dt></dl>

<dl><dt><a name="Tuple-remove"><strong>remove</strong></a>(self, value)</dt></dl>

<dl><dt><a name="Tuple-slice"><strong>slice</strong></a>(self, lower, upper)</dt></dl>

<dl><dt><a name="Tuple-sort"><strong>sort</strong></a>(self, compareFunc<font color="#909090">=None</font>, keyFunc<font color="#909090">=None</font>, reverse<font color="#909090">=False</font>)</dt></dl>

</td></tr></table>""",
            "dict": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><strong>dict</strong> = <a name="dict">class Dict</a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Dict-__contains__"><strong>__contains__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__delitem__"><strong>__delitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__init__"><strong>__init__</strong></a>(self, data<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Dict-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>

<dl><dt><a name="Dict-get"><strong>get</strong></a>(self, key, default_value<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Dict-getObject"><strong>getObject</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;javascript&nbsp;<a href="#Object">Object</a>&nbsp;which&nbsp;this&nbsp;class&nbsp;uses&nbsp;to&nbsp;store&nbsp;dictionary&nbsp;keys&nbsp;and&nbsp;values</tt></dd></dl>

<dl><dt><a name="Dict-has_key"><strong>has_key</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-iteritems"><strong>iteritems</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-iterkeys"><strong>iterkeys</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-itervalues"><strong>itervalues</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-keys"><strong>keys</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-setdefault"><strong>setdefault</strong></a>(self, key, default_value)</dt></dl>

<dl><dt><a name="Dict-update"><strong>update</strong></a>(self, d)</dt></dl>

<dl><dt><a name="Dict-values"><strong>values</strong></a>(self)</dt></dl>

</td></tr></table>""",
            "Dict": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Dict">class <strong>Dict</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Dict-__contains__"><strong>__contains__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__delitem__"><strong>__delitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-__init__"><strong>__init__</strong></a>(self, data<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Dict-__iter__"><strong>__iter__</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-__len__"><strong>__len__</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>

<dl><dt><a name="Dict-get"><strong>get</strong></a>(self, key, default_value<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="Dict-getObject"><strong>getObject</strong></a>(self)</dt><dd><tt>Return&nbsp;the&nbsp;javascript&nbsp;<a href="#Object">Object</a>&nbsp;which&nbsp;this&nbsp;class&nbsp;uses&nbsp;to&nbsp;store&nbsp;dictionary&nbsp;keys&nbsp;and&nbsp;values</tt></dd></dl>

<dl><dt><a name="Dict-has_key"><strong>has_key</strong></a>(self, key)</dt></dl>

<dl><dt><a name="Dict-iteritems"><strong>iteritems</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-iterkeys"><strong>iterkeys</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-itervalues"><strong>itervalues</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-keys"><strong>keys</strong></a>(self)</dt></dl>

<dl><dt><a name="Dict-setdefault"><strong>setdefault</strong></a>(self, key, default_value)</dt></dl>

<dl><dt><a name="Dict-update"><strong>update</strong></a>(self, d)</dt></dl>

<dl><dt><a name="Dict-values"><strong>values</strong></a>(self)</dt></dl>

</td></tr></table>""",
            "Class": r"""<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Class">class <strong>Class</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Class-__init__"><strong>__init__</strong></a>(self, name)</dt></dl>

<dl><dt><a name="Class-__str___"><strong>__str___</strong></a>(self)</dt></dl>

</td></tr></table>""",
        }

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, "Classes")

        functions = [
            '<dl><dt><a name="-cmp"><strong>cmp</strong></a>(a, b)</dt></dl>\n',
            '<dl><dt><a name="-dir"><strong>dir</strong></a>(obj)</dt></dl>\n',
            '<dl><dt><a name="-filter"><strong>filter</strong></a>(obj, method, sequence<font color="#909090">=None</font>)</dt></dl>\n',
            '<dl><dt><a name="-getattr"><strong>getattr</strong></a>(obj, method)</dt></dl>\n',
            '<dl><dt><a name="-hasattr"><strong>hasattr</strong></a>(obj, method)</dt></dl>\n',
            '<dl><dt><a name="-hash"><strong>hash</strong></a>(obj)</dt></dl>\n',
            '<dl><dt><a name="-isArray"><strong>isArray</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isFunction"><strong>isFunction</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isIteratable"><strong>isIteratable</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isNull"><strong>isNull</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isNumber"><strong>isNumber</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isObject"><strong>isObject</strong></a>(a)</dt><dd><tt>#&nbsp;type&nbsp;functions&nbsp;from&nbsp;Douglas&nbsp;Crockford\'s&nbsp;Remedial&nbsp;Javascript:&nbsp;<a href="http://www.crockford.com/javascript/remedial.html">http://www.crockford.com/javascript/remedial.html</a></tt></dd></dl>\n',
            '<dl><dt><a name="-isString"><strong>isString</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-isUndefined"><strong>isUndefined</strong></a>(a)</dt></dl>\n',
            '<dl><dt><a name="-len"><strong>len</strong></a>(object)</dt></dl>\n',
            '<dl><dt><a name="-map"><strong>map</strong></a>(obj, method, sequence<font color="#909090">=None</font>)</dt></dl>\n',
            '<dl><dt><a name="-printFunc"><strong>printFunc</strong></a>(objs)</dt></dl>\n',
            '<dl><dt><a name="-range"><strong>range</strong></a>()</dt><dd><tt>#&nbsp;taken&nbsp;from&nbsp;mochikit:&nbsp;<a href="#-range">range</a>(&nbsp;[start,]&nbsp;stop[,&nbsp;step]&nbsp;)</tt></dd></dl>\n',
            '<dl><dt><a name="-slice"><strong>slice</strong></a>(object, lower, upper)</dt></dl>\n',
            '<dl><dt><a name="-toJSObjects"><strong>toJSObjects</strong></a>(x)</dt><dd><tt>Convert&nbsp;the&nbsp;pyjs&nbsp;pythonic&nbsp;<a href="#List">List</a>&nbsp;and&nbsp;<a href="#Dict">Dict</a>&nbsp;objects&nbsp;into&nbsp;javascript&nbsp;<a href="#Object">Object</a>&nbsp;and&nbsp;Array<br>\nobjects,&nbsp;recursively.</tt></dd></dl>\n',
        ]
        title = bigtitle("Functions")
        contents = section(title, "functions", HTML("\n".join(functions)))
        tp.add(contents, "Functions")

        data = [r"""<strong>next_hash_id</strong> = 0"""]
        title = bigtitle("Data")
        contents = section(title, "data", HTML("\n".join(data)))
        tp.add(contents, "Data")

        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
Beispiel #14
0
    def onModuleLoad(self):
        panel = DockPanel()
        RootPanel().add(panel)

        panel.setWidth("100%")
        panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>Hello</h1>')
        description = HTML("""""")
        panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.SOUTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Hello</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/examples/helloworld/Hello.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/examples/helloworld/Hello.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""<tt><a href="#Hello">Hello</a>&nbsp;World&nbsp;Example</tt>""")
        panel.add(docs, DockPanel.NORTH)


        modules = eval(r'''['<a href="pyjamas.DOM.html">pyjamas.DOM</a>', '<a href="pyjamas.Window.html">pyjamas.Window</a>']''')
        contents = self.multicolumn(modules)
        contents = self.bigsection('Modules', '#fffff', '#aa55cc', contents)

        panel.add(contents, DockPanel.NORTH)

        classes = eval(r'''['<dl>\n<dt><font face="helvetica, arial"><a href="Hello.html#Hello">Hello</a>\n</font></dt></dl>\n', '<p>\n<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">\n<tr bgcolor="#ffc8d8">\n<td colspan=3 valign=bottom>&nbsp;<br>\n<font color="#000000" face="helvetica, arial"><a name="Hello">class <strong>Hello</strong></a></font></td></tr>\n    \n<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>\n<td width="100%">Methods defined here:<br>\n<dl><dt><a name="Hello-onBrowserEvent"><strong>onBrowserEvent</strong></a>(self, event)</dt></dl>\n\n<dl><dt><a name="Hello-onModuleLoad"><strong>onModuleLoad</strong></a>(self)</dt></dl>\n\n<dl><dt><a name="Hello-onTimer"><strong>onTimer</strong></a>(self)</dt></dl>\n\n<dl><dt><a name="Hello-onWindowResized"><strong>onWindowResized</strong></a>(self, width, height)</dt></dl>\n\n</td></tr></table>']''')
        contents = self.multicolumn(modules)
        contents = self.bigsection(
                'Classes', '#ffffff', '#ee77aa', HTML('\n'.join(classes)))

        panel.add(contents, DockPanel.NORTH)

        functions = eval(r'''['<dl><dt><a name="-greet"><strong>greet</strong></a>(sender, event)</dt></dl>\n']''')
        contents = self.multicolumn(modules)
        contents = self.bigsection(
                'Functions', '#ffffff', '#eeaa77', HTML('\n'.join(functions)))

        panel.add(contents, DockPanel.NORTH)

        data = eval(r'''["<strong>test</strong> = 'hello'"]''')
        contents = self.multicolumn(modules)
        contents = self.bigsection(
                'Data', '#ffffff', '#55aa55', HTML('\n'.join(data)))

        panel.add(contents, DockPanel.NORTH)
  def __init__(self):
      DialogBox.__init__(self)
      # Use this opportunity to set the dialog's caption.
      self.setText("About the Mail Sample")

      # Create a DockPanel to contain the 'about' label and the 'OK' button.
      outer = DockPanel()
      outer.setSpacing(4)
      
      outer.add(Image(AboutDialog.LOGO_IMAGE), DockPanel.WEST)

      # Create the 'OK' button, along with a listener that hides the dialog
      # when the button is clicked. Adding it to the 'south' position within
      # the dock causes it to be placed at the bottom.
      buttonPanel = HorizontalPanel()
      buttonPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
      buttonPanel.add(Button("Close", self))
      outer.add(buttonPanel, DockPanel.SOUTH)

      # Create the 'about' label. Placing it in the 'rest' position within the
      # dock causes it to take up any remaining space after the 'OK' button
      # has been laid out.

      textplain =  "This sample application demonstrates the construction "
      textplain += "of a complex user interface using pyjamas' built-in widgets.  Have a look "
      textplain += "at the code to see how easy it is to build your own apps!"
      text = HTML(textplain)
      text.setStyleName("mail-AboutText")
      outer.add(text, DockPanel.CENTER)

      # Add a bit of spacing and margin to the dock to keep the components from
      # being placed too closely together.
      outer.setSpacing(8)

      self.setWidget(outer)
Beispiel #16
0
    def __init__(self):
        Sink.__init__(self)
        text="This is a <code>ScrollPanel</code> contained at "
        text+= "the center of a <code>DockPanel</code>.  "
        text+= "By putting some fairly large contents "
        text+= "in the middle and setting its size explicitly, it becomes a "
        text+= "scrollable area within the page, but without requiring the use of "
        text+= "an IFRAME."
        text+= "Here's quite a bit more meaningless text that will serve primarily "
        text+= "to make this thing scroll off the bottom of its visible area.  "
        text+= "Otherwise, you might have to make it really, really small in order "
        text+= "to see the nifty scroll bars!"
        
        contents = HTML(text)
        scroller = ScrollPanel(contents)
        scroller.setStyleName("ks-layouts-Scroller")
        
        dock = DockPanel()
        dock.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        north0 = HTML("This is the <i>first</i> north component", True)
        east = HTML("<center>This<br>is<br>the<br>east<br>component</center>", True)
        south = HTML("This is the south component")
        west = HTML("<center>This<br>is<br>the<br>west<br>component</center>", True)
        north1 = HTML("This is the <b>second</b> north component", True)
        dock.add(north0, DockPanel.NORTH)
        dock.add(east, DockPanel.EAST)
        dock.add(south, DockPanel.SOUTH)
        dock.add(west, DockPanel.WEST)
        dock.add(north1, DockPanel.NORTH)
        dock.add(scroller, DockPanel.CENTER)
        
        #Logger.write("Layouts", "TODO: flowpanel")
        flow = FlowPanel()
        for i in range(8):
            flow.add(CheckBox("Flow %d" % i))

        horz = HorizontalPanel()
        horz.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        horz.add(Button("Button"))
        horz.add(HTML("<center>This is a<br>very<br>tall thing</center>", True))
        horz.add(Button("Button"))

        vert = VerticalPanel()
        vert.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        vert.add(Button("Small"))
        vert.add(Button("--- BigBigBigBig ---"))
        vert.add(Button("tiny"))

        menu = MenuBar()
        menu0 = MenuBar(True)
        menu1 = MenuBar(True)
        menu.addItem("menu0", menu0)
        menu.addItem("menu1", menu1)
        menu0.addItem("child00")
        menu0.addItem("child01")
        menu0.addItem("child02")
        menu1.addItem("child10")
        menu1.addItem("child11")
        menu1.addItem("child12")

        #Logger.write("Layouts", "TODO: htmlpanel")
        id = HTMLPanel_createUniqueId()
        text="This is an <code>HTMLPanel</code>.  It allows you to add "
        text+="components inside existing HTML, like this:" + "<span id='" + id
        text+="'></span>" + "Notice how the menu just fits snugly in there?  Cute."
        html = HTMLPanel(text)
        
        #DOM.setStyleAttribute(menu.getElement(), "display", "inline")
        html.add(menu, id)

        panel = VerticalPanel()
        panel.setSpacing(8)
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        
        panel.add(self.makeLabel("Dock Panel"))
        panel.add(dock)
        panel.add(self.makeLabel("Flow Panel"))
        panel.add(flow)
        panel.add(self.makeLabel("Horizontal Panel"))
        panel.add(horz)
        panel.add(self.makeLabel("Vertical Panel"))
        panel.add(vert)
        panel.add(self.makeLabel("HTML Panel"))
        panel.add(html)
        
        self.initWidget(panel)
        self.setStyleName("ks-layouts")
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>EventDelegate</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>EventDelegate</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/EventDelegate.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/EventDelegate.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('EventDelegate'),
]

        class_content = {
'EventDelegate': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="EventDelegate">class <strong>EventDelegate</strong></a></font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Create&nbsp;the&nbsp;equivalent&nbsp;of&nbsp;a&nbsp;bound&nbsp;method.&nbsp;&nbsp;This&nbsp;also&nbsp;prepends&nbsp;extra&nbsp;<br>
args,&nbsp;if&nbsp;any,&nbsp;to&nbsp;the&nbsp;called&nbsp;method's&nbsp;argument&nbsp;list&nbsp;when&nbsp;it&nbsp;calls&nbsp;it.<br>
&nbsp;<br>
Pass&nbsp;the&nbsp;method&nbsp;name&nbsp;you&nbsp;want&nbsp;to&nbsp;implement&nbsp;(javascript&nbsp;doesn't<br>
support&nbsp;callables).<br>
&nbsp;<br>
@type&nbsp;args:&nbsp;list<br>
@param&nbsp;args:&nbsp;If&nbsp;given,&nbsp;the&nbsp;arguments&nbsp;will&nbsp;be&nbsp;prepended&nbsp;to&nbsp;the&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;arguments&nbsp;passed&nbsp;to&nbsp;the&nbsp;event&nbsp;callback<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="EventDelegate-__init__"><strong>__init__</strong></a>(self, eventMethodName, obj, method, *args)</dt></dl>

<dl><dt><a name="EventDelegate-onEvent"><strong>onEvent</strong></a>(self, *args)</dt></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
    def onModuleLoad(self):

        Window.addWindowResizeListener(self)

        panel = DockPanel()
        RootPanel().add(panel)
        self.panel = panel

        panel.setWidth("100%")
        #panel.setHeight("100%")
        panel.setSpacing(5)

        title = HTML('<h1>JSONParser</h1>')
        description = HTML("""""")
        #panel.add(title, DockPanel.NORTH)
        panel.add(description, DockPanel.NORTH)

        links = VerticalPanel()
        links.setSpacing(8)

        panel.add(links, DockPanel.NORTH)

        head = HTML("""
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>JSONParser</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/JSONParser.py">/home/lkcl/src/pyjamas-desktop/pyjamas-webkit/pyjamas/JSONParser.py</a></font></td></tr></table>
    """)
        panel.add(head, DockPanel.NORTH)

        docs = HTML("""<tt>This&nbsp;module&nbsp;contains&nbsp;a&nbsp;JSON&nbsp;Parser&nbsp;class<br>
&nbsp;<br>
JSONEncode:<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PYGWT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Python&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;JSON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+===============+===================+===============+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_Dict&nbsp;&nbsp;|&nbsp;dict&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_List&nbsp;&nbsp;|&nbsp;list,&nbsp;tuple&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;array&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;str,&nbsp;unicode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;int,&nbsp;long,&nbsp;float&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;False&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+---------------+<br>
&nbsp;<br>
&nbsp;<br>
JSONDecode:<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;JSON&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;Python&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;PYGWT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+===============+===================+==============+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;object&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;dict&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_Dict&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;array&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;list&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;pyjslib_List&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;unicode&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;(int)&nbsp;&nbsp;|&nbsp;int,&nbsp;long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;(real)&nbsp;|&nbsp;float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;False&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+<br>
&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br>
&nbsp;&nbsp;&nbsp;&nbsp;+---------------+-------------------+--------------+</tt>""")
        panel.add(docs, DockPanel.NORTH)

        tp = TabPanel()
        tp.setWidth("100%")
        self.tp = tp
        panel.add(tp, DockPanel.SOUTH)
        #panel.setCellHeight(tp, "100%")


        classes = [
Proto('JSONParser'),
]

        class_content = {
'JSONParser': r'''<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSONParser">class <strong>JSONParser</strong></a></font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="JSONParser-decode"><strong>decode</strong></a>(self, str)</dt></dl>

<dl><dt><a name="JSONParser-decodeAsObject"><strong>decodeAsObject</strong></a>(self, str)</dt></dl>

<dl><dt><a name="JSONParser-encode"><strong>encode</strong></a>(self, obj)</dt></dl>

<dl><dt><a name="JSONParser-jsObjectToPy"><strong>jsObjectToPy</strong></a>(self, obj)</dt></dl>

<dl><dt><a name="JSONParser-jsObjectToPyObject"><strong>jsObjectToPyObject</strong></a>(self, obj)</dt><dd><tt>#&nbsp;TODO:&nbsp;__init__&nbsp;parameters</tt></dd></dl>

<dl><dt><a name="JSONParser-parseJSON"><strong>parseJSON</strong></a>(self, str)</dt></dl>

<dl><dt><a name="JSONParser-toJSONString"><strong>toJSONString</strong></a>(self, obj)</dt><dd><tt>#&nbsp;modified&nbsp;to&nbsp;detect&nbsp;__pyjslib_List&nbsp;&amp;&nbsp;__pyjslib_Dict</tt></dd></dl>

</td></tr></table>''',
}

        self.class_doc = ClassDoc(classes, class_content)
        tp.add(self.class_doc, 'Classes')



        tp.addTabListener(self)
        tp.selectTab(0)

        # Call the window resized handler to get the initial sizes setup. Doing
        # this in a deferred command causes it to occur after all widgets' sizes
        # have been computed by the browser.

        DeferredCommand().add(self)
Beispiel #19
0
 def __init__(self):
     DialogBox.__init__(self)
     self.setText("Sample DialogBox with embedded Frame")
     
     iframe = Frame(Popups().baseURL() + "rembrandt/LaMarcheNocturne.html")
     closeButton = Button("Close", self)
     msg = HTML("<center>This is an example of a standard dialog box component.<br>  You can put pretty much anything you like into it,<br>such as the following IFRAME:</center>", True)
     
     dock = DockPanel()
     dock.setSpacing(4)
     
     dock.add(closeButton, DockPanel.SOUTH)
     dock.add(msg, DockPanel.NORTH)
     dock.add(iframe, DockPanel.CENTER)
     
     dock.setCellHorizontalAlignment(closeButton, HasAlignment.ALIGN_RIGHT)
     dock.setCellWidth(iframe, "100%")
     dock.setWidth("100%")
     iframe.setWidth("36em")
     iframe.setHeight("20em")
     self.setWidget(dock)
    def __init__(self):
        Composite.__init__(self)
        panel = VerticalPanel()
        headerPanel = VerticalPanel()
        self.subject = HTML()
        self.sender = HTML()
        self.recipient = HTML()
        self.body = HTML()
        self.scroller = ScrollPanel(self.body)

        self.body.setWordWrap(True)

        headerPanel.add(self.subject)
        headerPanel.add(self.sender)
        headerPanel.add(self.recipient)
        headerPanel.setWidth("100%")

        innerPanel = DockPanel()
        innerPanel.add(headerPanel, DockPanel.NORTH)
        innerPanel.add(self.scroller, DockPanel.CENTER)

        innerPanel.setCellHeight(self.scroller, "100%")
        panel.add(innerPanel)
        innerPanel.setSize("100%", "100%")
        self.scroller.setSize("100%", "100%")
        self.initWidget(panel)

        self.setStyleName("mail-Detail")
        headerPanel.setStyleName("mail-DetailHeader")
        innerPanel.setStyleName("mail-DetailInner")
        self.subject.setStyleName("mail-DetailSubject")
        self.sender.setStyleName("mail-DetailSender")
        self.recipient.setStyleName("mail-DetailRecipient")
        self.body.setStyleName("mail-DetailBody")
class KitchenSink:

    def onHistoryChanged(self, token):
        print "history changed", token
        info = self.sink_list.find(token)
        if info:
            self.show(info, False)
        else:
            self.showInfo()

    def onModuleLoad(self):
        self.curInfo=''
        self.curSink=None
        self.description=HTML()
        self.sink_list=SinkList()
        self.panel=DockPanel()
        
        self.loadSinks()
        self.sinkContainer = DockPanel()
        self.sinkContainer.setStyleName("ks-Sink")

        vp=VerticalPanel()
        vp.setWidth("100%")
        vp.add(self.description)
        vp.add(self.sinkContainer)

        self.description.setStyleName("ks-Info")

        self.panel.add(self.sink_list, DockPanel.WEST)
        self.panel.add(vp, DockPanel.CENTER)

        self.panel.setCellVerticalAlignment(self.sink_list, HasAlignment.ALIGN_TOP)
        self.panel.setCellWidth(vp, "100%")

        History().addHistoryListener(self)
        RootPanel().add(self.panel)
        #RootPanel().add(Logger())

        #Show the initial screen.
        initToken = History().getToken()
        if len(initToken):
            self.onHistoryChanged(initToken)
        else:
			self.showInfo()

    def show(self, info, affectHistory):
        if info == self.curInfo: return
        self.curInfo = info

        #Logger().write("", "showing " + info.getName())
        if self.curSink <> None:
            self.curSink.onHide()
            #Logger().write("", "removing " + self.curSink)
            self.sinkContainer.remove(self.curSink)

        self.curSink = info.getInstance()
        self.sink_list.setSinkSelection(info.getName())
        self.description.setHTML(info.getDescription())

        if (affectHistory):
            History().newItem(info.getName())

        self.sinkContainer.add(self.curSink, DockPanel.CENTER)
        self.sinkContainer.setCellWidth(self.curSink, "100%")
        self.sinkContainer.setCellHeight(self.curSink, "100%")
        self.sinkContainer.setCellVerticalAlignment(self.curSink, HasAlignment.ALIGN_TOP)
        self.curSink.onShow()
        
    def loadSinks(self):
        self.sink_list.addSink(Info.init())
        self.sink_list.addSink(Buttons.init())
        self.sink_list.addSink(Menus.init())
        self.sink_list.addSink(Images.init())
        self.sink_list.addSink(Layouts.init())
        self.sink_list.addSink(Lists.init())
        self.sink_list.addSink(Popups.init())
        self.sink_list.addSink(Tables.init())
        self.sink_list.addSink(Text.init())
        self.sink_list.addSink(Trees.init())
        self.sink_list.addSink(Frames.init())
        self.sink_list.addSink(Tabs.init())

    def showInfo(self):
        self.show(self.sink_list.find("Info"), False)
class NavBar(Composite):

    def __init__(self, owner):
        Composite.__init__(self)
        self.owner = owner
        self.bar = DockPanel()
        self.gotoFirst = Button("&lt;&lt;", self)
        self.gotoNext = Button("&gt;", self)
        self.gotoPrev = Button("&lt;", self)
        self.status = HTML()
        
        self.initWidget(self.bar)
        self.bar.setStyleName("navbar")
        self.status.setStyleName("status")
        
        buttons = HorizontalPanel()
        buttons.add(self.gotoFirst)
        buttons.add(self.gotoPrev)
        buttons.add(self.gotoNext)
        self.bar.add(buttons, DockPanel.EAST)
        self.bar.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT)
        self.bar.add(self.status, DockPanel.CENTER)
        self.bar.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellHorizontalAlignment(self.status, HasAlignment.ALIGN_RIGHT)
        self.bar.setCellVerticalAlignment(self.status, HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellWidth(self.status, "100%")
        
        self.gotoPrev.setEnabled(False)
        self.gotoFirst.setEnabled(False)
        
    def onClick(self, sender):
        if sender == self.gotoNext:
            self.owner.startRow += self.owner.getDataRowCount()
            self.owner.refresh()
        elif sender == self.gotoPrev:
            self.owner.startRow -= self.owner.getDataRowCount()
            if self.owner.startRow < 0:
                self.owner.startRow = 0
            self.owner.refresh()
        elif sender == self.gotoFirst:
            self.owner.startRow = 0
            self.owner.refresh()