def createShowcasePanel(self, example): self.showcaseWrapper.clear() sourceLink = Anchor() sourceLink.setHTML(java.str(u"Browse Source: " + java.str(example.getClass().getName())) + u".java ") sourceLink.addStyleName(u"sourceLink") repo = u"http://code.google.com/p/gwt-facebook/source/browse/trunk/GwittIt/src/" className = java.str((u"" + java.str(example.getClass().getName())).replace(u".", u"/")) + u".java" sourceLink.setHref(repo + className) sourceLink.setTarget(u"_blank") self.showcaseWrapper.add(sourceLink) self.showcaseWrapper.add(HTML(u"<hr/>")) self.showcaseWrapper.add(example)
def renderProfiles(self, addContentToPnl, profiles): """ Render profiles in the stream """ addContentToPnl.clear() addContentToPnl.add(HTML(u"<h3>Profiles in Strea</h3>")) for p in Util.iterate(profiles): tmp = FlowPanel() # Split pic on the left, name on the right tmp.addStyleName(u"profiles fbColorLight rounded addSpace") tmp.add(Image(p.getPicSquare())) a = Anchor(p.getName()) # Link to profile a.addStyleName(u"postContent") a.setHref(p.getUrl()) tmp.add(a) addContentToPnl.add(tmp)
def createAttachmentUI(self, attachment): """ Create attachment UI """ p = VerticalPanel() p.addStyleName(u"attachment fbColorLight rounded addSpace") p.add(HTML(u"<h3>Attachment</h3> ")) thumbs = HorizontalPanel() thumbs.setSpacing(10) for m in Util.iterate(attachment.getMedia()): p.add(HTML(u"<b>MediaContent:</b> " + java.str(m.getType()))) if m.getSrc() is not None: thumbs.add(Image(m.getSrc())) if m.getTypeEnum() == Type.video: vLink = Anchor(u"See Video") vLink.setHref(m.getVideo().getSourceUrl()) p.add(vLink) p.add(thumbs) return p