So let each widget define an interface containing all resources used
to style the widget (messages, images, css-styles, sounds etc.) and
provide some default impls that will be used if no bundle is passed in
to cstr when creating the widget.
The default impl could be provided by the theme module.
Is there a plan to move the constants / messages to ClientBundle as
well? This would help to package all widget resources in one place.
I've posted some more thoughts on this some months/years ago but
cannot find the thread ...
Cheers+thanks for the great work on 2.0!!
Daniel
I think John probably has some ideas here.
> (btw: Why is it called ClientBundle and not ResourceBundle as it
> bundles up different resources...)
To avoid the conflict with java.util.ResourceBundle.
--
Bob Vawter
Google Web Toolkit Team
:-)
/**
* An {@link ImageBundle} that provides images for {@link
AbstractScrollTable}
* .
*/
public static interface Css extends CssResource {
/**
* Widget style name.
*
* @return the widget's style name
*/
@ClassName("gwt-ScrollTable")
String defaultStyleName();
String headerTable();
String dataTable();
String footerTable();
String headerWrapper();
String dataWrapper();
String footerWrapper();
}
/**
* Resources used.
*/
public interface ScrollTableStyle extends ClientBundle {
/**
* The css file.
*/
@Source("com/google/gwt/gen2/widgetbase/public/ScrollTable.css")
@NotStrict
Css css();
/**
* An image used to fill the available width.
*
* @return an image resource of this image
*/
@Source("scrollTableFillWidth.gif")
ImageResource scrollTableFillWidth();
/**
* An image indicating that a column is sorted in ascending order.
*
* @return an image resource of this image
*/
@Source("scrollTableAscending.gif")
ImageResource scrollTableAscending();
/**
* An image indicating a column is sorted in descending order.
*
* @return an image resource of this image
*/
@Source("scrollTableDescending.gif")
ImageResource scrollTableDescending();
@Source("headerBackground.png")
@ImageOptions(repeatStyle = RepeatStyle.Horizontal)
ImageResource headerBackground();
}
public interface ScrollTableMessages extends Messages {
@DefaultMessage("Shrink/Expand to fill visible area")
String shrinkExpandTooltip();
@DefaultMessage("Shows only dates that are equal")
String dateOperatorEqualTooltip();
@DefaultMessage("Shows only dates that not equal")
String dateOperatorUnequalTooltip();
@DefaultMessage("Show only dates before the given date")
String dateOperatorBeforeTooltip();
@DefaultMessage("Show only dates after the given date")
String dateOperatorAfterTooltip();
@DefaultMessage("Show only dates between the given dates")
String dateOperatorBetweenTooltip();
}
public interface ScrollTableResources {
ScrollTableStyle getStyle();
ScrollTableMessages getMessages();
}
On Jan 4, 4:28 pm, Joel Webber <j...@google.com> wrote:
> What John said. There are a few difficult design problems in doing this
> properly -- i.e., with no overhead for those just using plain CSS, nor for
> those using CssResource/ClientBundle "themes". I am confident the problem is
> soluble, though.
>
>
>
> On Mon, Jan 4, 2010 at 10:21 AM, John LaBanca <jlaba...@google.com> wrote:
> > We definitely plan to use ClientBundles to provide default stylings for all
> > widgets, but we haven't really talked about how to go about doing that yet.
> > Ideally, we want to use ClientBundles without breaking apps that are
> > already using the existing CSS style themes.
>
> > We could add ClientBundles to all widgets to serve as a default style, and
> > we can also provide a DeferredBinding to an "Unstyled" ClientBundle for each
> > widget. If a user inherits one of the existing CSS style themes, the
> > Standard/Chrome/Dark.gwt.xml files will inherit the Unstyled deferred
> > binding, thus disabling the ClientBundles for backway compatibility.
>
> > Thanks,
> > John LaBanca
> > jlaba...@google.com
>
> > On Mon, Jan 4, 2010 at 10:04 AM, BobV <b...@google.com> wrote:
You can bridge them with a GwtCreateResource or add a new
ResourceGenerator type to ClientBundle that will make Messages /
Constants a first-class resource type.
On Jan 4, 5:26 pm, John Tamplin <j...@google.com> wrote:
> On Mon, Jan 4, 2010 at 11:24 AM, BobV <b...@google.com> wrote: