uibinder

Use ClientBundle image as background-image

半城伤御伤魂 提交于 2019-12-03 12:21:30
I'm trying to use an image from a ClientBundle as a background-image in a UIBInder template. I used this discussion as a guide, but was unable to get it to work. In my Java class I have: public static interface PriceButtonStyles extends ClientBundle { String paidIcon(); @ClientBundle.Source("paid_button_53x31.png") DataResource paid_buttonAsDataResource(); } @UiField PriceButtonStyles priceButtonStyle; And then in the corresponding template file I reference it like: <ui:style field="priceButtonStyle" type="com.example.client.PriceButton.PriceButtonStyles"> @url paidIconUrl paid

Defining GWT CellTables with UiBinder

两盒软妹~` 提交于 2019-12-03 12:20:25
If I define my CellTable in MyView.ui.xml UiBinder file like this: <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:c="urn:import:com.google.gwt.user.cellview.client" ui:generateFormat='com.google.gwt.i18n.rebind.format.PropertiesFormat' ui:generateKeys='com.google.gwt.i18n.rebind.keygen.MD5KeyGenerator' ui:generateLocales='default' xmlns:p1="urn:import:com.google.gwt.user.cellview.client"> ... <g:HTMLPanel> <c:CellTable addStyleNames='{style.cellTable}' pageSize='15' ui:field='cellTable' width="100%"> </c:CellTable> </g:HTMLPanel>

Add id to field with ui:field declaration

爱⌒轻易说出口 提交于 2019-12-03 12:03:47
问题 I'm trying to declare these elements in my UiBinder XML: <label for="lastName">Last Name:</label> <input type="text" id="lastName" ui:field="lastNameField" maxlength="150" /> Simply put, a label that is associated with a text input. When I try to compile, however, I get this error: [ERROR] Cannot declare id="lastName" and ui:field="lastNameField" on the same element Element (:23) This seems like an idiotic restriction, especially since ui:field doesn't generate an ID. The only solution I've

How to create a gwt composite component with children using uibinder?

拈花ヽ惹草 提交于 2019-12-03 11:23:49
问题 I would like to create a component to decorate its children, such as: mycomponent.ui.xml: <g:FlowPanel addStyleNames="myStyle"> <!-- how can i render children ? --> </g:FlowPanel> and then others can use: <myapp:mycomponent> <g:Label>Decorated child</g:Label> </myapp:mycomponent> How can i render the children in uibinder? (or in Java, if i must) 回答1: Let MyComponent implement the HasWidgets interface for adding/removing child widgets. The MyComponent.ui.xml looks as simple as <g:FlowPanel ui

Need app-wide CSS constants in GWT

给你一囗甜甜゛ 提交于 2019-12-03 09:45:32
问题 I'd like to define some colours as constants in a GWT CssResource, and use those constants throughout my application; but I don't know how to do that. I'll tell you what what I've tried. I've created a ClientBundle and a CssResource as follows: public interface Resources extends ClientBundle { public interface MyStyle extends CssResource { String JUNGLEGREEN(); String example(); ... } @Source("Resources.css") MyStyle css(); } I've defined some constants in Resources.css: @def JUNGLEGREEN

How to create a gwt composite component with children using uibinder?

一个人想着一个人 提交于 2019-12-03 01:47:16
I would like to create a component to decorate its children, such as: mycomponent.ui.xml: <g:FlowPanel addStyleNames="myStyle"> <!-- how can i render children ? --> </g:FlowPanel> and then others can use: <myapp:mycomponent> <g:Label>Decorated child</g:Label> </myapp:mycomponent> How can i render the children in uibinder? (or in Java, if i must) Let MyComponent implement the HasWidgets interface for adding/removing child widgets. The MyComponent.ui.xml looks as simple as <g:FlowPanel ui:field="main" /> while you delegate the methods specified ind HasWidgets to the FlowPanel : public class

Need app-wide CSS constants in GWT

只谈情不闲聊 提交于 2019-12-03 00:19:09
I'd like to define some colours as constants in a GWT CssResource, and use those constants throughout my application; but I don't know how to do that. I'll tell you what what I've tried. I've created a ClientBundle and a CssResource as follows: public interface Resources extends ClientBundle { public interface MyStyle extends CssResource { String JUNGLEGREEN(); String example(); ... } @Source("Resources.css") MyStyle css(); } I've defined some constants in Resources.css: @def JUNGLEGREEN #1F3D0A; Within Resources.css, I use those constants like so: .example { color:JUNGLEGREEN; } I'm not aware

Want to Implement 'Mark as Read' feature in GWT Cell List

断了今生、忘了曾经 提交于 2019-12-02 09:15:54
I want to implement this example of celllist with one modification. I want to make each row to a grey color once its clicked by someone. It should persist there, and not change as the user clicks on another row. It's okay if its gone once a new server call is made. I'm doing this to mark it as a 'read message' for the user. Any clues? I overrided (updated) the css style of cellList as below but when I inspect I dont see the 'myCss' style being applied . CellListStyles.css @external .dataView-cellListWidget; @external .dataView-cellListEvenItem; @external .dataView-cellListOddItem; @external

Custom attributes in UiBinder widgets

青春壹個敷衍的年華 提交于 2019-11-30 14:47:20
问题 I'm using GWT and UiBinder for my app, and I'm trying to do this <g:TextBox ui:field="searchBox" styleName="{style.searchBox}" placeholder="search" /> But the custom placeholder attribute won't work because there isn't a setPlaceholder method on TextBox - I need to this: searchBox.getElement().setAttribute("placeholder", "search"); back in the java code. Any ideas on how to do this in UiBinder itself? I suppose I could change it over to a normal input element and try to grab a reference and

GWT: UiBinder or GWT Designer?

自作多情 提交于 2019-11-30 13:01:39
问题 I have my first GWT project that I created using UiBinder (GWT 2.0 way) which I found to be easier than write my UI creation Java source code (GWT 1.0 way). But I saw this thing called GWT Designer that Google are releasing for free. It has nice features and wizards which were missing with the standard Google Eclipse Plugin. I like it, but I still think that using UiBinder is better. I think GWT Designer will be really useful when it can help you write UiBinder XML files (GWT 2.0 way), and