コード例 #1
0
 def onBrowserEvent(self, event):
     Widget.onBrowserEvent(self, event)
     event_type = DOM.eventGetType(event)
     if event_type == "click":
         DOM.eventPreventDefault(event)
         if self.targetHistoryToken is not None:
             History.newItem(self.targetHistoryToken)
コード例 #2
0
ファイル: deepLink.py プロジェクト: minghuascode/pyj
    def __init__(self):
        HorizontalPanel.__init__(self)

        History.newItem("test")
        show = Button("Show deep link", self.showDL)
        setDL = Button("Set deep link to 'pyjamas'", self.setDL)
        self.add(setDL)
        self.add(show)
コード例 #3
0
 def onSelection(self, event):
     clickedLink = event.getSelectedItem()
     if clickedLink.getChildCount() == 0:
         if not self.apiClient.isSessionValid():
             Window.alert(u"Your session has expired")
             self.showcaseWrapper.clear()
         else:
             History.newItem(clickedLink.getText())
コード例 #4
0
ファイル: deepLink.py プロジェクト: Afey/pyjs
    def __init__(self):
        HorizontalPanel.__init__(self)

        History.newItem("test")
        show = Button("Show deep link", self.showDL)
        setDL = Button("Set deep link to 'pyjamas'", self.setDL)
        self.add(setDL)
        self.add(show)
コード例 #5
0
ファイル: buoy.py プロジェクト: wkornewald/pyjs
    def new_item(self, token):
        '''
        updates the current URL's hash token. 
        disables the calling of BuoyService's onHistoryChanged() when a Buoy adds a new item

        @param token: hash token
        @type token: string

        when an app is placed in a state by user interaction it calls Buoy.drop_anchor()
        which calls BuoyService.new_item(). The subsequent call to History.newItem() will call
        BuoyService.onHistoryChanged() but as the app is already in the correct state
        there is such requirement. So we smoother it by disabling BuoyService's history listener
        until after the new item is added. 
        '''
        self._set_history_listener(False)
        History.newItem(token)
        self._set_history_listener(True)
コード例 #6
0
ファイル: buoy.py プロジェクト: anandology/pyjamas
    def new_item(self, token):
        '''
        updates the current URL's hash token. 
        disables the calling of BuoyService's onHistoryChanged() when a Buoy adds a new item

        @param token: hash token
        @type token: string

        when an app is placed in a state by user interaction it calls Buoy.drop_anchor()
        which calls BuoyService.new_item(). The subsequent call to History.newItem() will call
        BuoyService.onHistoryChanged() but as the app is already in the correct state
        there is such requirement. So we smoother it by disabling BuoyService's history listener
        until after the new item is added. 
        '''
        self._set_history_listener(False)
        History.newItem(token)
        self._set_history_listener(True)
コード例 #7
0
ファイル: AddonsGallery.py プロジェクト: brodybits/pyjs
    def show(self, info, affectHistory=None):
        if info == self.curInfo: return
        self.curInfo = info

        if self.curSink <> None:
            self.curSink.onHide()
            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()
コード例 #8
0
    def show(self, info, affectHistory=None):
        if info == self.curInfo: return
        self.curInfo = info

        if self.curSink <> None:
            self.curSink.onHide()
            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()
コード例 #9
0
    def show(self, info, affectHistory):
        if info == self.curInfo: return
        self.curInfo = info

        log.writebr("showing " + info.getName())
        if self.curAlgorithm is not None:
            log.writebr("removing " + str(self.curAlgorithm))
            self.curAlgorithm.onHide()
            self.AlgorithmContainer.remove(self.curAlgorithm)

        self.curAlgorithm = info.getInstance()
        self.Algorithm_list.setAlgorithmSelection(info.getName())
        self.description.setHTML(info.getDescription())

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

        self.AlgorithmContainer.add(self.curAlgorithm, DockPanel.CENTER)
        self.AlgorithmContainer.setCellWidth(self.curAlgorithm, "100%")
        self.AlgorithmContainer.setCellHeight(self.curAlgorithm, "100%")
        self.AlgorithmContainer.setCellVerticalAlignment(self.curAlgorithm, HasAlignment.ALIGN_TOP)
        self.curAlgorithm.onShow()
コード例 #10
0
    def show(self, info, affectHistory):
        if info == self.curInfo: return
        self.curInfo = info

        log.writebr("showing " + info.getName())
        if self.curAlgorithm is not None:
            log.writebr("removing " + str(self.curAlgorithm))
            self.curAlgorithm.onHide()
            self.AlgorithmContainer.remove(self.curAlgorithm)

        self.curAlgorithm = info.getInstance()
        self.Algorithm_list.setAlgorithmSelection(info.getName())
        self.description.setHTML(info.getDescription())

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

        self.AlgorithmContainer.add(self.curAlgorithm, DockPanel.CENTER)
        self.AlgorithmContainer.setCellWidth(self.curAlgorithm, "100%")
        self.AlgorithmContainer.setCellHeight(self.curAlgorithm, "100%")
        self.AlgorithmContainer.setCellVerticalAlignment(
            self.curAlgorithm, HasAlignment.ALIGN_TOP)
        self.curAlgorithm.onShow()
コード例 #11
0
ファイル: website.py プロジェクト: wkornewald/pyjs
 def onTabSelected(self, sender, tabIndex):
     History.newItem(self.page_list[tabIndex][0])
コード例 #12
0
ファイル: deepLink.py プロジェクト: minghuascode/pyj
 def setDL(self):
     History.newItem("pyjamas")
コード例 #13
0
ファイル: Hyperlink.py プロジェクト: pombredanne/pyjamas
 def onBrowserEvent(self, event):
     Widget.onBrowserEvent(self, event)
     if DOM.eventGetType(event) == "click":
         DOM.eventPreventDefault(event)
         History.newItem(self.targetHistoryToken)
コード例 #14
0
ファイル: Hyperlink.py プロジェクト: FreakTheMighty/pyjamas
 def onBrowserEvent(self, event):
     Widget.onBrowserEvent(self, event)
     if DOM.eventGetType(event) == "click":
         DOM.eventPreventDefault(event)
         History.newItem(self.targetHistoryToken)
コード例 #15
0
ファイル: website.py プロジェクト: minghuascode/pyj
 def onTabSelected(self, sender, tabIndex):
     current_token = History.getToken()
     new_token = self.page_list[tabIndex][0]
     if current_token != new_token:
         History.newItem(new_token) 
コード例 #16
0
ファイル: Search.py プロジェクト: anthonyrisinger/aur-pyjs
 def doGo():
     History.newItem('/package/search')
コード例 #17
0
ファイル: deepLink.py プロジェクト: Afey/pyjs
 def setDL(self):
     History.newItem("pyjamas")