package org.gwtbootstrap3.client.ui.gwt; /* * #%L * GwtBootstrap3 * %% * Copyright (C) 2013 - 2014 GwtBootstrap3 * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import org.gwtbootstrap3.client.ui.base.HasId; import org.gwtbootstrap3.client.ui.base.HasPull; import org.gwtbootstrap3.client.ui.base.HasResponsiveness; import org.gwtbootstrap3.client.ui.base.helper.StyleHelper; import org.gwtbootstrap3.client.ui.base.mixin.EnabledMixin; import org.gwtbootstrap3.client.ui.base.mixin.IdMixin; import org.gwtbootstrap3.client.ui.base.mixin.PullMixin; import org.gwtbootstrap3.client.ui.constants.DeviceSize; import org.gwtbootstrap3.client.ui.constants.Pull; import com.google.gwt.dom.client.Element; public abstract class ButtonBase extends com.google.gwt.user.client.ui.ButtonBase implements HasResponsiveness, HasId, HasPull { private final IdMixin<ButtonBase> idMixin = new IdMixin<ButtonBase>(this); private final PullMixin<ButtonBase> pullMixin = new PullMixin<ButtonBase>(this); private final EnabledMixin<ButtonBase> enabledMixin = new EnabledMixin<ButtonBase>(this); protected ButtonBase(Element elem) { super(elem); } @Override public void setEnabled(boolean enabled) { enabledMixin.setEnabled(enabled); } @Override public boolean isEnabled() { return enabledMixin.isEnabled(); } /** * {@inheritDoc} */ @Override public void setId(final String id) { idMixin.setId(id); } /** * {@inheritDoc} */ @Override public String getId() { return idMixin.getId(); } /** * {@inheritDoc} */ @Override public void setVisibleOn(final DeviceSize deviceSize) { StyleHelper.setVisibleOn(this, deviceSize); } /** * {@inheritDoc} */ @Override public void setHiddenOn(final DeviceSize deviceSize) { StyleHelper.setHiddenOn(this, deviceSize); } /** * {@inheritDoc} */ @Override public void setPull(final Pull pull) { pullMixin.setPull(pull); } /** * {@inheritDoc} */ @Override public Pull getPull() { return pullMixin.getPull(); } }