/** * Copyright 2005-2014 Restlet * * The contents of this file are subject to the terms of one of the following * open source licenses: Apache 2.0 or or EPL 1.0 (the "Licenses"). You can * select the license that you prefer but you may not use this file except in * compliance with one of these Licenses. * * You can obtain a copy of the Apache 2.0 license at * http://www.opensource.org/licenses/apache-2.0 * * You can obtain a copy of the EPL 1.0 license at * http://www.opensource.org/licenses/eclipse-1.0 * * See the Licenses for the specific language governing permissions and * limitations under the Licenses. * * Alternatively, you can obtain a royalty free commercial license with less * limitations, transferable or non-transferable, directly at * http://restlet.com/products/restlet-framework * * Restlet is a registered trademark of Restlet S.A.S. */ package org.restlet.example.book.restlet.ch09.client; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.safehtml.client.SafeHtmlTemplates; import com.google.gwt.safehtml.shared.SafeHtml; import com.google.gwt.safehtml.shared.SafeHtmlUtils; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiBinderUtil; import com.google.gwt.user.client.ui.Widget; public class NavBar_BinderImpl implements UiBinder<com.google.gwt.user.client.ui.Widget, org.restlet.example.book.restlet.ch09.client.NavBar>, org.restlet.example.book.restlet.ch09.client.NavBar.Binder { interface Template extends SafeHtmlTemplates { @Template("< newer") SafeHtml html1(); @Template("older >") SafeHtml html2(); @Template("<span id='{0}'></span> <span id='{1}'></span> <span id='{2}'></span>") SafeHtml html3(String arg0, String arg1, String arg2); } Template template = GWT.create(Template.class); public com.google.gwt.user.client.ui.Widget createAndBindUi(final org.restlet.example.book.restlet.ch09.client.NavBar owner) { org.restlet.example.book.restlet.ch09.client.NavBar_BinderImpl_GenBundle clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay = (org.restlet.example.book.restlet.ch09.client.NavBar_BinderImpl_GenBundle) GWT.create(org.restlet.example.book.restlet.ch09.client.NavBar_BinderImpl_GenBundle.class); org.restlet.example.book.restlet.ch09.client.NavBar_BinderImpl_GenCss_style style = clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style(); java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId(); com.google.gwt.user.client.ui.Anchor newerButton = (com.google.gwt.user.client.ui.Anchor) GWT.create(com.google.gwt.user.client.ui.Anchor.class); com.google.gwt.dom.client.SpanElement countLabel = null; java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId(); java.lang.String domId2 = com.google.gwt.dom.client.Document.get().createUniqueId(); com.google.gwt.user.client.ui.Anchor olderButton = (com.google.gwt.user.client.ui.Anchor) GWT.create(com.google.gwt.user.client.ui.Anchor.class); com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 = new com.google.gwt.user.client.ui.HTMLPanel(template.html3(domId0, domId1, domId2).asString()); newerButton.setHTML(template.html1().asString()); newerButton.setStyleName("" + style.anchor() + ""); newerButton.setHref("javascript:;"); olderButton.setHTML(template.html2().asString()); olderButton.setStyleName("" + style.anchor() + ""); olderButton.setHref("javascript:;"); UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(f_HTMLPanel1.getElement()); com.google.gwt.user.client.Element domId0Element = com.google.gwt.dom.client.Document.get().getElementById(domId0).cast(); countLabel = com.google.gwt.dom.client.Document.get().getElementById(domId1).cast(); countLabel.removeAttribute("id"); com.google.gwt.user.client.Element domId2Element = com.google.gwt.dom.client.Document.get().getElementById(domId2).cast(); attachRecord0.detach(); f_HTMLPanel1.addAndReplaceElement(newerButton, domId0Element); f_HTMLPanel1.addAndReplaceElement(olderButton, domId2Element); final com.google.gwt.event.dom.client.ClickHandler handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1 = new com.google.gwt.event.dom.client.ClickHandler() { public void onClick(com.google.gwt.event.dom.client.ClickEvent event) { owner.onNewerClicked(event); } }; newerButton.addClickHandler(handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1); final com.google.gwt.event.dom.client.ClickHandler handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames2 = new com.google.gwt.event.dom.client.ClickHandler() { public void onClick(com.google.gwt.event.dom.client.ClickEvent event) { owner.onOlderClicked(event); } }; olderButton.addClickHandler(handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames2); owner.countLabel = countLabel; owner.newerButton = newerButton; owner.olderButton = olderButton; clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected(); return f_HTMLPanel1; } }