#152: Ensure at least one ColumnSize must be set

Ensures at least one ColumnSize must be set, both during construction and with setters. Had to remove constructor with the Widget varargs constructor as the signature would be identical to the ColumnSize varargs constructor. Widgets can still be added after construction using the add method.
Because you could call setSize(); and remove all sizes otherwise!


On Fri, Jun 27, 2014 at 3:33 PM, Sven Jacobs <notifications@github.com>
wrote:

> In gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Column.java:
>
> >       * @see #addSize(ColumnSize...)
> >       */
> > -    public Column(final ColumnSize size) {
> > -        this();
> > -        setStyleName(size.getCssName());
> > -    }
> > -
> > -    /**
> > -     * Creates column with multiple sizes.
> > -     *
> > -     * @param sizes Column sizes
> > -     */
> > -    public Column(final ColumnSize... sizes) {
> > -        setSize(sizes);
> > +    public Column(final ColumnSize firstSize, final ColumnSize... otherSizes) {
> > +        setSize(firstSize, otherSizes);
> > +        setStyleName(firstSize.getCssName());
>
> Why is this required? Shouldn't it be handled by setSize()?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/gwtbootstrap3/gwtbootstrap3/pull/188/files#r14295214>.
>