001package org.gwtbootstrap3.client.ui.gwt;
002
003/*
004 * #%L
005 * GwtBootstrap3
006 * %%
007 * Copyright (C) 2013 GwtBootstrap3
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 * 
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 * 
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import java.util.List;
024
025import org.gwtbootstrap3.client.ui.base.HasDataSpy;
026import org.gwtbootstrap3.client.ui.base.HasDataTarget;
027import org.gwtbootstrap3.client.ui.base.HasId;
028import org.gwtbootstrap3.client.ui.base.HasResponsiveness;
029import org.gwtbootstrap3.client.ui.base.helper.StyleHelper;
030import org.gwtbootstrap3.client.ui.base.mixin.DataSpyMixin;
031import org.gwtbootstrap3.client.ui.base.mixin.DataTargetMixin;
032import org.gwtbootstrap3.client.ui.base.mixin.IdMixin;
033import org.gwtbootstrap3.client.ui.constants.DeviceSize;
034import org.gwtbootstrap3.client.ui.constants.Spy;
035
036import com.google.gwt.user.client.ui.Widget;
037
038/**
039 * @author Sven Jacobs
040 */
041public class FlowPanel extends com.google.gwt.user.client.ui.FlowPanel implements HasDataSpy, HasId, HasDataTarget, HasResponsiveness {
042
043    private final DataSpyMixin<FlowPanel> spyMixin = new DataSpyMixin<FlowPanel>(this);
044    private final IdMixin<FlowPanel> idMixin = new IdMixin<FlowPanel>(this);
045    private final DataTargetMixin<FlowPanel> targetMixin = new DataTargetMixin<FlowPanel>(this);
046
047    @Override
048    public void setDataSpy(final Spy spy) {
049        spyMixin.setDataSpy(spy);
050    }
051
052    @Override
053    public Spy getDataSpy() {
054        return spyMixin.getDataSpy();
055    }
056
057    @Override
058    public void setDataTargetWidgets(final List<Widget> widgets) {
059        targetMixin.setDataTargetWidgets(widgets);
060    }
061
062    @Override
063    public void setDataTargetWidget(final Widget widget) {
064        targetMixin.setDataTargetWidget(widget);
065    }
066
067    @Override
068    public void setDataTarget(final String dataTarget) {
069        targetMixin.setDataTarget(dataTarget);
070    }
071
072    @Override
073    public String getDataTarget() {
074        return targetMixin.getDataTarget();
075    }
076
077    @Override
078    public void setId(final String id) {
079        idMixin.setId(id);
080    }
081
082    @Override
083    public String getId() {
084        return idMixin.getId();
085    }
086
087    @Override
088    public void setVisibleOn(final DeviceSize deviceSize) {
089        StyleHelper.setVisibleOn(this, deviceSize);
090    }
091
092    @Override
093    public void setHiddenOn(final DeviceSize deviceSize) {
094        StyleHelper.setHiddenOn(this, deviceSize);
095    }
096}