Repository: gwtmaterialdesign/gwt-material
Issue: HasFlexBox: Error setting the display attribute on UiBinder

The HasFlexBox interface defines two methods with the same name:

``` java
void setDisplay(Style.Display display);

void setDisplay(Display display);
```

And that causes a problem when you define a `display` attribute on UiBinder on any MaterialWidget:

``` xml
<m:MaterialPanel display="NONE" />
```

The error is:

```
[ERROR] Ambiguous setter requested: MaterialPanel.display
```


Changed files:
gwt-material/src/main/java/gwt/material/design/client/base/mixin/ProgressMixin.java
gwt-material/src/main/java/gwt/material/design/client/base/AbstractTextWidget.java
gwt-material/src/main/java/gwt/material/design/client/base/HasInlineStyle.java
gwt-material/src/main/java/gwt/material/design/client/constants/Display.java
gwt-material/src/main/java/gwt/material/design/client/base/HasFlexbox.java
gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSplashScreen.java
gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java
gwt-material/src/main/java/gwt/material/design/client/base/mixin/FlexboxMixin.java

diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/AbstractTextWidget.java b/gwt-material/src/main/java/gwt/material/design/client/base/AbstractTextWidget.java
index 5e5b8440..b14ad95a 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/AbstractTextWidget.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/AbstractTextWidget.java
@@ -20,6 +20,10 @@ package gwt.material.design.client.base;
  * #L%
  */
 
+import gwt.material.design.client.base.mixin.FontSizeMixin;
+import gwt.material.design.client.base.mixin.IdMixin;
+import gwt.material.design.client.constants.Display;
+
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Style;
 import com.google.gwt.editor.client.IsEditor;
@@ -27,8 +31,6 @@ import com.google.gwt.editor.client.LeafValueEditor;
 import com.google.gwt.editor.ui.client.adapters.HasTextEditor;
 import com.google.gwt.user.client.ui.HasHTML;
 import com.google.gwt.user.client.ui.Widget;
-import gwt.material.design.client.base.mixin.FontSizeMixin;
-import gwt.material.design.client.base.mixin.IdMixin;
 
 /**
  * @author Ben Dol
@@ -171,8 +173,8 @@ public abstract class AbstractTextWidget extends Widget implements HasId, HasHTM
     }
 
     @Override
-    public void setDisplay(Style.Display display) {
-        getElement().getStyle().setDisplay(display);
+    public void setDisplay(Display display) {
+        getElement().getStyle().setProperty("display", display.getCssName());
     }
 
     @Override
diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/HasFlexbox.java b/gwt-material/src/main/java/gwt/material/design/client/base/HasFlexbox.java
index 0fd4f856..f4b32503 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/HasFlexbox.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/HasFlexbox.java
@@ -32,7 +32,7 @@ import gwt.material.design.client.constants.*;
  * @see MaterialWidget
  */
 public interface HasFlexbox {
-    void setDisplay(Style.Display display);
+    void setGwtDisplay(Style.Display display);
 
     void setDisplay(Display display);
 
diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/HasInlineStyle.java b/gwt-material/src/main/java/gwt/material/design/client/base/HasInlineStyle.java
index 6af390c5..ae1be415 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/HasInlineStyle.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/HasInlineStyle.java
@@ -21,7 +21,7 @@ package gwt.material.design.client.base;
  */
 
 
-import com.google.gwt.dom.client.Style;
+import gwt.material.design.client.constants.Display;
 
 /**
  * @author Ben Dol
@@ -47,5 +47,5 @@ public interface HasInlineStyle extends HasColors, HasOpacity, HasFontSize {
 
     void setPaddingBottom(double padding);
 
-    void setDisplay(Style.Display display);
+    void setDisplay(Display display);
 }
\\ No newline at end of file
diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java b/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
index 4904d77c..83804ff9 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/MaterialWidget.java
@@ -20,12 +20,39 @@ package gwt.material.design.client.base;
  * #L%
  */
 
+import gwt.material.design.client.base.helper.StyleHelper;
+import gwt.material.design.client.base.mixin.ColorsMixin;
+import gwt.material.design.client.base.mixin.CssNameMixin;
+import gwt.material.design.client.base.mixin.EnabledMixin;
+import gwt.material.design.client.base.mixin.FlexboxMixin;
+import gwt.material.design.client.base.mixin.FocusableMixin;
+import gwt.material.design.client.base.mixin.FontSizeMixin;
+import gwt.material.design.client.base.mixin.GridMixin;
+import gwt.material.design.client.base.mixin.IdMixin;
+import gwt.material.design.client.base.mixin.ScrollspyMixin;
+import gwt.material.design.client.base.mixin.SeparatorMixin;
+import gwt.material.design.client.base.mixin.ShadowMixin;
+import gwt.material.design.client.base.mixin.ToggleStyleMixin;
+import gwt.material.design.client.base.mixin.TooltipMixin;
+import gwt.material.design.client.base.mixin.WavesMixin;
+import gwt.material.design.client.constants.CenterOn;
+import gwt.material.design.client.constants.Display;
+import gwt.material.design.client.constants.Flex;
+import gwt.material.design.client.constants.FlexAlignContent;
+import gwt.material.design.client.constants.FlexAlignItems;
+import gwt.material.design.client.constants.FlexAlignSelf;
+import gwt.material.design.client.constants.FlexDirection;
+import gwt.material.design.client.constants.FlexJustifyContent;
+import gwt.material.design.client.constants.FlexWrap;
+import gwt.material.design.client.constants.HideOn;
+import gwt.material.design.client.constants.Position;
+import gwt.material.design.client.constants.ShowOn;
+import gwt.material.design.client.constants.TextAlign;
+import gwt.material.design.client.constants.WavesType;
+
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Style;
 import com.google.gwt.user.client.ui.*;
-import gwt.material.design.client.base.helper.StyleHelper;
-import gwt.material.design.client.base.mixin.*;
-import gwt.material.design.client.constants.*;
 import java.util.Iterator;
 
 public class MaterialWidget extends ComplexPanel implements HasId, HasEnabled, HasTextAlign, HasColors, HasGrid,
@@ -322,8 +349,8 @@ public class MaterialWidget extends ComplexPanel implements HasId, HasEnabled, H
     }
 
     @Override
-    public void setDisplay(Style.Display display) {
-        getFlexboxMixin().setDisplay(display);
+    public void setGwtDisplay(Style.Display display) {
+        getFlexboxMixin().setGwtDisplay(display);
     }
 
     @Override
diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/mixin/FlexboxMixin.java b/gwt-material/src/main/java/gwt/material/design/client/base/mixin/FlexboxMixin.java
index 024daef0..fa0f60d2 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/mixin/FlexboxMixin.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/mixin/FlexboxMixin.java
@@ -46,10 +46,12 @@ public class FlexboxMixin<T extends Widget & HasFlexbox> extends AbstractMixin<T
 
     private Display displayValueBeforeHidden;
 
-    public void setDisplay(Style.Display display) {
+    @Override
+    public void setGwtDisplay(Style.Display display) {
         setDisplay(Display.parse(display));
     }
 
+    @Override
     public void setDisplay(Display display) {
         if (display == null) {
             displayValueBeforeHidden = null;
@@ -76,6 +78,7 @@ public class FlexboxMixin<T extends Widget & HasFlexbox> extends AbstractMixin<T
         }
     }
 
+    @Override
     public void setVisible(boolean visible) {
         uiObject.setVisible(visible);
 
@@ -86,6 +89,7 @@ public class FlexboxMixin<T extends Widget & HasFlexbox> extends AbstractMixin<T
         }
     }
 
+    @Override
     public void setFlexDirection(FlexDirection flexDirection) {
         boolean isCurrentlyVisible = uiObject.isVisible();
 
@@ -101,6 +105,7 @@ public class FlexboxMixin<T extends Widget & HasFlexbox> extends AbstractMixin<T
         }
     }
 
+    @Override
     public void setFlex(Flex flex) {
         if (flex == null) {
             setFlexGrow(null);
@@ -114,38 +119,47 @@ public class FlexboxMixin<T extends Widget & HasFlexbox> extends AbstractMixin<T
         setFlexBasis(flex.getBasis());
     }
 
+    @Override
     public void setFlexGrow(Integer flexGrow) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), new String[]{"MsFlexGrow", "WebkitFlexGrow", "MozFlexGrow", "flexGrow"}, flexGrow != null ? flexGrow.toString() : null);
     }
 
+    @Override
     public void setFlexShrink(Integer flexShrink) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), new String[]{"MsFlexShrink", "WebkitFlexShrink", "MozFlexShrink", "flexShrink"}, flexShrink != null ? flexShrink.toString() : null);
     }
 
+    @Override
     public void setFlexBasis(String flexBasis) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), new String[]{"MsFlexBasis", "WebkitFlexBasis", "MozFlexBasis", "flexBasis"}, flexBasis);
     }
 
+    @Override
     public void setFlexOrder(Integer flexOrder) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), new String[]{"MsFlexOrder", "WebkitOrder", "MozFlexOrder", "order"}, flexOrder != null ? flexOrder.toString() : null);
     }
 
+    @Override
     public void setFlexWrap(FlexWrap flexWrap) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), new String[]{"MsFlexWrap", "WebkitFlexWrap", "MozFlexWrap", "flexWrap"}, flexWrap != null ? flexWrap.getValue() : null);
     }
 
+    @Override
     public void setFlexAlignContent(FlexAlignContent flexAlignContent) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), "MsFlexLinePack", new String[]{"WebkitAlignContent", "MozFlexAlignContent", "alignContent"}, flexAlignContent);
     }
 
+    @Override
     public void setFlexAlignSelf(FlexAlignSelf flexAlignSelf) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), "MsFlexItemAlign", new String[]{"WebkitAlignSelf", "MozFlexItemAlign", "alignSelf"}, flexAlignSelf);
     }
 
+    @Override
     public void setFlexAlignItems(FlexAlignItems flexAlignItems) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), "MsFlexAlign", new String[]{"WebkitAlignItems", "MozFlexAlign", "alignItems"}, flexAlignItems);
     }
 
+    @Override
     public void setFlexJustifyContent(FlexJustifyContent flexJustifyContent) {
         BrowserPrefixHelper.updateStyleProperties(uiObject.getElement(), "MsFlexPack", new String[]{"WebkitJustifyContent", "MozJustifyContent", "justifyContent"}, flexJustifyContent);
     }
diff --git a/gwt-material/src/main/java/gwt/material/design/client/base/mixin/ProgressMixin.java b/gwt-material/src/main/java/gwt/material/design/client/base/mixin/ProgressMixin.java
index 7c7c39c0..8776a719 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/base/mixin/ProgressMixin.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/base/mixin/ProgressMixin.java
@@ -20,15 +20,16 @@ package gwt.material.design.client.base.mixin;
  * #L%
  */
 
-import com.google.gwt.dom.client.Style;
-import com.google.gwt.user.client.ui.UIObject;
 import gwt.material.design.client.base.HasProgress;
+import gwt.material.design.client.constants.Display;
 import gwt.material.design.client.constants.ProgressType;
 import gwt.material.design.client.ui.MaterialCollapsibleBody;
 import gwt.material.design.client.ui.MaterialCollapsibleItem;
 import gwt.material.design.client.ui.MaterialNavBar;
 import gwt.material.design.client.ui.MaterialProgress;
 
+import com.google.gwt.user.client.ui.UIObject;
+
 /**
  * @author kevzlou7979
  */
@@ -73,10 +74,10 @@ public class ProgressMixin<T extends UIObject & HasProgress>
             return;
         }else {
             if (isShow) {
-                body.setDisplay(Style.Display.NONE);
+                body.setDisplay(Display.NONE);
                 item.add(progress);
             } else {
-                body.setDisplay(Style.Display.BLOCK);
+                body.setDisplay(Display.BLOCK);
                 progress.removeFromParent();
             }
         }
diff --git a/gwt-material/src/main/java/gwt/material/design/client/constants/Display.java b/gwt-material/src/main/java/gwt/material/design/client/constants/Display.java
index 7d4ed035..1483165e 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/constants/Display.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/constants/Display.java
@@ -21,12 +21,13 @@ package gwt.material.design.client.constants;
  */
 
 import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.HasCssName;
 
 /**
  * @author chriswjones
  */
-public enum Display {
-    FLEX(null),
+public enum Display implements HasCssName {
+    FLEX("flex"),
     NONE(Style.Display.NONE),
     BLOCK(Style.Display.BLOCK),
     INLINE(Style.Display.INLINE),
@@ -45,26 +46,35 @@ public enum Display {
     TABLE_ROW(Style.Display.TABLE_ROW),
     INITIAL(Style.Display.INITIAL);
 
-    private final Style.Display gwtDisplay;
+    private final String cssName;
 
-    Display(Style.Display gwtDisplay) {
-        this.gwtDisplay = gwtDisplay;
+    Display(HasCssName gwtDisplay) {
+        this.cssName = gwtDisplay.getCssName();
+    }
+    
+    Display(String cssName) {
+        this.cssName = cssName;
     }
 
     public Style.Display getGwtDisplay() {
-        return gwtDisplay;
+        return Style.Display.valueOf(this.name());
     }
-
-    public static Display parse(Style.Display gwtDisplay) {
-        if (gwtDisplay == null) {
-            return null;
-        }
-
+    
+    public static Display parse(String display) {
         for (Display d : Display.values()) {
-            if (d.getGwtDisplay() != null && d.getGwtDisplay().equals(gwtDisplay)) {
+            if (d.getCssName().equals(display)){
                 return d;
             }
         }
         return null;
     }
+
+    public static Display parse(HasCssName display) {
+        return parse(display.getCssName());
+    }
+
+    @Override
+    public String getCssName() {
+        return cssName;
+    }
 }
diff --git a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java
index fda9e7fa..f8c0c18e 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialCollapsibleItem.java
@@ -1,17 +1,18 @@
 package gwt.material.design.client.ui;
 
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.dom.client.Style.Display;
-import com.google.gwt.user.client.ui.HasWidgets;
-import com.google.gwt.user.client.ui.Widget;
 import gwt.material.design.client.base.AbstractButton;
 import gwt.material.design.client.base.HasProgress;
 import gwt.material.design.client.base.mixin.ProgressMixin;
+import gwt.material.design.client.constants.Display;
 import gwt.material.design.client.constants.ProgressType;
 import gwt.material.design.client.constants.WavesType;
 import gwt.material.design.client.ui.MaterialCollapsible.HasCollapsibleParent;
 
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.ui.HasWidgets;
+import com.google.gwt.user.client.ui.Widget;
+
 /*
  * #%L
  * GwtMaterial
diff --git a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSplashScreen.java b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSplashScreen.java
index 5a8b0b6d..cd9b9f21 100644
--- a/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSplashScreen.java
+++ b/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialSplashScreen.java
@@ -19,13 +19,14 @@
  */
 package gwt.material.design.client.ui;
 
+import gwt.material.design.client.base.MaterialWidget;
+import gwt.material.design.client.constants.Display;
+import gwt.material.design.client.ui.html.Div;
+
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.Style;
-import com.google.gwt.dom.client.Style.Display;
 import com.google.gwt.user.client.ui.HasVisibility;
 import com.google.gwt.user.client.ui.Widget;
-import gwt.material.design.client.base.MaterialWidget;
-import gwt.material.design.client.ui.html.Div;
 
 //@formatter:off
 /**
@@ -83,11 +84,11 @@ public class MaterialSplashScreen extends MaterialWidget implements HasVisibilit
     }
 
     public void show(){
-        getElement().getStyle().setDisplay(Display.BLOCK);
+        getElement().getStyle().setDisplay(Display.BLOCK.getGwtDisplay());
     }
 
     public void hide(){
-        getElement().getStyle().setDisplay(Display.NONE);
+        getElement().getStyle().setDisplay(Display.NONE.getGwtDisplay());
     }
 
 }