本文整理汇总了Python中pyjamas.ui.VerticalPanel.ensureDebugId方法的典型用法代码示例。如果您正苦于以下问题:Python VerticalPanel.ensureDebugId方法的具体用法?Python VerticalPanel.ensureDebugId怎么用?Python VerticalPanel.ensureDebugId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.VerticalPanel
的用法示例。
在下文中一共展示了VerticalPanel.ensureDebugId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GwittIt
# 需要导入模块: from pyjamas.ui import VerticalPanel [as 别名]
# 或者: from pyjamas.ui.VerticalPanel import ensureDebugId [as 别名]
class GwittIt(Object):
"""
Entry point classes define <code>onModuleLoad()</code>.
"""
@java.init
def __init__(self, *a, **kw):
self.outer = VerticalPanel()
self.topMenu = None
self.apiClient = GWT.create(FacebookApi.__class__)
self.loginBoxPanel = None
self.loginCallback = None
self.waitingText = HTML(u"Waiting for facebook connect status...")
self.userService = GWT.create(UserService.__class__)
# Runs on every localhost port 8080
API_KEY = u"1d81c942b38e2e6b3fc35a147d371ab3"
@java.private
@java.innerclass
@java.implements(AsyncCallbackVoid)
class LogCallback(Object):
"""
Change this if you setup your own app
"""
@java.init
def __init__(self, *a, **kw):
pass
@java.typed(Throwable)
def onFailure(self, caught):
pass
@java.typed(Void)
def onSuccess(self, result):
pass
@java.private
@java.innerclass
@java.implements(AsyncCallbackConnectState)
class RenderAppWhenReadyCallback(Object):
"""
Fired when we know users status
"""
@java.init
def __init__(self, *a, **kw):
pass
@java.typed(Throwable)
def onFailure(self, caught):
Window.alert(u"Failed to get status:" + java.str(caught))
@java.typed(ConnectState)
def onSuccess(self, result):
self.outer.remove(self.waitingText)
if result == ConnectState.connected:
self.renderWhenConnected()
else:
self.renderWhenNotConnected()
@java.private
@java.innerclass
@java.implements(LoginCallback)
class MyLoginCallback(Object):
"""
Fired when user clicks fb login button
"""
@java.init
def __init__(self, *a, **kw):
pass
def onLogin(self):
self.renderWhenConnected()
self.sendNotificationToDeveloper()
self.logUser()
def onModuleLoad(self):
"""
Load Main Module
"""
self.loginCallback = self.MyLoginCallback()
self.topMenu = TopMenu()
self.outer.getElement().setId(u"GwittIt")
self.outer.ensureDebugId(u"GwittIt")
self.waitingText.getElement().setAttribute(u"style", u"color: white; font-weight: bold")
self.outer.add(self.waitingText)
FacebookConnect.init(
self.__class__.API_KEY, u"/xd_receiver.htm", self.loginCallback
) # Set up Facebook Connect
FacebookConnect.waitUntilStatusReady(
self.RenderAppWhenReadyCallback()
) # Wait until we can determine the users status
RootPanel.get().add(self.outer) # Add UI.
#.........这里部分代码省略.........