22
33import com .google .gwt .dom .client .Document ;
44import com .google .gwt .dom .client .Element ;
5+ import com .google .gwt .dom .client .Style ;
56import com .google .gwt .event .logical .shared .*;
67import com .google .gwt .event .shared .HandlerRegistration ;
78import com .google .gwt .i18n .shared .DateTimeFormat ;
89import com .google .gwt .user .client .DOM ;
910import com .google .gwt .user .client .ui .HasValue ;
1011import gwt .material .design .addins .client .MaterialAddins ;
1112import gwt .material .design .client .MaterialDesignBase ;
12- import gwt .material .design .client .base .HasError ;
13- import gwt .material .design .client .base .HasOrientation ;
14- import gwt .material .design .client .base .HasPlaceholder ;
15- import gwt .material .design .client .base .MaterialWidget ;
13+ import gwt .material .design .client .base .*;
1614import gwt .material .design .client .base .mixin .ErrorMixin ;
1715import gwt .material .design .client .base .mixin .ToggleStyleMixin ;
18- import gwt .material .design .client .constants .InputType ;
19- import gwt .material .design .client .constants . Orientation ;
16+ import gwt .material .design .client .constants .* ;
17+ import gwt .material .design .client .ui . MaterialIcon ;
2018import gwt .material .design .client .ui .MaterialInput ;
2119import gwt .material .design .client .ui .MaterialLabel ;
2220import gwt .material .design .client .ui .MaterialPanel ;
6664 */
6765//@formatter:on
6866public class MaterialTimePicker extends MaterialWidget implements HasError , HasPlaceholder , HasOrientation ,
69- HasCloseHandlers <Date >, HasOpenHandlers <Date >, HasValue <Date > {
67+ HasCloseHandlers <Date >, HasOpenHandlers <Date >, HasValue <Date >, HasIcon {
7068
7169 static {
7270 if (MaterialAddins .isDebug ()) {
@@ -92,6 +90,8 @@ public class MaterialTimePicker extends MaterialWidget implements HasError, HasP
9290
9391 private Label label = new Label ();
9492
93+ private MaterialIcon icon = new MaterialIcon ();
94+
9595 /** */
9696 private ToggleStyleMixin <MaterialInput > validMixin = new ToggleStyleMixin <>(this .input , "valid" );
9797
@@ -429,4 +429,46 @@ protected native void setValue(Element e, String time) /*-{
429429 $wnd.jQuery(e).val(time);
430430 }-*/ ;
431431
432+ @ Override
433+ public MaterialIcon getIcon () {
434+ return icon ;
435+ }
436+
437+ @ Override
438+ public void setIconType (IconType iconType ) {
439+ icon .setIconType (iconType );
440+ icon .setIconPrefix (true );
441+ lblError .setPaddingLeft (44 );
442+ insert (icon , 0 );
443+ }
444+
445+ @ Override
446+ public void setIconPosition (IconPosition position ) {
447+ icon .setIconPosition (position );
448+ }
449+
450+ @ Override
451+ public void setIconSize (IconSize size ) {
452+ icon .setIconSize (size );
453+ }
454+
455+ @ Override
456+ public void setIconFontSize (double size , Style .Unit unit ) {
457+ icon .setIconFontSize (size , unit );
458+ }
459+
460+ @ Override
461+ public void setIconColor (String iconColor ) {
462+ icon .setIconColor (iconColor );
463+ }
464+
465+ @ Override
466+ public void setIconPrefix (boolean prefix ) {
467+ icon .setIconPrefix (prefix );
468+ }
469+
470+ @ Override
471+ public boolean isIconPrefix () {
472+ return icon .isIconPrefix ();
473+ }
432474}
0 commit comments