001/*
002 * #%L
003 * GwtMaterial
004 * %%
005 * Copyright (C) 2015 - 2017 GwtMaterialDesign
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 * 
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 * 
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package gwt.material.design.client.base.mixin;
021
022import com.google.gwt.user.client.ui.Widget;
023import gwt.material.design.client.base.HasBorder;
024import gwt.material.design.client.base.HasDimension;
025
026/**
027 * @author kevzlou7979
028 */
029public class DimensionMixin<T extends Widget & HasBorder> extends StylePropertyMixin<T> implements HasDimension {
030
031    static final String MIN_HEIGHT = "minHeight";
032    static final String MAX_HEIGHT = "maxHeight";
033    static final String MIN_WIDTH = "minWidth";
034    static final String MAX_WIDTH = "maxWidth";
035
036    public DimensionMixin(T uiObject) {
037        super(uiObject);
038    }
039
040    @Override
041    public void setMinHeight(String value) {
042        setProperty(MIN_HEIGHT, value);
043    }
044
045    @Override
046    public String getMinHeight() {
047        return getProperty(MIN_HEIGHT);
048    }
049
050    @Override
051    public void setMaxHeight(String value) {
052        setProperty(MAX_HEIGHT, value);
053    }
054
055    @Override
056    public String getMaxHeight() {
057        return getProperty(MAX_HEIGHT);
058    }
059
060    @Override
061    public void setMinWidth(String value) {
062        setProperty(MIN_WIDTH, value);
063    }
064
065    @Override
066    public String getMinWidth() {
067        return getProperty(MIN_WIDTH);
068    }
069
070    @Override
071    public void setMaxWidth(String value) {
072        setProperty(MAX_WIDTH, value);
073    }
074
075    @Override
076    public String getMaxWidth() {
077        return getProperty(MAX_WIDTH);
078    }
079}