當前位置: 首頁>>代碼示例>>Python>>正文


Python History.newItem方法代碼示例

本文整理匯總了Python中pyjamas.History.newItem方法的典型用法代碼示例。如果您正苦於以下問題:Python History.newItem方法的具體用法?Python History.newItem怎麽用?Python History.newItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyjamas.History的用法示例。


在下文中一共展示了History.newItem方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: onBrowserEvent

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 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)
開發者ID:Afey,項目名稱:pyjs,代碼行數:9,代碼來源:Hyperlink.py

示例2: onSelection

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 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())
開發者ID:pombredanne,項目名稱:pygwt-facebook,代碼行數:10,代碼來源:ShowcaseClient.py

示例3: __init__

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
    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)
開發者ID:Afey,項目名稱:pyjs,代碼行數:10,代碼來源:deepLink.py

示例4: new_item

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
    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)
開發者ID:anandology,項目名稱:pyjamas,代碼行數:19,代碼來源:buoy.py

示例5: show

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
    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()
開發者ID:brodybits,項目名稱:pyjs,代碼行數:22,代碼來源:AddonsGallery.py

示例6: show

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
    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()
開發者ID:aprovodi,項目名稱:mlServerCalculations,代碼行數:24,代碼來源:MLAlgorithms.py

示例7: onTabSelected

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 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) 
開發者ID:brodybits,項目名稱:pyjs.org,代碼行數:7,代碼來源:website.py

示例8: doGo

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 def doGo():
     History.newItem('/package/search')
開發者ID:anthonyrisinger,項目名稱:aur-pyjs,代碼行數:4,代碼來源:Search.py

示例9: onBrowserEvent

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 def onBrowserEvent(self, event):
     Widget.onBrowserEvent(self, event)
     if DOM.eventGetType(event) == "click":
         DOM.eventPreventDefault(event)
         History.newItem(self.targetHistoryToken)
開發者ID:FreakTheMighty,項目名稱:pyjamas,代碼行數:7,代碼來源:Hyperlink.py

示例10: setDL

# 需要導入模塊: from pyjamas import History [as 別名]
# 或者: from pyjamas.History import newItem [as 別名]
 def setDL(self):
     History.newItem("pyjamas")
開發者ID:Afey,項目名稱:pyjs,代碼行數:4,代碼來源:deepLink.py


注:本文中的pyjamas.History.newItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。