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; 024 025/** 026 * @author kevzlou7979 027 */ 028public class BorderMixin<T extends Widget & HasBorder> extends StylePropertyMixin<T> implements HasBorder { 029 030 static final String BORDER = "border"; 031 static final String BORDER_LEFT = "borderLeft"; 032 static final String BORDER_RIGHT = "borderRight"; 033 static final String BORDER_TOP = "borderTop"; 034 static final String BORDER_BOTTOM = "borderBottom"; 035 static final String BORDER_RADIUS = "borderRadius"; 036 037 public BorderMixin(T uiObject) { 038 super(uiObject); 039 } 040 041 @Override 042 public void setBorder(String value) { 043 setProperty(BORDER, value); 044 } 045 046 @Override 047 public String getBorder() { 048 return getProperty(BORDER); 049 } 050 051 @Override 052 public void setBorderLeft(String value) { 053 setProperty(BORDER_LEFT, value); 054 } 055 056 @Override 057 public String getBorderLeft() { 058 return getProperty(BORDER_LEFT); 059 } 060 061 @Override 062 public void setBorderRight(String value) { 063 setProperty(BORDER_RIGHT, value); 064 } 065 066 @Override 067 public String getBorderRight() { 068 return getProperty(BORDER_RIGHT); 069 } 070 071 @Override 072 public void setBorderTop(String value) { 073 setProperty(BORDER_TOP, value); 074 } 075 076 @Override 077 public String getBorderTop() { 078 return getProperty(BORDER_TOP); 079 } 080 081 @Override 082 public void setBorderBottom(String value) { 083 setProperty(BORDER_BOTTOM, value); 084 } 085 086 @Override 087 public String getBorderBottom() { 088 return getProperty(BORDER_BOTTOM); 089 } 090 091 @Override 092 public void setBorderRadius(String value) { 093 setProperty(BORDER_RADIUS, value); 094 } 095 096 @Override 097 public String getBorderRadius() { 098 return getProperty(BORDER_RADIUS); 099 } 100}