Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried using UiBinder? For instance, the following will generate your desired markup. If you wanted to add click handlers to the links, you can specify them as @UiField's in the GamboMenu class.</p> <pre class="lang-java prettyprint-override"><code>public class GamboMenu extends Composite { @UiField LIElement menuOpen; public GamboMenu() { initWidget(uiBinder.createAndBindUi(this)); menuOpen.getStyle().setDisplay(Display.NONE); } GamboMenuUiBinder uiBinder = GWT.create(GamboMenuUiBinder.class); interface GamboMenuUiBinder extends UiBinder&lt;Widget, GamboMenu&gt; { } } </code></pre> <p>And the corresponding UiBinder file:</p> <pre class="lang-html prettyprint-override"><code>&lt;!-- &lt;!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"&gt; --&gt; &lt;ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" &gt; &lt;g:HTMLPanel styleName="topbar"&gt; &lt;div class="container fixed"&gt; &lt;h3&gt;&lt;a href="" class="logo"&gt;test&lt;/a&gt;&lt;/h3&gt; &lt;ul class="nav secondary-nav"&gt; &lt;li ui:field="menuOpen" class="menu open"&gt; &lt;g:InlineHyperlink styleName="menu"&gt;Dropdown&lt;/g:InlineHyperlink&gt; &lt;ul class="menu-dropdown"&gt; &lt;li&gt;&lt;g:InlineHyperlink&gt;Secondary link&lt;/g:InlineHyperlink&gt;&lt;/li&gt; &lt;li&gt;&lt;g:InlineHyperlink&gt;Something else here&lt;/g:InlineHyperlink&gt;&lt;/li&gt; &lt;li class="divider"&gt;&lt;/li&gt; &lt;li&gt;&lt;g:InlineHyperlink&gt;Another link&lt;/g:InlineHyperlink&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/g:HTMLPanel&gt; &lt;/ui:UiBinder&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload