Tuesday, April 2, 2013

Re: GWT UI widgets auto-alignment inside different Panels proper solution needed.

Why dont you extend the GWT classes and give them your desired default values? E.g. instead of HorizontalPanel you would create a "CenteredContentPanel" that extends HorizontalPanel and sets its own size to 100% along with the desired alignment?

Alternatively you can also look at @UiChild for custom widgets if you want to define some "slots" in your custom widget that you want to fill using UiBinder tags. Using @UiChild you could do something like

<my:CustomWidget>
  <my:leftalignend>
    <g:FlowPanel /> 
  </my:leftaligned>
</my:CustomWidget>

class CustomWidget .. {
  @UiChild
  public void addLeftAligned(Widget w) {
    leftAlignedContainer.add(w);
  }
  ......
}

http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html

Or as already mentioned, create some common CSS and apply the CSS class to the HorizontalPanel.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment