diff --git a/.gitignore b/.gitignore index 0b9bf2965..57dab39f9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ mgwt.iml gwt-unitCache war/ www-test/ +/bin diff --git a/pom.xml b/pom.xml index 66aef213a..193e79c82 100644 --- a/pom.xml +++ b/pom.xml @@ -11,12 +11,12 @@ com.googlecode.mgwt mgwt - 2.0.0-SNAPSHOT + 2.0.1-SNAPSHOT jar mgwt - 2.6.1 + 2.7.0 UTF-8 @@ -53,10 +53,10 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.5.1 - 1.6 - 1.6 + 1.7 + 1.7 @@ -111,7 +111,7 @@ maven-surefire-plugin - 2.6 + 2.19.1 **/*Test.java @@ -127,7 +127,7 @@ org.codehaus.mojo gwt-maven-plugin - 2.6.1 + 2.7.0 @@ -166,7 +166,7 @@ junit junit - 4.7 + 4.12 jar test @@ -198,13 +198,13 @@ org.mockito mockito-all - 1.9.5 + 1.10.19 test com.google.gwt.gwtmockito gwtmockito - 1.1.3 + 1.1.6 test diff --git a/src/main/java/com/google/gwt/user/client/impl/DOMImplIE10.java b/src/main/java/com/google/gwt/user/client/impl/DOMImplIE10.java new file mode 100644 index 000000000..b8b4c0035 --- /dev/null +++ b/src/main/java/com/google/gwt/user/client/impl/DOMImplIE10.java @@ -0,0 +1,67 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.google.gwt.user.client.impl; + +import com.google.gwt.core.client.JavaScriptObject; + + +/** + * IE10 implementation of {@link com.google.gwt.user.client.impl.DOMImplStandard}. + */ +public class DOMImplIE10 extends DOMImplIE9 { + + static + { + DOMImplStandard.addCaptureEventDispatchers(getCaptureEventDispatchers()); + DOMImplStandard.addBitlessEventDispatchers(getBitlessEventDispatchers()); + capturePointerEvents(); + } + + /** + * Lets have the same behaviour as IOS where the target element continues to receive Pointer events + * even when the pointer has moved off the element up until MSPointerUp has occurred. + * + * Do not do pointer capture on input or textarea elements, all sorts of problems arise if you do! + */ + private native static void capturePointerEvents() /*-{ + $wnd.addEventListener('MSPointerDown', + $entry(function(evt) { + if ((evt.target.tagName !== 'INPUT') && (evt.target.tagName !== 'TEXTAREA')) { + evt.target.msSetPointerCapture(evt.pointerId); + } + }), true); + }-*/; + + + public static native JavaScriptObject getCaptureEventDispatchers() /*-{ + return { + MSPointerDown: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*), + MSPointerUp: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*), + MSPointerMove: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*), + MSPointerCancel: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*) + }; + }-*/; + + public static native JavaScriptObject getBitlessEventDispatchers() /*-{ + return { + MSPointerDown: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*), + MSPointerUp: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*), + MSPointerMove: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*), + MSPointerCancel: @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*) + }; + }-*/; + +} diff --git a/src/main/java/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java b/src/main/java/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java new file mode 100644 index 000000000..9f7483ed0 --- /dev/null +++ b/src/main/java/com/google/gwt/useragent/rebind/UserAgentPropertyGenerator.java @@ -0,0 +1,104 @@ + +package com.google.gwt.useragent.rebind; + +import com.google.gwt.core.ext.TreeLogger; +import com.google.gwt.core.ext.linker.ConfigurationProperty; +import com.google.gwt.core.ext.linker.PropertyProviderGenerator; +import com.google.gwt.user.rebind.SourceWriter; +import com.google.gwt.user.rebind.StringSourceWriter; + +import java.util.HashSet; +import java.util.Set; +import java.util.SortedSet; + +/** + * Generator which writes out the JavaScript for determining the value of the + * user.agent selection property. + */ +public class UserAgentPropertyGenerator implements PropertyProviderGenerator { + + /** + * The list of {@code user.agent} values listed here should be kept in sync with + * {@code UserAgent.gwt.xml}. + *

Note that the order of enums matter as the script selection is based on running + * these predicates in order and matching the first one that returns {@code true}. + *

Also note that, {@code docMode < 11} in predicates for older IEs exists to + * ensures we never choose them for IE11 (we know that they will not work for IE11). + */ + private enum UserAgent { + safari("return ((ua.indexOf('webkit') != -1) && !(ua.indexOf('trident') != -1));"), + ie10("return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11)) || " + + "(ua.indexOf('iemobile') != -1 && (docMode >= 10 && docMode < 11))"), + ie9("return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));"), + ie8("return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));"), + gecko1_8("return (ua.indexOf('gecko') != -1 || docMode >= 11);"); + + private final String predicateBlock; + + private UserAgent(String predicateBlock) { + this.predicateBlock = predicateBlock; + } + + private static Set getKnownAgents() { + HashSet userAgents = new HashSet(); + for (UserAgent userAgent : values()) { + userAgents.add(userAgent.name()); + } + return userAgents; + } + } + + /** + * Writes out the JavaScript function body for determining the value of the + * user.agent selection property. This method is used to create + * the selection script and by {@link UserAgentGenerator} to assert at runtime + * that the correct user agent permutation is executing. + */ + static void writeUserAgentPropertyJavaScript(SourceWriter body, + SortedSet possibleValues, String fallback) { + + // write preamble + body.println("var ua = navigator.userAgent.toLowerCase();"); + body.println("var docMode = $doc.documentMode;"); + + for (UserAgent userAgent : UserAgent.values()) { + // write only selected user agents + if (possibleValues.contains(userAgent.name())) { + body.println("if ((function() { "); + body.indentln(userAgent.predicateBlock); + body.println("})()) return '%s';", userAgent.name()); + } + } + + // default return + if (fallback == null) { + fallback = "unknown"; + } + body.println("return '" + fallback + "';"); + } + + @Override + public String generate(TreeLogger logger, SortedSet possibleValues, String fallback, + SortedSet configProperties) { + assertUserAgents(logger, possibleValues); + + StringSourceWriter body = new StringSourceWriter(); + body.println("{"); + body.indent(); + writeUserAgentPropertyJavaScript(body, possibleValues, fallback); + body.outdent(); + body.println("}"); + + return body.toString(); + } + + private static void assertUserAgents(TreeLogger logger, SortedSet possibleValues) { + HashSet unknownValues = new HashSet(possibleValues); + unknownValues.removeAll(UserAgent.getKnownAgents()); + if (!unknownValues.isEmpty()) { + logger.log(TreeLogger.WARN, "Unrecognized " + UserAgentGenerator.PROPERTY_USER_AGENT + + " values " + unknownValues + ", possibly due to UserAgent.gwt.xml and " + + UserAgentPropertyGenerator.class.getName() + " being out of sync."); + } + } +} diff --git a/src/main/java/com/googlecode/mgwt/dom/DOM.gwt.xml b/src/main/java/com/googlecode/mgwt/dom/DOM.gwt.xml index 707540f71..07446025e 100644 --- a/src/main/java/com/googlecode/mgwt/dom/DOM.gwt.xml +++ b/src/main/java/com/googlecode/mgwt/dom/DOM.gwt.xml @@ -38,7 +38,10 @@ // Detect form factor from user agent. var ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) { + if (ua.indexOf("windows phone 8") != -1) { + // windows phone 8/8.1 + return "phone"; + } else if (ua.indexOf("iphone") != -1 || ua.indexOf("ipod") != -1) { // iphone and ipod. return "phone"; } else if (ua.indexOf("ipad") != -1) { @@ -57,6 +60,14 @@ ]]> + + + + + + + + + + + + + + + diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelEvent.java new file mode 100644 index 000000000..89568c2bd --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelEvent.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native MsPointerCancelEvent. + */ +public class MsPointerCancelEvent extends MsPointerEvent { + + /** + * Event type for MsPointerCancelEvent. Represents the meta-data associated with + * this event. + */ + private static final Type TYPE = new Type( + MsPointerEvent.MSPOINTERCANCEL, new MsPointerCancelEvent()); + + /** + * Gets the event type associated with pointer cancel events. + * + * @return the handler type + */ + public static Type getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer up events. + */ + protected MsPointerCancelEvent() { + } + + @Override + public final Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(MsPointerCancelHandler handler) { + handler.onPointerCancel(this); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelHandler.java new file mode 100644 index 000000000..f94cc3500 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerCancelHandler.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link MsPointerCancelEvent} events. + */ +public interface MsPointerCancelHandler extends EventHandler { + + /** + * Called when MsPointerCancelEvent is fired. + * + * @param event the {@link MsPointerCancelEvent} that was fired + */ + void onPointerCancel(MsPointerCancelEvent event); +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownEvent.java new file mode 100644 index 000000000..1c043a725 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownEvent.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native MsPointerDownEvent. + */ +public class MsPointerDownEvent extends MsPointerEvent { + + /** + * Event type for MsPointerDownEvent. Represents the meta-data associated with + * this event. + */ + private static final Type TYPE = new Type( + MsPointerEvent.MSPOINTERDOWN, new MsPointerDownEvent()); + + /** + * Gets the event type associated with MsPointerDownEvent events. + * + * @return the handler type + */ + public static Type getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected MsPointerDownEvent() { + } + + @Override + public final Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(MsPointerDownHandler handler) { + handler.onPointerDown(this); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownHandler.java new file mode 100644 index 000000000..f57d6cc01 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerDownHandler.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link MsPointerDownEvent} events. + */ +public interface MsPointerDownHandler extends EventHandler { + + /** + * Called when MsPointerDownEvent is fired. + * + * @param event the {@link MsPointerDownEvent} that was fired + */ + void onPointerDown(MsPointerDownEvent event); +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerEvent.java new file mode 100644 index 000000000..c944e77de --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerEvent.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.MouseEvent; +import com.google.gwt.event.shared.EventHandler; + +/** + * Abstract class representing MsPointer events. + * + * @param handler type + * + */ +public abstract class MsPointerEvent extends MouseEvent { + + public static final String MSPOINTERDOWN = "MSPointerDown"; + public static final String MSPOINTERMOVE = "MSPointerMove"; + public static final String MSPOINTEROUT = "MSPointerOut"; + public static final String MSPOINTEROVER = "MSPointerOver"; + public static final String MSPOINTERUP = "MSPointerUp"; + public static final String MSPOINTERCANCEL = "MSPointerCancel"; + + public final native int getPointerId() /*-{ + var e = this.@com.google.gwt.event.dom.client.DomEvent::nativeEvent; + return e.pointerId; + }-*/; + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveEvent.java new file mode 100644 index 000000000..beabbe74b --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveEvent.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native MsPointerMoveEvent event. + */ +public class MsPointerMoveEvent extends MsPointerEvent { + + /** + * Event type for MsPointerMoveEvent. Represents the meta-data associated with + * this event. + */ + private static final Type TYPE = new Type( + MsPointerEvent.MSPOINTERMOVE, new MsPointerMoveEvent()); + + /** + * Gets the event type associated with MsPointerMoveEvent. + * + * @return the handler type + */ + public static Type getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected MsPointerMoveEvent() { + } + + @Override + public final Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(MsPointerMoveHandler handler) { + handler.onPointerMove(this); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveHandler.java new file mode 100644 index 000000000..1bf66801a --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerMoveHandler.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link MsPointerMoveEvent} events. + */ +public interface MsPointerMoveHandler extends EventHandler { + + /** + * Called when MsPointerMoveEvent is fired. + * + * @param event the {@link MsPointerMoveEvent} that was fired + */ + void onPointerMove(MsPointerMoveEvent event); +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpEvent.java new file mode 100644 index 000000000..d3bee93c2 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpEvent.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native MsPointerUpEvent. + */ +public class MsPointerUpEvent extends MsPointerEvent { + + /** + * Event type for MsPointerUpEvent. Represents the meta-data associated with + * this event. + */ + private static final Type TYPE = new Type( + MsPointerEvent.MSPOINTERUP, new MsPointerUpEvent()); + + /** + * Gets the event type associated with MsPointerUpEvent. + * + * @return the handler type + */ + public static Type getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected MsPointerUpEvent() { + } + + @Override + public final Type getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(MsPointerUpHandler handler) { + handler.onPointerUp(this); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpHandler.java new file mode 100644 index 000000000..4f3268b96 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/MsPointerUpHandler.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 Google Inc. + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link MsPointerUpEvent} events. + */ +public interface MsPointerUpHandler extends EventHandler { + + /** + * Called when MsPointerUpEvent is fired. + * + * @param event the {@link MsPointerUpEvent} that was fired + */ + void onPointerUp(MsPointerUpEvent event); +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouch.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouch.java new file mode 100644 index 000000000..e7279cf69 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouch.java @@ -0,0 +1,60 @@ +/* + * Copyright 2014 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.dom.client.Touch; + +public class SimulatedTouch extends Touch { + + public static native SimulatedTouch createTouch() /*-{ + // need to native for GwtMockito to work + return {}; + }-*/; + + public native static JsArray createTouchArray() /*-{ + return []; + }-*/; + + protected SimulatedTouch() { + } + + public final native void setClientX(int clientX) /*-{ + this.clientX = clientX; + }-*/; + + public final native void setClientY(int clientY) /*-{ + this.clientY = clientY; + }-*/; + + public final native void setPageX(int pageX) /*-{ + this.pageX = pageX; + }-*/; + + public final native void setPageY(int pageY) /*-{ + this.pageY = pageY; + }-*/; + + public final native void setScreenX(int screenX) /*-{ + this.screenX = screenX; + }-*/; + + public final native void setScreenY(int screenY) /*-{ + this.screenY = screenY; + }-*/; + + public final native void setId(int touchId) /*-{ + this.identifier = touchId + }-*/; +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchCancelEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchCancelEvent.java new file mode 100644 index 000000000..8b10b189b --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchCancelEvent.java @@ -0,0 +1,12 @@ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.TouchCancelEvent; + +public class SimulatedTouchCancelEvent extends TouchCancelEvent +{ + public SimulatedTouchCancelEvent(MsPointerCancelEvent event) { + setNativeEvent(event.getNativeEvent()); + setSource(event.getSource()); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchEndEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchEndEvent.java new file mode 100644 index 000000000..c0d2bae55 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchEndEvent.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.dom.client.Touch; +import com.google.gwt.event.dom.client.TouchEndEvent; + +/** + * A simulated TouchEndEvent is really a MsPointerUpEvent + */ +public class SimulatedTouchEndEvent extends TouchEndEvent { + + private final int clientX; + private final int clientY; + private final int pageX; + private final int pageY; + private int touchId; + + /** + * Construct a simulated TouchEndEvent from a {@link MsPointerUpEvent} + * + * @param event the data for the simulated event; + * @param multiTouch + */ + public SimulatedTouchEndEvent(MsPointerUpEvent event) { + this.touchId = event.getPointerId(); + clientX = event.getClientX(); + clientY = event.getClientY(); + pageX = event.getScreenX(); + pageY = event.getScreenY(); + setNativeEvent(event.getNativeEvent()); + setSource(event.getSource()); + } + + @Override + public JsArray getChangedTouches() { + JsArray array = SimulatedTouch.createTouchArray(); + SimulatedTouch touch = SimulatedTouch.createTouch(); + touch.setClientX(clientX); + touch.setClientY(clientY); + touch.setPageX(pageX); + touch.setPageY(pageY); + touch.setId(touchId); + array.push(touch); + return array; + } + + @Override + public JsArray getTouches() { + return SimulatedTouch.createTouchArray(); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchMoveEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchMoveEvent.java new file mode 100644 index 000000000..715ddbc0a --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchMoveEvent.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.dom.client.Touch; +import com.google.gwt.event.dom.client.TouchMoveEvent; + +/** + * A simulated TouchMoveEvent is really a MS Pointer move event + */ +public class SimulatedTouchMoveEvent extends TouchMoveEvent { + + private final int clientX; + private final int clientY; + private final int pageX; + private final int pageY; + private int touchId; + + public SimulatedTouchMoveEvent(MsPointerMoveEvent event) { + this.touchId = event.getPointerId(); + clientX = event.getClientX(); + clientY = event.getClientY(); + pageX = event.getScreenX(); + pageY = event.getScreenY(); + setNativeEvent(event.getNativeEvent()); + setSource(event.getSource()); + } + + @Override + public JsArray getChangedTouches() { + JsArray array = SimulatedTouch.createTouchArray(); + SimulatedTouch touch = SimulatedTouch.createTouch(); + touch.setClientX(clientX); + touch.setClientY(clientY); + touch.setPageX(pageX); + touch.setPageY(pageY); + touch.setId(touchId); + array.push(touch); + return array; + } + + @Override + public JsArray getTouches() { + JsArray array = SimulatedTouch.createTouchArray(); + SimulatedTouch touch = SimulatedTouch.createTouch(); + touch.setClientX(clientX); + touch.setClientY(clientY); + touch.setPageX(pageX); + touch.setPageY(pageY); + touch.setId(touchId); + array.push(touch); + return array; + } +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchStartEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchStartEvent.java new file mode 100644 index 000000000..0e1a852b5 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/SimulatedTouchStartEvent.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.dom.client.Touch; +import com.google.gwt.event.dom.client.TouchStartEvent; + +/** + * A simulated TouchStartEvent is really a MS Pointer down event + */ +public class SimulatedTouchStartEvent extends TouchStartEvent { + + private final int clientX; + private final int clientY; + private final int pageX; + private final int pageY; + private int touchId; + + public SimulatedTouchStartEvent(MsPointerDownEvent event) { + this.touchId = event.getPointerId(); + clientX = event.getClientX(); + clientY = event.getClientY(); + pageX = event.getScreenX(); + pageY = event.getScreenY(); + setNativeEvent(event.getNativeEvent()); + setSource(event.getSource()); + } + + @Override + public JsArray getChangedTouches() { + JsArray array = SimulatedTouch.createTouchArray(); + SimulatedTouch touch = SimulatedTouch.createTouch(); + touch.setClientX(clientX); + touch.setClientY(clientY); + touch.setPageX(pageX); + touch.setPageY(pageY); + touch.setId(touchId); + array.push(touch); + return array; + } + + @Override + public JsArray getTouches() { + JsArray array = SimulatedTouch.createTouchArray(); + SimulatedTouch touch = SimulatedTouch.createTouch(); + touch.setClientX(clientX); + touch.setClientY(clientY); + touch.setPageX(pageX); + touch.setPageY(pageY); + touch.setId(touchId); + array.push(touch); + return array; + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchCancelToMsPointerCancelHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchCancelToMsPointerCancelHandler.java new file mode 100644 index 000000000..6ca0470d6 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchCancelToMsPointerCancelHandler.java @@ -0,0 +1,35 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.TouchCancelHandler; + +/** + * Convert TouchCancelHandlers to MSPointer cancel handlers + */ +public class TouchCancelToMsPointerCancelHandler implements MsPointerCancelHandler { + + private final TouchCancelHandler handler; + + public TouchCancelToMsPointerCancelHandler(TouchCancelHandler handler) { + this.handler = handler; + } + + @Override + public void onPointerCancel(MsPointerCancelEvent event) { + SimulatedTouchCancelEvent simulatedTouchCancelEvent = new SimulatedTouchCancelEvent(event); + handler.onTouchCancel(simulatedTouchCancelEvent); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchEndToMsPointerUpHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchEndToMsPointerUpHandler.java new file mode 100644 index 000000000..ea02e8af9 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchEndToMsPointerUpHandler.java @@ -0,0 +1,35 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.TouchEndHandler; + +/** + * Convert TouchEndHandlers to MsPointerUpHandlers + */ +public class TouchEndToMsPointerUpHandler implements MsPointerUpHandler { + private final TouchEndHandler handler; + + public TouchEndToMsPointerUpHandler(TouchEndHandler handler) { + this.handler = handler; + } + + /** {@inheritDoc} */ + @Override + public void onPointerUp(MsPointerUpEvent event) { + SimulatedTouchEndEvent simulatedTouchEndEvent = new SimulatedTouchEndEvent(event); + handler.onTouchEnd(simulatedTouchEndEvent); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchMoveToMsPointerMoveHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchMoveToMsPointerMoveHandler.java new file mode 100644 index 000000000..c3670fffe --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchMoveToMsPointerMoveHandler.java @@ -0,0 +1,53 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.TouchMoveHandler; + +/** + * Convert TouchMoveHandlers to MsPointerMoveHandlers for pointer devices + * + */ +public class TouchMoveToMsPointerMoveHandler implements MsPointerMoveHandler, MsPointerDownHandler, MsPointerUpHandler { + + private boolean ignoreEvent; + private final TouchMoveHandler touchMoveHandler; + + public TouchMoveToMsPointerMoveHandler(TouchMoveHandler touchMoveHandler) { + this.touchMoveHandler = touchMoveHandler; + ignoreEvent = true; + } + + @Override + public void onPointerMove(MsPointerMoveEvent event) { + if (ignoreEvent) + return; + touchMoveHandler.onTouchMove(new SimulatedTouchMoveEvent(event)); + } + + @Override + public void onPointerUp(MsPointerUpEvent event) + { + ignoreEvent = true; + } + + @Override + public void onPointerDown(MsPointerDownEvent event) + { + ignoreEvent = false; + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchStartToMsPointerDownHandler.java b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchStartToMsPointerDownHandler.java new file mode 100644 index 000000000..14ebe9d58 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/pointer/TouchStartToMsPointerDownHandler.java @@ -0,0 +1,35 @@ +/* + * Copyright 2010 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.dom.client.event.pointer; + +import com.google.gwt.event.dom.client.TouchStartHandler; + +/** + * Convert TouchStartHandlers to MSPointer down handlers + */ +public class TouchStartToMsPointerDownHandler implements MsPointerDownHandler { + + private final TouchStartHandler handler; + + public TouchStartToMsPointerDownHandler(TouchStartHandler handler) { + this.handler = handler; + } + + @Override + public void onPointerDown(MsPointerDownEvent event) { + SimulatedTouchStartEvent simulatedTouchStartEvent = new SimulatedTouchStartEvent(event); + handler.onTouchStart(simulatedTouchStartEvent); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/dom/client/event/tap/TapEvent.java b/src/main/java/com/googlecode/mgwt/dom/client/event/tap/TapEvent.java index 8981c8fa5..1cc8885f4 100644 --- a/src/main/java/com/googlecode/mgwt/dom/client/event/tap/TapEvent.java +++ b/src/main/java/com/googlecode/mgwt/dom/client/event/tap/TapEvent.java @@ -16,6 +16,7 @@ package com.googlecode.mgwt.dom.client.event.tap; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Touch; import com.google.gwt.event.shared.GwtEvent; /** @@ -28,16 +29,14 @@ public class TapEvent extends GwtEvent { private static final Type TYPE = new Type(); - private final int startX; - private final int startY; + private final Touch touch; private final Element targetElement; - public TapEvent(Object source, Element targetElement, int startX, int startY) { - this.targetElement = targetElement; - this.startX = startX; - this.startY = startY; - setSource(source); - } + public TapEvent(Object source, Element targetElement, Touch touch) { + this.targetElement = targetElement; + this.touch = touch; + setSource(source); + } @Override public com.google.gwt.event.shared.GwtEvent.Type getAssociatedType() { @@ -54,15 +53,23 @@ public static Type getType() { return TYPE; } - public int getStartX() { - return startX; + /** + * Get access to other useful position information related to the tap event + * @return + */ + public Touch getTouch() { + return touch; } - public int getStartY() { - return startY; - } + public int getStartX() { + return touch.getPageX(); + } - /** + public int getStartY() { + return touch.getPageY(); + } + + /** * Returns the element that was the actual target of the Tap event. */ public Element getTargetElement() { diff --git a/src/main/java/com/googlecode/mgwt/dom/client/recognizer/TapRecognizer.java b/src/main/java/com/googlecode/mgwt/dom/client/recognizer/TapRecognizer.java index 47f40de34..5d4a10710 100644 --- a/src/main/java/com/googlecode/mgwt/dom/client/recognizer/TapRecognizer.java +++ b/src/main/java/com/googlecode/mgwt/dom/client/recognizer/TapRecognizer.java @@ -44,6 +44,8 @@ public class TapRecognizer implements TouchHandler { private boolean hasMoved; + private Touch touch; + private int start_x; private int start_y; @@ -78,9 +80,9 @@ public void onTouchStart(TouchStartEvent event) { }else { targetElement = null; } - - start_x = event.getTouches().get(0).getPageX(); - start_y = event.getTouches().get(0).getPageY(); + touch = event.getTouches().get(0); + start_x = touch.getPageX(); + start_y = touch.getPageY(); } @Override @@ -94,7 +96,7 @@ public void onTouchMove(TouchMoveEvent event) { @Override public void onTouchEnd(TouchEndEvent event) { if (!hasMoved && !touchCanceled) { - TapEvent tapEvent = new TapEvent(source, targetElement, start_x, start_y); + TapEvent tapEvent = new TapEvent(source, targetElement, touch); getEventPropagator().fireEvent(source, tapEvent); } } diff --git a/src/main/java/com/googlecode/mgwt/image/client/ImageConverter.java b/src/main/java/com/googlecode/mgwt/image/client/ImageConverter.java index 2db64d1df..7ca637c00 100644 --- a/src/main/java/com/googlecode/mgwt/image/client/ImageConverter.java +++ b/src/main/java/com/googlecode/mgwt/image/client/ImageConverter.java @@ -100,7 +100,7 @@ public boolean isAnimated() { } } - public ImageResource convert(ImageResource resource, String color) { + public void convert(final ImageResource resource, String color, final ImageConverterCallback imageConverterCallback) { if (color == null) { throw new IllegalArgumentException(); @@ -110,49 +110,71 @@ public ImageResource convert(ImageResource resource, String color) { throw new IllegalArgumentException(); } - int hexColor = Integer.parseInt(color.substring(1), 16); - - int red = hexColor >> 16 & 0xFF; - int green = hexColor >> 8 & 0xFF; - int blue = hexColor & 0xFF; - - int height = resource.getHeight(); - int width = resource.getWidth(); - - ImageElement imageElement = loadImage(resource.getSafeUri().asString(), - width, height); - - Canvas canvas = Canvas.createIfSupported(); - canvas.getElement().setPropertyInt("height", height); - canvas.getElement().setPropertyInt("width", width); - - Context2d context = canvas.getContext2d(); - context.drawImage(imageElement, 0, 0); - ImageData imageData = context.getImageData(0, 0, width, - height); - - CanvasPixelArray canvasPixelArray = imageData.getData(); - - for (int i = 0; i < canvasPixelArray.getLength(); i += 4) { - canvasPixelArray.set(i, red); - canvasPixelArray.set(i + 1, green); - canvasPixelArray.set(i + 2, blue); - canvasPixelArray.set(i + 3, - canvasPixelArray.get(i + 3)); - } - context.putImageData(imageData, 0, 0); - + final int hexColor = Integer.parseInt(color.substring(1), 16); + + final int red = hexColor >> 16 & 0xFF; + final int green = hexColor >> 8 & 0xFF; + final int blue = hexColor & 0xFF; + + final int height = resource.getHeight(); + final int width = resource.getWidth(); + + loadImage(resource.getSafeUri().asString(), width, height, new LoadImageCallback() { + @Override + public void onFailure(Throwable caught) + { + imageConverterCallback.onFailure(caught); + } + + @Override + public void onSuccess(ImageElement imageElement) + { + try + { + Canvas canvas = Canvas.createIfSupported(); + canvas.getElement().setPropertyInt("height", height); + canvas.getElement().setPropertyInt("width", width); + + Context2d context = canvas.getContext2d(); + context.drawImage(imageElement, 0, 0); + ImageData imageData = context.getImageData(0, 0, width, height); + + CanvasPixelArray canvasPixelArray = imageData.getData(); + + for (int i = 0; i < canvasPixelArray.getLength(); i += 4) { + canvasPixelArray.set(i, red); + canvasPixelArray.set(i + 1, green); + canvasPixelArray.set(i + 2, blue); + canvasPixelArray.set(i + 3, + canvasPixelArray.get(i + 3)); + } + context.putImageData(imageData, 0, 0); + imageConverterCallback.onSuccess(new ConvertedImageResource( + canvas.toDataUrl("image/png"), resource.getWidth(), + resource.getHeight())); + } + catch(Throwable e) + { + this.onFailure(e); + } + } + }); - return new ConvertedImageResource( - canvas.toDataUrl("image/png"), resource.getWidth(), - resource.getHeight()); } - protected native ImageElement loadImage(String dataUrl, int width, int height) /*-{ + protected native void loadImage(String dataUrl, int width, int height, LoadImageCallback callback) /*-{ var img = new Image(); img.width = width; img.height = height; img.src = dataUrl; - return img; + img.onload = $entry(function(){ + callback.@com.googlecode.mgwt.image.client.LoadImageCallback::onSuccess(Lcom/google/gwt/dom/client/ImageElement;)(img); + }); + img.onerror = $entry(function(e){ + callback.@com.googlecode.mgwt.image.client.LoadImageCallback::onFailure(Ljava/lang/Throwable;)(e); + }); + img.onabort = $entry(function(e){ + callback.@com.googlecode.mgwt.image.client.LoadImageCallback::onFailure(Ljava/lang/Throwable;)(e); + }); }-*/; } diff --git a/src/main/java/com/googlecode/mgwt/image/client/ImageConverterCallback.java b/src/main/java/com/googlecode/mgwt/image/client/ImageConverterCallback.java new file mode 100644 index 000000000..6a5754627 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/image/client/ImageConverterCallback.java @@ -0,0 +1,8 @@ +package com.googlecode.mgwt.image.client; + +import com.google.gwt.resources.client.ImageResource; + +public interface ImageConverterCallback{ + public void onSuccess(ImageResource imageResource); + public void onFailure(Throwable e); +} diff --git a/src/main/java/com/googlecode/mgwt/image/client/LoadImageCallback.java b/src/main/java/com/googlecode/mgwt/image/client/LoadImageCallback.java new file mode 100644 index 000000000..aafdb1dda --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/image/client/LoadImageCallback.java @@ -0,0 +1,8 @@ +package com.googlecode.mgwt.image.client; + +import com.google.gwt.dom.client.ImageElement; + +public interface LoadImageCallback{ + public void onSuccess(ImageElement imageElement); + public void onFailure(Throwable e); +} diff --git a/src/main/java/com/googlecode/mgwt/ui/UI.gwt.xml b/src/main/java/com/googlecode/mgwt/ui/UI.gwt.xml index 00b36e544..b168089c0 100644 --- a/src/main/java/com/googlecode/mgwt/ui/UI.gwt.xml +++ b/src/main/java/com/googlecode/mgwt/ui/UI.gwt.xml @@ -53,10 +53,6 @@ under * the License. - - - - @@ -65,16 +61,23 @@ under * the License. - + - + + + + + + + + @@ -103,10 +106,34 @@ under * the License. + + + + + + + + + + + + + + + + + + + + + + + + @@ -160,8 +187,20 @@ under * the License. + + + + + + + + + + + + diff --git a/src/main/java/com/googlecode/mgwt/ui/client/MGWT.java b/src/main/java/com/googlecode/mgwt/ui/client/MGWT.java index c940e96cf..52880b8c8 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/MGWT.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/MGWT.java @@ -33,7 +33,6 @@ import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.RootPanel; - import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeEvent; import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeEvent.ORIENTATION; import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeHandler; @@ -151,6 +150,25 @@ public static void applySettings(MGWTSettings settings) { } scrollingDisabled = settings.isPreventScrolling(); + + if (TouchSupport.isTouchEventsEmulatedUsingPointerEvents()) + { + MetaElement ieCompatible = Document.get().createMetaElement(); + ieCompatible.setHttpEquiv("x-ua-compatible"); + ieCompatible.setContent("IE=10"); + head.appendChild(ieCompatible); + + MetaElement tapHighlight = Document.get().createMetaElement(); + tapHighlight.setName("msapplication-tap-highlight"); + tapHighlight.setContent("no"); + head.appendChild(tapHighlight); + + if (settings.isPreventScrolling()) { + BodyElement body = Document.get().getBody(); + setupPreventScrollingIE10(body); + } + } + if (settings.isPreventScrolling() && getOsDetection().isIOs()) { BodyElement body = Document.get().getBody(); setupPreventScrolling(body); @@ -296,15 +314,21 @@ private static Element getHead() { } private static native void setupPreventScrolling(Element el)/*-{ - var func = function(event) { - event.preventDefault(); - return false; - }; - - el.ontouchmove = func; - + var func = function(event) { + var tagName = event.target.tagName; + if ((tagName == 'INPUT') || (tagName == 'SELECT') || (tagName == 'TEXTAREA')) { + return true; + } + event.preventDefault(); + return false; + }; + el.ontouchmove = func; }-*/; + private static void setupPreventScrollingIE10(Element el) { + el.setAttribute("style", "-ms-touch-action: none;"); + } + /** * A utility method to hide the soft keyboard */ diff --git a/src/main/java/com/googlecode/mgwt/ui/client/OsDetection.java b/src/main/java/com/googlecode/mgwt/ui/client/OsDetection.java index 0c6e3580f..a32b45f94 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/OsDetection.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/OsDetection.java @@ -124,6 +124,13 @@ public interface OsDetection { */ public boolean isPhone(); + /** + * Are we running on Windows Phone 8/8.1/10 + * + * @return + */ + public boolean isWindowsPhone(); + /** * Are we running on a blackberry device * @@ -136,7 +143,9 @@ public interface OsDetection { boolean isAndroid2x(); - boolean isIOS6(); + boolean isIOS6(); + + boolean isAndroid4_3_orLower(); - boolean isAndroid4_3_orLower(); -} + boolean isIEEdge(); +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/OsDetectionRuntimeImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/OsDetectionRuntimeImpl.java index 5118feade..6f9c63544 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/OsDetectionRuntimeImpl.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/OsDetectionRuntimeImpl.java @@ -2,142 +2,169 @@ public class OsDetectionRuntimeImpl implements OsDetection { - @Override - public boolean isAndroid() { - return isAndroidPhone() || isAndroidTablet(); - } - - @Override - public boolean isIPhone() { - String userAgent = getUserAgent(); - if (userAgent.contains("iphone") && getDevicePixelRatio() < 2) { - return true; - } - return false; - } - - @Override - public boolean isIPad() { - String userAgent = getUserAgent(); - if (userAgent.contains("ipad") && getDevicePixelRatio() < 2) { - return true; - } - return false; - } - - @Override - public boolean isIOs() { - return isIPad() || isIPadRetina() || isIPhone() || isRetina(); - } - - @Override - public boolean isRetina() { - String userAgent = getUserAgent(); - if (userAgent.contains("iphone") && getDevicePixelRatio() >= 2) { - return true; - } - return false; - } - - @Override - public boolean isIPadRetina() { - String userAgent = getUserAgent(); - if (userAgent.contains("ipad") && getDevicePixelRatio() >= 2) { - return true; - } - return false; - } - - @Override - public boolean isDesktop() { - return !isIOs() && !isAndroid(); - } - - @Override - public boolean isTablet() { - return isIPad() || isIPadRetina() || isAndroidTablet(); - } - - @Override - public boolean isAndroidTablet() { - String userAgent = getUserAgent(); - if (userAgent.contains("android") && !userAgent.contains("mobile")) { - return true; - } - return false; - } - - @Override - public boolean isAndroidPhone() { - String userAgent = getUserAgent(); - if (userAgent.contains("android") && userAgent.contains("mobile")) { - return true; - } - return false; - } - - @Override - public boolean isPhone() { - return isIPhone() || isRetina() || isAndroidPhone(); - } - - @Override - public boolean isBlackBerry() { - return false; - } - - @Override - public boolean isAndroid4_4_OrHigher() { - String userAgent = getUserAgent(); - if (userAgent.contains("android") && userAgent.contains("chrome")) { - return true; - } - return false; - } - - @Override - public boolean isAndroid2x() { - String userAgent = getUserAgent(); - if (userAgent.contains("android 2.")) { - return true; - } - return false; - } - - native String getUserAgent() /*-{ - return $wnd.navigator.userAgent.toLowerCase(); - }-*/; - - native double getDevicePixelRatio() /*-{ - return $wnd.devicePixelRatio || 1; - }-*/; - - @Override - public boolean isIOS6() { - if(!isIOs()){ - return false; - } - - String userAgent = getUserAgent(); - if (userAgent.contains("os 6_")) { - return true; - } - - return false; - } - - @Override - public boolean isAndroid4_3_orLower() { - if(isAndroid4_4_OrHigher()) - { - return false; - } - - String userAgent = getUserAgent(); - if (userAgent.contains("android")) { - return true; - } - - return false; - } -} + @Override + public boolean isAndroid() { + return isAndroidPhone() || isAndroidTablet(); + } + + @Override + public boolean isIPhone() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && !isWindowsPhone() && userAgent.contains("iphone") && getDevicePixelRatio() < 2) { + return true; + } + return false; + } + + @Override + public boolean isIPad() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && userAgent.contains("ipad") && getDevicePixelRatio() < 2) { + return true; + } + return false; + } + + @Override + public boolean isIOs() { + return isIPad() || isIPadRetina() || isIPhone() || isRetina(); + } + + @Override + public boolean isRetina() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && !isWindowsPhone() && userAgent.contains("iphone") && getDevicePixelRatio() >= 2) { + return true; + } + return false; + } + + @Override + public boolean isIPadRetina() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && userAgent.contains("ipad") && getDevicePixelRatio() >= 2) { + return true; + } + return false; + } + + @Override + public boolean isDesktop() { + return !isIOs() && !isAndroid() && !isWindowsPhone(); + } + + @Override + public boolean isTablet() { + return isIPad() || isIPadRetina() || isAndroidTablet(); + } + + @Override + public boolean isAndroidTablet() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && !isWindowsPhone() && userAgent.contains("android") && !userAgent.contains("mobile")) { + return true; + } + return false; + } + + @Override + public boolean isAndroidPhone() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && !isWindowsPhone() && userAgent.contains("android") && userAgent.contains("mobile")) { + return true; + } + return false; + } + + @Override + public boolean isPhone() { + return isIPhone() || isRetina() || isAndroidPhone() || isWindowsPhone(); + } + + @Override + public boolean isWindowsPhone() { + String userAgent = getUserAgent(); + if (userAgent.contains("windows phone 8") || userAgent.contains("windows phone 10")) { + return true; + } + return false; + } + + @Override + public boolean isBlackBerry() { + return false; + } + + @Override + public boolean isAndroid4_4_OrHigher() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && userAgent.contains("android") && userAgent.contains("chrome")) { + return true; + } + return false; + } + + @Override + public boolean isAndroid2x() { + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && userAgent.contains("android 2.")) { + return true; + } + return false; + } + + native String getUserAgent() /*-{ + return $wnd.navigator.userAgent.toLowerCase(); + }-*/; + + native double getDevicePixelRatio() /*-{ + if (!$wnd.devicePixelRatio) { + if ('deviceXDPI' in $wnd.screen) { + $wnd.devicePixelRatio = $wnd.screen.deviceXDPI + / $wnd.screen.logicalXDPI; + } + } + return $wnd.devicePixelRatio || 1; + }-*/; + + @Override + public boolean isIOS6() { + if (!isIOs()) { + return false; + } + + String userAgent = getUserAgent(); + if (userAgent.contains("os 6_")) { + return true; + } + + return false; + } + + @Override + public boolean isAndroid4_3_orLower() { + if (isAndroid4_4_OrHigher()) { + return false; + } + + String userAgent = getUserAgent(); + if (!isIEEdge(userAgent) && userAgent.contains("android")) { + return true; + } + + return false; + } + + private boolean isIEEdge(String userAgent) { + if (userAgent.contains("edge")) { + return true; + } + return false; + } + + @Override + public boolean isIEEdge() { + return isIEEdge(getUserAgent()); + } + +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/TouchSupport.java b/src/main/java/com/googlecode/mgwt/ui/client/TouchSupport.java new file mode 100644 index 000000000..cf70e7c73 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/TouchSupport.java @@ -0,0 +1,100 @@ +package com.googlecode.mgwt.ui.client; + +import com.google.gwt.core.shared.GWT; + +public abstract class TouchSupport { + + private static TouchSupport impl = GWT.create(TouchSupport.class); + + protected abstract boolean _isTouchEventsEmulatedUsingMouseEvents(); + + protected abstract boolean _isTouchEventsEmulatedUsingPointerEvents(); + + protected abstract boolean _isTouchEventsSupported(); + + public static boolean isTouchEventsEmulatedUsingMouseEvents() { + return impl._isTouchEventsEmulatedUsingMouseEvents(); + } + + public static boolean isTouchEventsEmulatedUsingPointerEvents() { + return impl._isTouchEventsEmulatedUsingPointerEvents(); + } + + public static boolean isTouchEventsSupported() { + return impl._isTouchEventsSupported(); + } + + public static class TouchSupportStandard extends TouchSupport { + + private static boolean hasTouchSupport; + private static TouchSupport delegate; + + static { + hasTouchSupport = hasTouch(); + if (hasTouchSupport) { + delegate = new TouchSupportNative(); + } + } + + private static native boolean hasTouch() /*-{ + return 'ontouchstart' in $doc.documentElement; + }-*/; + + + @Override + protected boolean _isTouchEventsEmulatedUsingMouseEvents() { + if (hasTouchSupport) { + return delegate._isTouchEventsEmulatedUsingMouseEvents(); + } + return true; + } + + @Override + protected boolean _isTouchEventsEmulatedUsingPointerEvents() { + return false; + } + + @Override + protected boolean _isTouchEventsSupported() { + if (hasTouchSupport) { + return delegate._isTouchEventsSupported(); + } + return false; + } + } + + public static class TouchSupportEmulatedPointer extends TouchSupport { + @Override + protected boolean _isTouchEventsEmulatedUsingMouseEvents() { + return false; + } + + @Override + protected boolean _isTouchEventsEmulatedUsingPointerEvents() { + return true; + } + + @Override + protected boolean _isTouchEventsSupported() { + return false; + } + } + + public static class TouchSupportNative extends TouchSupport { + @Override + protected boolean _isTouchEventsEmulatedUsingMouseEvents() { + return false; + } + + @Override + protected boolean _isTouchEventsEmulatedUsingPointerEvents() { + return false; + } + + @Override + protected boolean _isTouchEventsSupported() { + return true; + } + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/animation/AnimationHelper.java b/src/main/java/com/googlecode/mgwt/ui/client/animation/AnimationHelper.java index 38018dd1e..f73efef4a 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/animation/AnimationHelper.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/animation/AnimationHelper.java @@ -24,7 +24,6 @@ import com.googlecode.mgwt.ui.client.widget.animation.AnimationEndCallback; import com.googlecode.mgwt.ui.client.widget.animation.AnimationWidget; - /** * A simple helper class to make the direct use of {@link AnimatableDisplay} * easier. @@ -53,7 +52,8 @@ public AnimationHelper() { /** * Construct an animation helper with a given display * - * @param display the display to use + * @param display + * the display to use */ public AnimationHelper(AnimatableDisplay display) { this.display = display; @@ -62,33 +62,43 @@ public AnimationHelper(AnimatableDisplay display) { initWidget(display.asWidget()); } - /** - * animate to a given widget. If this is called while an animation is running this is a noop. - * - * @param w the widget to animate to - * @param animation the animation to use - */ + /** + * animate to a given widget. If this is called while an animation is + * running this is a noop. + * + * @param w + * the widget to animate to + * @param animation + * the animation to use + */ public void goTo(IsWidget w, Animation animation) { goTo(w, animation, null); } - /** - * animate to a given widget. If this is called while an animation is running this is a noop. - * - * @param w the widget to animate to - * @param animation the animation to use - * @param callback a callback that will be called once the animation is finished - */ + /** + * animate to a given widget. If this is called while an animation is + * running this is a noop. + * + * @param w + * the widget to animate to + * @param animation + * the animation to use + * @param callback + * a callback that will be called once the animation is finished + */ public void goTo(IsWidget w, Animation animation, AnimationEndCallback callback) { goTo(w.asWidget(), animation, callback); } - /** - * animate to a given widget. If this is called while an animation is running this is a noop. - * - * @param w the widget to animate to - * @param animation the animation to use - */ + /** + * animate to a given widget. If this is called while an animation is + * running this is a noop. + * + * @param w + * the widget to animate to + * @param animation + * the animation to use + */ public void goTo(Widget w, Animation animation) { goTo(w, animation, null); } @@ -97,10 +107,12 @@ public void goTo(Widget w, Animation animation) { * animate to a given widget. If this is called while an animation is * running this is a noop. * - * @param w the widget to animate to - * @param animation the animation to use - * @param callback a callback that will be called once the animation is - * finished + * @param w + * the widget to animate to + * @param animation + * the animation to use + * @param callback + * a callback that will be called once the animation is finished */ public void goTo(Widget w, Animation animation, final AnimationEndCallback callback) { if (isAnimating) { @@ -119,13 +131,12 @@ public void goTo(Widget w, Animation animation, final AnimationEndCallback callb @Override public void onAnimationEnd() { isAnimating = false; - if (callback != null) + if (callback != null) { callback.onAnimationEnd(); + } } }); - isFirst = !isFirst; - } /** diff --git a/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditor.java b/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditor.java new file mode 100644 index 000000000..c840d79ee --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditor.java @@ -0,0 +1,112 @@ +/* + * Copyright 2014 Daniel Kurka + * + * 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. + */ +package com.googlecode.mgwt.ui.client.editor; + +import java.text.ParseException; + +import com.google.gwt.editor.client.EditorDelegate; +import com.google.gwt.editor.client.HasEditorDelegate; +import com.google.gwt.editor.client.adapters.TakesValueEditor; +import com.google.gwt.user.client.ui.ValueBoxBase; +import com.googlecode.mgwt.ui.client.widget.base.MValueBoxBase; + +/** + * Adapts the {@link ValueBoxBase} interface to the Editor framework. This + * adapter uses {@link ValueBoxBase#getValueOrThrow()} to report parse errors to + * the Editor framework. + * + * @param + * the type of value to be edited + */ +public class MValueBoxEditor extends TakesValueEditor implements + HasEditorDelegate { + + /** + * Returns a new TakesValueEditor that adapts a {@link ValueBoxBase} instance. + * + * @param valueBox + * a {@link ValueBoxBase} instance to adapt + * @return a ValueBoxEditor instance of the same type as the adapted + * {@link ValueBoxBase} instance + */ + public static MValueBoxEditor of(MValueBoxBase valueBox) { + return new MValueBoxEditor(valueBox); + } + + private EditorDelegate delegate; + private final MValueBoxBase peer; + private T value; + + /** + * Constructs a new ValueBoxEditor that adapts a {@link ValueBoxBase} peer + * instance. + * + * @param peer + * a {@link ValueBoxBase} instance of type T + */ + protected MValueBoxEditor(MValueBoxBase peer) { + super(peer); + this.peer = peer; + } + + /** + * Returns the {@link EditorDelegate} for this instance. + * + * @return an {@link EditorDelegate}, or {@code null} + * @see #setDelegate(EditorDelegate) + */ + public EditorDelegate getDelegate() { + return delegate; + } + + /** + * Calls {@link ValueBoxBase#getValueOrThrow()}. If a {@link ParseException} + * is thrown, it will be available through + * {@link com.google.gwt.editor.client.EditorError#getUserData() + * EditorError.getUserData()}. + * + * @return a value of type T + * @see #setValue(Object) + */ + @Override + public T getValue() { + try { + value = peer.getValueOrThrow(); + } catch (ParseException e) { + // TODO i18n + getDelegate().recordError("Bad value (" + peer.getText() + ")", + peer.getText(), e); + } + return value; + } + + /** + * Sets the {@link EditorDelegate} for this instance. This method is only + * called by the driver. + * + * @param delegate + * an {@link EditorDelegate}, or {@code null} + * @see #getDelegate() + */ + public void setDelegate(EditorDelegate delegate) { + this.delegate = delegate; + } + + @Override + public void setValue(T value) { + peer.setValue(this.value = value); + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditorDecorator.java b/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditorDecorator.java index a5ef8cc84..8007a6353 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditorDecorator.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/editor/MValueBoxEditorDecorator.java @@ -1,5 +1,17 @@ -/** - * +/* + * Copyright 2014 Daniel Kurka + * + * 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. */ package com.googlecode.mgwt.ui.client.editor; @@ -27,7 +39,7 @@ * This MValueBoxEditorDecorator is more or less a copy clone of * {@link ValueBoxEditor} and is needed to do JSR-303 BeanValidation. Only * difference is the child added here must be of type {@link MValueBoxBase}. - * + * *

*

Use in UiBinder Templates

*

@@ -35,12 +47,12 @@ * <e:valuebox> child tag. *

* For example: - * + * *

  * @UiField
  * MValueBoxEditorDecorator<String> name;
  * 
- * + * *
  * <e:MValueBoxEditorDecorator ui:field='name'>
  *   <e:mvaluebox>
@@ -48,123 +60,122 @@
  *   </e:mvaluebox>
  * </e:MValueBoxEditorDecorator>
  * 
- * + * * @param * the type which is edited, i.e. String for {@link MTextBox}. - * + * * @author Christoph Guse - * + * */ public class MValueBoxEditorDecorator extends Composite implements - HasEditorErrors, IsEditor> { - - interface Binder extends UiBinder> { - Binder BINDER = GWT.create(Binder.class); - } - - private ValueBoxEditor editor; - - @UiField - SimplePanel contents; - - @UiField - DivElement errorLabel; - - /** - * Constructs a ValueBoxEditorDecorator, UI is taken from - * MValueBoxEditorDecorator.ui.xml. - */ - @UiConstructor - public MValueBoxEditorDecorator() { - initWidget(Binder.BINDER.createAndBindUi(this)); - } - - /** - * Constructs a ValueBoxEditorDecorator using a {@link ValueBoxBase} widget - * and a {@link ValueBoxEditor} editor. - * - * @param widget - * the widget - * @param editor - * the editor - */ - public MValueBoxEditorDecorator(MValueBoxBase widget, - ValueBoxEditor editor) { - this(); - contents.add(widget); - this.editor = editor; - } - - /** - * Returns the associated {@link ValueBoxEditor}. - * - * @return a {@link ValueBoxEditor} instance - * @see #setEditor(ValueBoxEditor) - */ - @Override - public ValueBoxEditor asEditor() { - return editor; - } - - /** - * Sets the associated {@link ValueBoxEditor}. - * - * @param editor - * a {@link ValueBoxEditor} instance - * @see #asEditor() - */ - public void setEditor(ValueBoxEditor editor) { - this.editor = editor; - } - - /** - * Set the widget that the EditorPanel will display. This method will - * automatically call {@link #setEditor}. - * - * @param widget - * a {@link ValueBoxBase} widget - */ - @UiChild(limit = 1, tagname = "mvaluebox") - public void setMValueBox(MValueBoxBase widget) { - contents.add(widget); - setEditor(widget.asEditor()); - } - - /** - * The default implementation will display, but not consume, received errors - * whose {@link EditorError#getEditor() getEditor()} method returns the - * Editor passed into {@link #setEditor}. - * - * @param errors - * a List of {@link EditorError} instances - */ - @Override - public void showErrors(List errors) { - StringBuilder sb = new StringBuilder(); - for (EditorError error : errors) { - if (error.getEditor().equals(editor)) { - sb.append("\n").append(error.getMessage()); - } - } - - if (sb.length() == 0) { - errorLabel.setInnerText(""); - errorLabel.getStyle().setDisplay(Display.NONE); - return; - } - - errorLabel.setInnerText(sb.substring(1)); - errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); + HasEditorErrors, IsEditor> { + + interface Binder extends UiBinder> { + Binder BINDER = GWT.create(Binder.class); + } + + private ValueBoxEditor editor; + + @UiField + SimplePanel contents; + + @UiField + DivElement errorLabel; + + /** + * Constructs a ValueBoxEditorDecorator, UI is taken from + * MValueBoxEditorDecorator.ui.xml. + */ + @UiConstructor + public MValueBoxEditorDecorator() { + initWidget(Binder.BINDER.createAndBindUi(this)); + } + + /** + * Constructs a ValueBoxEditorDecorator using a {@link ValueBoxBase} widget + * and a {@link ValueBoxEditor} editor. + * + * @param widget + * the widget + * @param editor + * the editor + */ + public MValueBoxEditorDecorator(MValueBoxBase widget, + ValueBoxEditor editor) { + this(); + contents.add(widget); + this.editor = editor; + } + + /** + * Returns the associated {@link ValueBoxEditor}. + * + * @return a {@link ValueBoxEditor} instance + * @see #setEditor(ValueBoxEditor) + */ + @Override + public ValueBoxEditor asEditor() { + return editor; + } + + /** + * Sets the associated {@link ValueBoxEditor}. + * + * @param editor + * a {@link ValueBoxEditor} instance + * @see #asEditor() + */ + public void setEditor(ValueBoxEditor editor) { + this.editor = editor; + } + + /** + * Set the widget that the EditorPanel will display. This method will + * automatically call {@link #setEditor}. + * + * @param widget + * a {@link ValueBoxBase} widget + */ + @UiChild(limit = 1, tagname = "mvaluebox") + public void setMValueBox(MValueBoxBase widget) { + contents.add(widget); + setEditor(widget.asEditor()); + } + + /** + * The default implementation will display, but not consume, received errors + * whose {@link EditorError#getEditor() getEditor()} method returns the Editor + * passed into {@link #setEditor}. + * + * @param errors + * a List of {@link EditorError} instances + */ + @Override + public void showErrors(List errors) { + StringBuilder sb = new StringBuilder(); + for (EditorError error : errors) { + if (error.getEditor().equals(editor)) { + sb.append("\n").append(error.getMessage()); + } } - /** - * Shows the given error message. - * - * @param errorMessage - */ - public void showError(String errorMessage) { - errorLabel.setInnerText(errorMessage); - errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); + if (sb.length() == 0) { + errorLabel.setInnerText(""); + errorLabel.getStyle().setDisplay(Display.NONE); + return; } + errorLabel.setInnerText(sb.substring(1)); + errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); + } + + /** + * Shows the given error message. + * + * @param errorMessage + */ + public void showError(String errorMessage) { + errorLabel.setInnerText(errorMessage); + errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/button/button-android.css b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/button/button-android.css index e38fa487e..4e6ba8d72 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/button/button-android.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/button/button-android.css @@ -18,12 +18,13 @@ @if user.agent gecko1_8 { .mgwt-Button { - \-moz-border-radius: 4px; border-radius: 4px; background-image: literal('-moz-linear-gradient(top, rgb(180, 180, 180), rgb(160, 160, 160))'); + background-image: literal('-ms-linear-gradient(top, rgb(180, 180, 180), rgb(160, 160, 160))'); } .mgwt-Button-active { background-image: literal('-moz-linear-gradient(top, rgb(82, 163, 196), rgb(62, 143, 176))'); + background-image: literal('-ms-linear-gradient(top, rgb(82, 163, 196), rgb(62, 143, 176))'); } } @@ -44,9 +45,11 @@ @if user.agent gecko1_8 { .mgwt-Button-important { background-image: literal('-moz-linear-gradient(top, rgba(255,59,59,0.70), rgba(255,0,0,0.80))'); + background-image: literal('-ms-linear-gradient(top, rgba(255,59,59,0.70), rgba(255,0,0,0.80))'); } .mgwt-Button-important.mgwt-Button-active { background-image: literal('-moz-linear-gradient(top, rgba(255,30,30,0.80), rgba(255,0,0,0.90))'); + background-image: literal('-ms-linear-gradient(top, rgba(255,30,30,0.80), rgba(255,0,0,0.90))'); color: #fff; } } @@ -68,9 +71,11 @@ @if user.agent gecko1_8 { .mgwt-Button-confirm { background-image: literal('-moz-linear-gradient(top, rgba(115,239,115,0.70), rgba(0,150,0,0.80))'); + background-image: literal('-ms-linear-gradient(top, rgba(115,239,115,0.70), rgba(0,150,0,0.80))'); } .mgwt-Button-confirm.mgwt-Button-active { background-image: literal('-moz-linear-gradient(top, rgba(100,220,100,0.70), rgba(0,100,0,0.80))'); + background-image: literal('-ms-linear-gradient(top, rgba(100,220,100,0.70), rgba(0,100,0,0.80))'); color: #fff; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/header/HeaderAndroidAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/header/HeaderAndroidAppearance.java index 9d69cd8c4..df3e99aef 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/header/HeaderAndroidAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/header/HeaderAndroidAppearance.java @@ -9,6 +9,7 @@ public class HeaderAndroidAppearance extends HeaderAbstractAppearance { static { Resources.INSTANCE.cssPanel().ensureInjected(); + Resources.INSTANCE.cssTitle().ensureInjected(); } interface CssPanel extends HeaderPanelCss {} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListAndroidAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListAndroidAppearance.java index 5b427aefc..e6acd2ecb 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListAndroidAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListAndroidAppearance.java @@ -10,6 +10,7 @@ public class GroupingCellListAndroidAppearance extends GroupingCellListAbstractA static { Resources.INSTANCE.css().ensureInjected(); + Resources.INSTANCE.groupCss().ensureInjected(); } interface Css extends CellListCss {} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListIOSAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListIOSAppearance.java index 3f31b0031..8bb359ae9 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListIOSAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/theme/platform/list/celllist/GroupingCellListIOSAppearance.java @@ -3,13 +3,13 @@ import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.DataResource; - import com.googlecode.mgwt.ui.client.widget.list.celllist.GroupingCellListAbstractAppearance; public class GroupingCellListIOSAppearance extends GroupingCellListAbstractAppearance { static { Resources.INSTANCE.css().ensureInjected(); + Resources.INSTANCE.groupCss().ensureInjected(); } interface Css extends CellListCss {} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/util/IconHandler.java b/src/main/java/com/googlecode/mgwt/ui/client/util/IconHandler.java index a5fa29d9a..0941d612d 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/util/IconHandler.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/util/IconHandler.java @@ -19,93 +19,98 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.resources.client.ImageResource; - import com.googlecode.mgwt.image.client.ImageConverter; +import com.googlecode.mgwt.image.client.ImageConverterCallback; import com.googlecode.mgwt.ui.client.MGWT; public class IconHandler { - static { - if (MGWT.getOsDetection().isAndroid4_3_orLower()) { - ICON_HANDLER = new IconHandlerEmulatedImpl(); - } else { - ICON_HANDLER = GWT.create(IconHandlerImpl.class); - } - } - - - private interface IconHandlerImpl { - public void setIcons(Element element, ImageResource icon, String color); - } - - private static class IconHandlerNativeImpl implements IconHandlerImpl { - - protected static class Dimension { - private int width; - private int height; - - public Dimension(int width, int height) { - this.width = width; - this.height = height; - } - } - - @Override - public void setIcons(Element element, ImageResource icon, String color) { - if (icon == null) { - return; - } - - Dimension dimensions = calculateDimensions(icon); - element.getStyle().setProperty("WebkitMaskBoxImage", - "url(" + icon.getSafeUri().asString() + ")"); - element.getStyle().setWidth(dimensions.width, Unit.PX); - element.getStyle().setHeight(dimensions.height, Unit.PX); - element.getStyle().setProperty("WebkitMaskSize", - dimensions.width + "px, " + dimensions.height + "px"); - element.getStyle().setBackgroundColor(color); - } - - protected Dimension calculateDimensions(ImageResource icon) { - int iconWidth = icon.getWidth(); - int iconHeight = icon.getHeight(); - - if (MGWT.getDeviceDensity().isHighDPI()) { - iconWidth /= 1.5; - iconHeight /= 1.5; - } else if (MGWT.getDeviceDensity().isXHighDPI()) { - iconWidth /= 2; - iconHeight /= 2; - } - return new Dimension(iconWidth, iconHeight); - } - } - - private static class IconHandlerEmulatedImpl extends IconHandlerNativeImpl { - - private static final ImageConverter converter = new ImageConverter(); - - @Override - public void setIcons(Element element, ImageResource icon, String color) { - if (icon == null) { - return; - } - - element.getStyle().setBackgroundColor("transparent"); - ImageResource convertImageResource = converter.convert(icon, color); - Dimension dimensions = calculateDimensions(convertImageResource); - element.getStyle().setWidth(dimensions.width, Unit.PX); - element.getStyle().setHeight(dimensions.height, Unit.PX); - element.getStyle().setBackgroundImage( - "url(" + convertImageResource.getSafeUri().asString() + ")"); - element.getStyle().setProperty("backgroundSize", - dimensions.width + "px " + dimensions.height + "px"); - } - } - - private static final IconHandlerImpl ICON_HANDLER; - - public static void setIcons(Element element, ImageResource icon, String color) { - ICON_HANDLER.setIcons(element, icon, color); - } + static { + if (MGWT.getOsDetection().isIEEdge() || MGWT.getOsDetection().isAndroid4_3_orLower()) { + ICON_HANDLER = new IconHandlerEmulatedImpl(); + } else { + ICON_HANDLER = GWT.create(IconHandlerImpl.class); + } + } + + private interface IconHandlerImpl { + public void setIcons(Element element, ImageResource icon, String color); + } + + private static class IconHandlerNativeImpl implements IconHandlerImpl { + + protected static class Dimension { + private int width; + private int height; + + public Dimension(int width, int height) { + this.width = width; + this.height = height; + } + } + + @Override + public void setIcons(Element element, ImageResource icon, String color) { + if (icon == null) { + return; + } + + Dimension dimensions = calculateDimensions(icon); + element.getStyle().setProperty("WebkitMaskBoxImage", "url(" + icon.getSafeUri().asString() + ")"); + element.getStyle().setWidth(dimensions.width, Unit.PX); + element.getStyle().setHeight(dimensions.height, Unit.PX); + element.getStyle().setProperty("WebkitMaskSize", dimensions.width + "px, " + dimensions.height + "px"); + element.getStyle().setBackgroundColor(color); + } + + protected Dimension calculateDimensions(ImageResource icon) { + int iconWidth = icon.getWidth(); + int iconHeight = icon.getHeight(); + + if (MGWT.getDeviceDensity().isHighDPI()) { + iconWidth /= 1.5; + iconHeight /= 1.5; + } else if (MGWT.getDeviceDensity().isXHighDPI()) { + iconWidth /= 2; + iconHeight /= 2; + } + return new Dimension(iconWidth, iconHeight); + } + } + + private static class IconHandlerEmulatedImpl extends IconHandlerNativeImpl { + + private static final ImageConverter converter = new ImageConverter(); + + @Override + public void setIcons(final Element element, ImageResource icon, String color) { + if (icon == null) { + return; + } + + converter.convert(icon, color, new ImageConverterCallback() { + + @Override + public void onFailure(Throwable caught) { + } + + @Override + public void onSuccess(ImageResource convertImageResource) { + element.getStyle().setBackgroundColor("transparent"); + Dimension dimensions = calculateDimensions(convertImageResource); + element.getStyle().setWidth(dimensions.width, Unit.PX); + element.getStyle().setHeight(dimensions.height, Unit.PX); + element.getStyle().setBackgroundImage("url(" + convertImageResource.getSafeUri().asString() + ")"); + element.getStyle().setProperty("backgroundSize", dimensions.width + "px " + dimensions.height + "px"); + } + + }); + } + } + + private static final IconHandlerImpl ICON_HANDLER; + + public static void setIcons(Element element, ImageResource icon, String color) { + ICON_HANDLER.setIcons(element, icon, color); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/util/impl/CssUtilIE10Impl.java b/src/main/java/com/googlecode/mgwt/ui/client/util/impl/CssUtilIE10Impl.java new file mode 100644 index 000000000..2ea02f48e --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/util/impl/CssUtilIE10Impl.java @@ -0,0 +1,130 @@ +package com.googlecode.mgwt.ui.client.util.impl; + +import com.google.gwt.core.client.JsArrayInteger; +import com.google.gwt.dom.client.Element; + +/** + * No idea why but there is a slight difference between Windows Phone 8.1 and + * Windows Phone 8.1 Update. When using translate3d with z=0 getComputedStyle returns + * a 3D matrix on Windows Phone 8.1 but for Windows Phone 8.1 Update it returns + * a 2D matrix. So we check which matrix is returned before using the relevant elements + */ +public class CssUtilIE10Impl implements CssUtilImpl { + + public CssUtilIE10Impl() { + } + + @Override + public void translate(Element el, int x, int y) { + String cssText = "translate3d(" + x + "px," + y + "px,0px)"; + _translate(el, cssText); + } + + @Override + public native void setDelay(Element el, int milliseconds) /*-{ + el.style.transitionDelay = milliseconds + "ms"; + }-*/; + + @Override + public native void setOpacity(Element el, double opacity) /*-{ + el.style.opacity = opacity; + }-*/; + + @Override + public native void setDuration(Element el, int time) /*-{ + el.style.transitionDuration = time + "ms"; + }-*/; + + private native void _translate(Element el, String css)/*-{ + el.style.transform = css; + }-*/; + + @Override + public void rotate(Element el, int degree) { + el.getStyle().setProperty("transform", "rotateZ(" + degree + "deg)"); + } + + @Override + public boolean hasTransform() { + return true; + } + + @Override + public boolean hasTransistionEndEvent() { + return true; + } + + @Override + public boolean has3d() { + return true; + } + + @Override + public String getTransformProperty() { + return "transform"; + } + + @Override + public int[] getPositionFromTransForm(Element element) { + JsArrayInteger array = getPositionFromTransform(element); + return new int[] {array.get(0), array.get(1)}; + } + + private native JsArrayInteger getPositionFromTransform(Element el)/*-{ + var matrix = getComputedStyle(el, null)['transform'].replace( + /[^0-9-.,]/g, '').split(','); + if (matrix.length === 6) { + var x = matrix[4] * 1; + var y = matrix[5] * 1; + return [ x, y ]; + } + else { + var x = matrix[12] * 1; + var y = matrix[13] * 1; + return [ x, y ]; + } + }-*/; + + @Override + public native int getTopPositionFromCssPosition(Element element) /*-{ + return getComputedStyle(element, null).top.replace(/[^0-9-]/g, '') * 1; + }-*/; + + @Override + public native int getLeftPositionFromCssPosition(Element element)/*-{ + return getComputedStyle(element, null).left.replace(/[^0-9-]/g, '') * 1; + }-*/; + + @Override + public native void resetTransform(Element el) /*-{ + el.style.transform = ""; + }-*/; + + @Override + public native void setTransistionProperty(Element element, String string) /*-{ + element.transitionProperty = string; + }-*/; + + @Override + public native void setTransFormOrigin(Element el, int x, int y) /*-{ + el.transformOrigin = x + " " + y; + }-*/; + + @Override + public native void setTransistionTimingFunction(Element element, String string) /*-{ + el.transitionTimingFunction = string; + }-*/; + + @Override + public void setTranslateAndZoom(Element el, int x, int y, double scale) { + String cssText = "translate3d(" + x + "px, " + y + "px,0px) scale(" + scale + ")"; + el.getStyle().setProperty("transform", cssText); + } + + @Override + public void translatePercent(Element el, double x, double y) { + String cssText = "translate3d(" + x + "%, " + y + "%,0%)"; + _translate(el, cssText); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/util/impl/IEOrientationHandler.java b/src/main/java/com/googlecode/mgwt/ui/client/util/impl/IEOrientationHandler.java new file mode 100644 index 000000000..271f16790 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/util/impl/IEOrientationHandler.java @@ -0,0 +1,171 @@ +package com.googlecode.mgwt.ui.client.util.impl; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.dom.client.Document; +import com.google.gwt.event.logical.shared.CloseEvent; +import com.google.gwt.event.logical.shared.CloseHandler; +import com.google.gwt.event.logical.shared.ResizeEvent; +import com.google.gwt.event.logical.shared.ResizeHandler; +import com.google.gwt.user.client.Window; +import com.google.web.bindery.event.shared.EventBus; +import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeEvent; +import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeEvent.ORIENTATION; +import com.googlecode.mgwt.ui.client.util.OrientationHandler; +import com.googlecode.mgwt.ui.client.widget.main.MainResourceAppearance.UtilCss; +import com.googlecode.mgwt.ui.client.widget.main.MainResourceHolder; + +/** + * IE11 on windows 8 or windows phone 8.1 supports orientation events but via + * the Screen object, IE10 on windows phone 8 does not support orientation events. + * IE10 on windows phone/desktop does support resize events but they do not appear to + * fire on wp8 when the viewport is set to device-width. We fallback to resize events anyhow. + */ +public class IEOrientationHandler implements OrientationHandler { + + private static native JavaScriptObject setupOrientation0(IEOrientationHandler handler)/*-{ + var func = $entry(function(evt) { + handler.@com.googlecode.mgwt.ui.client.util.impl.IEOrientationHandler::onorientationChange(Ljava/lang/String;)(evt.target.msOrientation); + }); + $wnd.screen.onmsorientationchange = func; + return func; + }-*/; + + private static native void destroyOrientation(JavaScriptObject o)/*-{ + $wnd.screen.onmsorientationchange = null; + }-*/; + + private boolean orientationSupported = isOrientationSupported(); + + // update styles on body + private static void setClasses(ORIENTATION o) { + + UtilCss utilCss = MainResourceHolder.getUtilCss(); + switch (o) { + + case PORTRAIT: + Document.get().getBody().addClassName(utilCss.portrait()); + Document.get().getBody().removeClassName(utilCss.landscape()); + break; + case LANDSCAPE: + Document.get().getBody().addClassName(utilCss.landscape()); + Document.get().getBody().removeClassName(utilCss.portrait()); + break; + + default: + break; + } + } + + protected static ORIENTATION currentOrientation; + protected static boolean orientationInitialized; + protected JavaScriptObject nativeJsFunction; + + private EventBus manager; + + @Override + public final void maybeSetupOrientation(EventBus manager) { + this.manager = manager; + if (orientationInitialized) + return; + if (!GWT.isClient()) { + return; + } + doSetupOrientation(); + orientationInitialized = true; + setClasses(getOrientation()); + } + + protected void setupNativeBrowerOrientationHandler() { + nativeJsFunction = setupOrientation0(this); + Window.addCloseHandler(new CloseHandler() { + + @Override + public void onClose(CloseEvent event) { + destroyOrientation(nativeJsFunction); + } + }); + } + + protected static native String getOrientation0()/*-{ + if (typeof ($wnd.screen.msOrientation) == 'undefined') { + return "portrait-primary"; + } + return $wnd.screen.msOrientation; + }-*/; + + protected static ORIENTATION getBrowserOrientation() { + String orientation = getOrientation0(); + + ORIENTATION o; + if ("landscape-primary".equals(orientation) || "landscape-secondary".equals(orientation)) { + o = ORIENTATION.LANDSCAPE; + } + else { + o = ORIENTATION.PORTRAIT; + } + return o; + } + + void fireOrientationChangedEvent(ORIENTATION orientation) { + setClasses(orientation); + manager.fireEvent(new OrientationChangeEvent(orientation)); + } + + private void onorientationChange(String orientation) { + ORIENTATION o; + if ("landscape-primary".equals(orientation) || "landscape-secondary".equals(orientation)) { + o = ORIENTATION.LANDSCAPE; + } + else { + o = ORIENTATION.PORTRAIT; + } + currentOrientation = o; + fireOrientationChangedEvent(o); + } + + public void doSetupOrientation() { + + if (!orientationSupported) { + Window.addResizeHandler(new ResizeHandler() { + + @Override + public void onResize(ResizeEvent event) { + ORIENTATION orientation = getOrientation(); + if (orientation != currentOrientation) { + currentOrientation = orientation; + fireOrientationChangedEvent(orientation); + } + } + }); + } else { + setupNativeBrowerOrientationHandler(); + } + + } + + /** + * Get the current orientation of the device + * + * @return the current orientation of the device + */ + public ORIENTATION getOrientation() { + if (!orientationSupported) { + int height = Window.getClientHeight(); + int width = Window.getClientWidth(); + + if (width > height) { + return ORIENTATION.LANDSCAPE; + } else { + return ORIENTATION.PORTRAIT; + } + } else { + return getBrowserOrientation(); + } + } + + private static native boolean isOrientationSupported() /*-{ + return "msOrientation" in $wnd.screen; + }-*/; + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/dissolve.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/dissolve.css index ee13eed55..1f1c5b99b 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/dissolve.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/dissolve.css @@ -2,22 +2,36 @@ -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: 300ms; -webkit-animation-fill-mode: both; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; } .in { -webkit-animation-name: appear; + -moz-animation-name: appear; + -ms-animation-name: appear; } .out { -webkit-animation-name: dissolve; + -moz-animation-name: dissolve; + -ms-animation-name: dissolve; } .in.reverse { -webkit-animation-name: appear; + -moz-animation-name: appear; + -ms-animation-name: appear; } .out.reverse { -webkit-animation-name: dissolve; + -moz-animation-name: dissolve; + -ms-animation-name: dissolve; } @-webkit-keyframes dissolve { @@ -29,3 +43,57 @@ from { opacity: 0; } to { opacity: 1; } } + +@-moz-keyframes dissolve { + from { opacity: 1; } + to { opacity: 0; } +} + +@-moz-keyframes appear { + from { opacity: 0; } + to { opacity: 1; } +} + +@-ms-keyframes dissolve { + from { opacity: 1; } + to { opacity: 0; } +} + +@-ms-keyframes appear { + from { opacity: 0; } + to { opacity: 1; } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + } + + .in { + animation-name: appear; + } + + .out { + animation-name: dissolve; + } + + .in.reverse { + animation-name: appear; + } + + .out.reverse { + animation-name: dissolve; + } + + @keyframes dissolve { + from { opacity: 1; } + to { opacity: 0; } + } + + @keyframes appear { + from { opacity: 0; } + to { opacity: 1; } + } +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/fade.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/fade.css index 602c79db9..44e7d9255 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/fade.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/fade.css @@ -2,21 +2,35 @@ -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: 300ms; -webkit-animation-fill-mode: both; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; } .in { -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -ms-animation-name: fadein; } .out { -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -ms-animation-name: fadeout; } .in.reverse { -webkit-animation-name: fadein; + -moz-animation-name: fadein; + -ms-animation-name: fadein; } .out.reverse { -webkit-animation-name: fadeout; + -moz-animation-name: fadeout; + -ms-animation-name: fadeout; } @-webkit-keyframes fadein { @@ -28,3 +42,56 @@ from { opacity: 1; } to { opacity: 0; } } + +@-moz-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-moz-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +@-ms-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + +@-ms-keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + } + + .in { + animation-name: fadein; + } + .out { + animation-name: fadeout; + } + + .in.reverse { + animation-name: fadein; + } + + .out.reverse { + animation-name: fadeout; + } + + @keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } + } + + @keyframes fadeout { + from { opacity: 1; } + to { opacity: 0; } + } +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/flip.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/flip.css index cb9df89f4..4da248495 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/flip.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/flip.css @@ -4,22 +4,40 @@ -webkit-animation-fill-mode: both; -webkit-animation-duration: .65s; -webkit-backface-visibility: hidden; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -moz-animation-duration: .65s; + -moz-backface-visibility: hidden; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; + -ms-animation-duration: .65s; + -ms-backface-visibility: hidden; } .in { -webkit-animation-name: flipinfromleft; + -moz-animation-name: flipinfromleft; + -ms-animation-name: flipinfromleft; } .out { -webkit-animation-name: flipouttoleft; + -moz-animation-name: flipouttoleft; + -ms-animation-name: flipouttoleft; } .in.reverse { -webkit-animation-name: flipinfromright; + -moz-animation-name: flipinfromright; + -ms-animation-name: flipinfromright; } .out.reverse { -webkit-animation-name: flipouttoright; + -moz-animation-name: flipouttoright; + -ms-animation-name: flipouttoright; } @-webkit-keyframes flipinfromright { @@ -41,3 +59,89 @@ from { -webkit-transform: rotateY(0) scale(1); } to { -webkit-transform: rotateY(180deg) scale(.8); } } + +@-moz-keyframes flipinfromright { + from { -moz-transform: rotateY(-180deg) scale(.8); } + to { -moz-transform: rotateY(0) scale(1); } +} + +@-moz-keyframes flipinfromleft { + from { -moz-transform: rotateY(180deg) scale(.8); } + to { -moz-transform: rotateY(0) scale(1); } +} + +@-moz-keyframes flipouttoleft { + from { -moz-transform: rotateY(0) scale(1); } + to { -moz-transform: rotateY(-180deg) scale(.8); } +} + +@-moz-keyframes flipouttoright { + from { -moz-transform: rotateY(0) scale(1); } + to { -moz-transform: rotateY(180deg) scale(.8); } +} + +@-ms-keyframes flipinfromright { + from { -ms-transform: rotateY(-180deg) scale(.8); } + to { -ms-transform: rotateY(0) scale(1); } +} + +@-ms-keyframes flipinfromleft { + from { -ms-transform: rotateY(180deg) scale(.8); } + to { -ms-transform: rotateY(0) scale(1); } +} + +@-ms-keyframes flipouttoleft { + from { -ms-transform: rotateY(0) scale(1); } + to { -ms-transform: rotateY(-180deg) scale(.8); } +} + +@-ms-keyframes flipouttoright { + from { -ms-transform: rotateY(0) scale(1); } + to { -ms-transform: rotateY(180deg) scale(.8); } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + animation-duration: .65s; + backface-visibility: hidden; + } + + .in { + animation-name: flipinfromleft; + } + + .out { + animation-name: flipouttoleft; + } + + .in.reverse { + animation-name: flipinfromright; + } + + .out.reverse { + animation-name: flipouttoright; + } + + @keyframes flipinfromright { + from { transform: rotateY(-180deg) scale(.8); } + to { transform: rotateY(0) scale(1); } + } + + @keyframes flipinfromleft { + from { transform: rotateY(180deg) scale(.8); } + to { transform: rotateY(0) scale(1); } + } + + @keyframes flipouttoleft { + from { transform: rotateY(0) scale(1); } + to { transform: rotateY(-180deg) scale(.8); } + } + + @keyframes flipouttoright { + from { transform: rotateY(0) scale(1); } + to { transform: rotateY(180deg) scale(.8); } + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/pop.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/pop.css index 58689fa58..7bc4afdee 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/pop.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/pop.css @@ -2,22 +2,36 @@ -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: 300ms; -webkit-animation-fill-mode: both; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; } .in { -webkit-animation-name: popin; + -moz-animation-name: popin; + -ms-animation-name: popin; } .out { -webkit-animation-name: popout; + -moz-animation-name: popout; + -ms-animation-name: popout; } .in.reverse { -webkit-animation-name: popin; + -moz-animation-name: popin; + -ms-animation-name: popin; } .out.reverse { -webkit-animation-name: popout; + -moz-animation-name: popout; + -ms-animation-name: popout; } @-webkit-keyframes popin { @@ -41,3 +55,93 @@ opacity: 0; } } + +@-moz-keyframes popin { + from { + -moz-transform: scale(.3); + opacity: 0; + } + to { + -moz-transform: scale(1); + opacity: 1; + } +} + +@-moz-keyframes popout { + from { + -moz-transform: scale(1); + opacity: 1; + } + to { + -moz-transform: scale(.3); + opacity: 0; + } +} + +@-ms-keyframes popin { + from { + -ms-transform: scale(.3); + opacity: 0; + } + to { + -ms-transform: scale(1); + opacity: 1; + } +} + +@-ms-keyframes popout { + from { + -ms-transform: scale(1); + opacity: 1; + } + to { + -ms-transform: scale(.3); + opacity: 0; + } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + } + + .in { + animation-name: popin; + } + + .out { + animation-name: popout; + } + + .in.reverse { + animation-name: popin; + } + + .out.reverse { + animation-name: popout; + } + + @keyframes popin { + from { + transform: scale(.3); + opacity: 0; + } + to { + transform: scale(1); + opacity: 1; + } + } + + @keyframes popout { + from { + transform: scale(1); + opacity: 1; + } + to { + transform: scale(.3); + opacity: 0; + } + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide-up.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide-up.css index 9fc0ea77e..8cb6ec6cd 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide-up.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide-up.css @@ -2,26 +2,40 @@ -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: 300ms; -webkit-animation-fill-mode: both; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; } .in { -webkit-animation-name: slideupfrombottom; + -moz-animation-name: slideupfrombottom; + -ms-animation-name: slideupfrombottom; z-index: 10; } .out { -webkit-animation-name: slideupfrommiddle; + -moz-animation-name: slideupfrommiddle; + -ms-animation-name: slideupfrommiddle; z-index: 0; } .out.reverse { z-index: 10; -webkit-animation-name: slidedownfrommiddle; + -moz-animation-name: slidedownfrommiddle; + -ms-animation-name: slidedownfrommiddle; } .in.reverse { z-index: 0; -webkit-animation-name: slidedownfromtop; + -moz-animation-name: slidedownfromtop; + -ms-animation-name: slidedownfromtop; } @-webkit-keyframes slideupfrombottom { @@ -43,3 +57,91 @@ from { -webkit-transform: translateY(-100%); } to { -webkit-transform: translateY(0%); } } + +@-moz-keyframes slideupfrombottom { + from { -moz-transform: translateY(100%); } + to { -moz-transform: translateY(0); } +} + +@-moz-keyframes slidedownfrommiddle { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(100%); } +} + +@-moz-keyframes slideupfrommiddle { + from { -moz-transform: translateY(0); } + to { -moz-transform: translateY(-100%); } +} + +@-moz-keyframes slidedownfromtop { + from { -moz-transform: translateY(-100%); } + to { -moz-transform: translateY(0%); } +} + +@-ms-keyframes slideupfrombottom { + from { -ms-transform: translateY(100%); } + to { -ms-transform: translateY(0); } +} + +@-ms-keyframes slidedownfrommiddle { + from { -ms-transform: translateY(0); } + to { -ms-transform: translateY(100%); } +} + +@-ms-keyframes slideupfrommiddle { + from { -ms-transform: translateY(0); } + to { -ms-transform: translateY(-100%); } +} + +@-ms-keyframes slidedownfromtop { + from { -ms-transform: translateY(-100%); } + to { -ms-transform: translateY(0%); } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + } + + .in { + animation-name: slideupfrombottom; + z-index: 10; + } + + .out { + animation-name: slideupfrommiddle; + z-index: 0; + } + + .out.reverse { + z-index: 10; + animation-name: slidedownfrommiddle; + } + + .in.reverse { + z-index: 0; + animation-name: slidedownfromtop; + } + + @keyframes slideupfrombottom { + from { transform: translateY(100%); } + to { transform: translateY(0); } + } + + @keyframes slidedownfrommiddle { + from { transform: translateY(0); } + to { transform: translateY(100%); } + } + + @keyframes slideupfrommiddle { + from { transform: translateY(0); } + to { transform: translateY(-100%); } + } + + @keyframes slidedownfromtop { + from { transform: translateY(-100%); } + to { transform: translateY(0%); } + } +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide.css index 407ff7c55..d97e22fb6 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/slide.css @@ -2,6 +2,12 @@ -webkit-animation-timing-function: ease-in-out; -webkit-animation-duration: 300ms; -webkit-animation-fill-mode: both; + -moz-animation-timing-function: ease-in-out; + -moz-animation-duration: 300ms; + -moz-animation-fill-mode: both; + -ms-animation-timing-function: ease-in-out; + -ms-animation-duration: 300ms; + -ms-animation-fill-mode: both; } .in { @@ -14,18 +20,26 @@ .in { -webkit-animation-name: slideinfromright; + -moz-animation-name: slideinfromright; + -ms-animation-name: slideinfromright; } .out { -webkit-animation-name: slideouttoleft; + -moz-animation-name: slideouttoleft; + -ms-animation-name: slideouttoleft; } .in.reverse { -webkit-animation-name: slideinfromleft; + -moz-animation-name: slideinfromleft; + -ms-animation-name: slideinfromleft; } .out.reverse { -webkit-animation-name: slideouttoright; + -moz-animation-name: slideouttoright; + -ms-animation-name: slideouttoright; } @-webkit-keyframes slideinfromright { @@ -47,3 +61,95 @@ from { -webkit-transform: translateX(0); } to { -webkit-transform: translateX(100%); } } + +@-moz-keyframes slideinfromright { + from { -moz-transform: translateX(100%); } + to { -moz-transform: translateX(0); } +} + +@-moz-keyframes slideinfromleft { + from { -moz-transform: translateX(-100%); } + to { -moz-transform: translateX(0); } +} + +@-moz-keyframes slideouttoleft { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(-100%); } +} + +@-moz-keyframes slideouttoright { + from { -moz-transform: translateX(0); } + to { -moz-transform: translateX(100%); } +} + +@-ms-keyframes slideinfromright { + from { -ms-transform: translateX(100%); } + to { -ms-transform: translateX(0); } +} + +@-ms-keyframes slideinfromleft { + from { -ms-transform: translateX(-100%); } + to { -ms-transform: translateX(0); } +} + +@-ms-keyframes slideouttoleft { + from { -ms-transform: translateX(0); } + to { -ms-transform: translateX(-100%); } +} + +@-ms-keyframes slideouttoright { + from { -ms-transform: translateX(0); } + to { -ms-transform: translateX(100%); } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-duration: 300ms; + animation-fill-mode: both; + } + + .in { + z-index:10; + } + + .out{ + z-index: 0 !important; + } + + .in { + animation-name: slideinfromright; + } + + .out { + animation-name: slideouttoleft; + } + + .in.reverse { + animation-name: slideinfromleft; + } + + .out.reverse { + animation-name: slideouttoright; + } + + @keyframes slideinfromright { + from { transform: translateX(100%); } + to { transform: translateX(0); } + } + + @keyframes slideinfromleft { + from { transform: translateX(-100%); } + to { transform: translateX(0); } + } + + @keyframes slideouttoleft { + from { transform: translateX(0); } + to { transform: translateX(-100%); } + } + + @keyframes slideouttoright { + from { transform: translateX(0); } + to { transform: translateX(100%); } + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/swap.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/swap.css index 18d2e6db5..cb6f1aa70 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/swap.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/bundle/swap.css @@ -4,19 +4,37 @@ -webkit-transform: perspective(800); -webkit-animation-duration: .7s; -webkit-transform-style: preserve-3d; + -moz-animation-timing-function: ease-in-out; + -moz-animation-fill-mode: both; + -moz-transform: perspective(800); + -moz-animation-duration: .7s; + -moz-transform-style: preserve-3d; + -ms-animation-timing-function: ease-in-out; + -ms-animation-fill-mode: both; + -ms-transform: perspective(800); + -ms-animation-duration: .7s; + -ms-transform-style: preserve-3d; } .out { - -webkit-animation-name: swapouttoleft; + -webkit-animation-name: swapouttoleft; + -moz-animation-name: swapouttoleft; + -ms-animation-name: swapouttoleft; } .in { -webkit-animation-name: swapinfromright; + -moz-animation-name: swapinfromright; + -ms-animation-name: swapinfromright; } .out.reverse { -webkit-animation-name: swapouttoright; + -moz-animation-name: swapouttoright; + -ms-animation-name: swapouttoright; } .in.reverse { -webkit-animation-name: swapinfromleft; + -moz-animation-name: swapinfromleft; + -ms-animation-name: swapinfromleft; } @@ -79,3 +97,206 @@ -webkit-transform: translate3d(0px, 0px, 0px) rotateY(0deg); } } + +@-moz-keyframes swapouttoright { + 0% { + -moz-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + -moz-animation-timing-function: ease-in-out; + } + 50% { + -moz-transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + -moz-animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + -moz-transform: translate3d(0px, 0px, -800px) rotateY(70deg); + opacity: 0; + } +} + +@-moz-keyframes swapouttoleft { + 0% { + -moz-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + -moz-animation-timing-function: ease-in-out; + } + 50% { + -moz-transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + -moz-animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + -moz-transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + opacity: 0; + } +} + +@-moz-keyframes swapinfromright { + 0% { + -moz-transform: translate3d(0px, 0px, -800px) rotateY(70deg); + -moz-animation-timing-function: ease-out; + } + 50% { + -moz-transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + -moz-animation-timing-function: ease-in-out; + } + 100% { + -moz-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } +} + +@-moz-keyframes swapinfromleft { + 0% { + -moz-transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + -moz-animation-timing-function: ease-out; + } + 50% { + -moz-transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + -moz-animation-timing-function: ease-in-out; + } + 100% { + -moz-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } +} + +@-ms-keyframes swapouttoright { + 0% { + -ms-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + -ms-animation-timing-function: ease-in-out; + } + 50% { + -ms-transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + -ms-animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + -ms-transform: translate3d(0px, 0px, -800px) rotateY(70deg); + opacity: 0; + } +} + +@-ms-keyframes swapouttoleft { + 0% { + -ms-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + -ms-animation-timing-function: ease-in-out; + } + 50% { + -ms-transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + -ms-animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + -ms-transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + opacity: 0; + } +} + +@-ms-keyframes swapinfromright { + 0% { + -ms-transform: translate3d(0px, 0px, -800px) rotateY(70deg); + -ms-animation-timing-function: ease-out; + } + 50% { + -ms-transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + -ms-animation-timing-function: ease-in-out; + } + 100% { + -ms-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } +} + +@-ms-keyframes swapinfromleft { + 0% { + -ms-transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + -ms-animation-timing-function: ease-out; + } + 50% { + -ms-transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + -ms-animation-timing-function: ease-in-out; + } + 100% { + -ms-transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } +} + +@if user.agent ie10 { + .in, .out { + animation-timing-function: ease-in-out; + animation-fill-mode: both; + transform: perspective(800); + animation-duration: .7s; + } + + .out { + animation-name: swapouttoleft; + } + .in { + animation-name: swapinfromright; + } + .out.reverse { + animation-name: swapouttoright; + } + .in.reverse { + animation-name: swapinfromleft; + } + + + @keyframes swapouttoright { + 0% { + transform: translate3d(0px, 0px, 0px) rotateY(0deg); + animation-timing-function: ease-in-out; + } + 50% { + transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + transform: translate3d(0px, 0px, -800px) rotateY(70deg); + opacity: 0; + } + } + + @keyframes swapouttoleft { + 0% { + transform: translate3d(0px, 0px, 0px) rotateY(0deg); + animation-timing-function: ease-in-out; + } + 50% { + transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + animation-timing-function: ease-in; + opacity: 0.8; + } + 100% { + transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + opacity: 0; + } + } + + @keyframes swapinfromright { + 0% { + transform: translate3d(0px, 0px, -800px) rotateY(70deg); + animation-timing-function: ease-out; + } + 50% { + transform: translate3d(-180px, 0px, -400px) rotateY(20deg); + animation-timing-function: ease-in-out; + } + 100% { + transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } + } + + @keyframes swapinfromleft { + 0% { + transform: translate3d(0px, 0px, -800px) rotateY(-70deg); + animation-timing-function: ease-out; + } + 50% { + transform: translate3d(180px, 0px, -400px) rotateY(-20deg); + animation-timing-function: ease-in-out; + } + 100% { + transform: translate3d(0px, 0px, 0px) rotateY(0deg); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/AnimationWidgetKeyFrameImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/AnimationWidgetKeyFrameImpl.java index b0ff2375e..a5d79a18b 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/AnimationWidgetKeyFrameImpl.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/AnimationWidgetKeyFrameImpl.java @@ -186,7 +186,7 @@ public void setSecondWidget(IsWidget w) { private native void blurBeforeAnimation() /*-{ var node = $doc.querySelector(":focus"); - if (node != null) { + if ((node != null) && !((node.nodeType === 1) && (node.nodeName === "BODY"))) { if (typeof (node.blur) == "function") { node.blur(); } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/animation-display.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/animation-display.css index 7ad9c9954..c1654f75e 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/animation-display.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/animation/impl/animation-display.css @@ -4,6 +4,8 @@ height: 100%; overflow:hidden; -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; } .display { @@ -14,7 +16,44 @@ bottom: 0px; overflow:hidden; -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + -ms-transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + -webkit-transform: translate3d(0,0,0) rotate(0) scale(1); + -moz-transform: translate3d(0,0,0) rotate(0) scale(1); + -ms-transform: translate3d(0,0,0) rotate(0) scale(1); + -webkit-perspective: 800; + -moz-perspective: 800; + -ms-perspective: 800; +} + + +@if user.agent safari { + .displayContainer { + -webkit-backface-visibility: hidden; + } + + .display { + -webkit-transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + -webkit-transform: translate3d(0,0,0) rotate(0) scale(1); + -webkit-perspective: 800; + } +} + +@if user.agent ie10 { + .displayContainer { + backface-visibility: hidden; + } + + .display { + backface-visibility: hidden; + transform: translate3d(0,0,0) rotate(0) scale(1); + perspective: 800; + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/base/MValueBoxBase.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/base/MValueBoxBase.java index 503fdc1d7..b1514792f 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/base/MValueBoxBase.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/base/MValueBoxBase.java @@ -44,6 +44,7 @@ import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HasEnabled; import com.google.gwt.user.client.ui.HasName; +import com.google.gwt.user.client.ui.HasText; import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.ValueBoxBase; import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment; @@ -66,7 +67,7 @@ public class MValueBoxBase extends Composite implements AutoDirectionHandler.Target, HasAllKeyHandlers, HasAutoCapitalize, HasAutoCorrect, HasBlurHandlers, HasChangeHandlers, HasDirectionEstimator, HasEnabled, HasFocusHandlers, HasName, HasPlaceHolder, HasTouchHandlers, - HasValue, IsEditor> { + HasText, HasValue, IsEditor> { public interface HasSource { public void setSource(Object source); diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ButtonBase.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ButtonBase.java index d838e6570..9905dad22 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ButtonBase.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ButtonBase.java @@ -18,12 +18,12 @@ import com.google.gwt.event.dom.client.TouchMoveEvent; import com.google.gwt.event.dom.client.TouchStartEvent; import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.HasText; - import com.googlecode.mgwt.dom.client.event.tap.TapEvent; import com.googlecode.mgwt.dom.client.event.tap.TapHandler; import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; -import com.googlecode.mgwt.ui.client.MGWT; +import com.googlecode.mgwt.ui.client.TouchSupport; import com.googlecode.mgwt.ui.client.widget.touch.TouchWidget; /** @@ -32,7 +32,11 @@ public abstract class ButtonBase extends TouchWidget implements HasText { private boolean active; - + // a temp fix where we no longer add the default touch handlers to the button + // until a call is made to set the element for the widget. This is required since + // it is not possible to add a bitless dom handler until the element has been set + private boolean defaultHandlersAdded; + private final ButtonBaseAppearance baseAppearance; /** @@ -43,56 +47,6 @@ public abstract class ButtonBase extends TouchWidget implements HasText { */ public ButtonBase(ButtonBaseAppearance appearance) { this.baseAppearance = appearance; - - addTouchHandler(new TouchHandler() { - - @Override - public void onTouchCancel(TouchCancelEvent event) { - event.stopPropagation(); - event.preventDefault(); - removeStyleName(ButtonBase.this.baseAppearance.css().active()); - if (MGWT.getFormFactor().isDesktop()) { - DOM.releaseCapture(getElement()); - } - active = false; - } - - @Override - public void onTouchEnd(TouchEndEvent event) { - event.stopPropagation(); - event.preventDefault(); - removeStyleName(ButtonBase.this.baseAppearance.css().active()); - if (MGWT.getFormFactor().isDesktop()) { - DOM.releaseCapture(getElement()); - } - active = false; - } - - @Override - public void onTouchMove(TouchMoveEvent event) { - event.preventDefault(); - event.stopPropagation(); - } - - @Override - public void onTouchStart(TouchStartEvent event) { - event.stopPropagation(); - event.preventDefault(); - addStyleName(ButtonBase.this.baseAppearance.css().active()); - if (MGWT.getFormFactor().isDesktop()) { - DOM.setCapture(getElement()); - } - active = true; - } - }); - - addTapHandler(new TapHandler() { - - @Override - public void onTap(TapEvent event) { - removeStyleName(ButtonBase.this.baseAppearance.css().active()); - } - }); } @Override @@ -108,4 +62,69 @@ public void setText(String text) { public boolean isActive() { return active; } + + @Override + protected void setElement(Element elem) + { + super.setElement(elem); + + if (!defaultHandlersAdded) + { + addTouchHandler(new TouchHandler() { + + @Override + public void onTouchCancel(TouchCancelEvent event) { + event.stopPropagation(); + event.preventDefault(); + removeStyleName(ButtonBase.this.baseAppearance.css().active()); + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.releaseCapture(getElement()); + } + active = false; + } + + @Override + public void onTouchEnd(TouchEndEvent event) { + event.stopPropagation(); + event.preventDefault(); + removeStyleName(ButtonBase.this.baseAppearance.css().active()); + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.releaseCapture(getElement()); + } + active = false; + } + + @Override + public void onTouchMove(TouchMoveEvent event) { + event.preventDefault(); + event.stopPropagation(); + } + + @Override + public void onTouchStart(TouchStartEvent event) { + event.stopPropagation(); + event.preventDefault(); + addStyleName(ButtonBase.this.baseAppearance.css().active()); + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.setCapture(getElement()); + } + active = true; + } + }); + + addTapHandler(new TapHandler() { + + @Override + public void onTap(TapEvent event) { + removeStyleName(ButtonBase.this.baseAppearance.css().active()); + } + }); + defaultHandlersAdded = true; + } + } + + public ButtonBaseAppearance getAppearance() { + return baseAppearance; + } + } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ImageButton.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ImageButton.java index 968de7e4d..4ae230409 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ImageButton.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/ImageButton.java @@ -25,7 +25,6 @@ import com.google.gwt.resources.client.ImageResource; import com.google.gwt.uibinder.client.UiFactory; import com.google.gwt.uibinder.client.UiField; - import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; import com.googlecode.mgwt.ui.client.MGWT; import com.googlecode.mgwt.ui.client.util.IconHandler; @@ -36,122 +35,122 @@ */ public class ImageButton extends ButtonBase implements IsSizeable { - private static final ImageButtonAppearance DEFAULT_BUTTON_APPEARANCE = GWT - .create(ImageButtonAppearance.class); + private static final ImageButtonAppearance DEFAULT_BUTTON_APPEARANCE = GWT.create(ImageButtonAppearance.class); + + private final ImageButtonAppearance appearance; - private final ImageButtonAppearance appearance; + @UiField + public Element text; - @UiField - public Element text; + @UiField + public Element image; - @UiField - public Element image; + private ImageResource icon; - private ImageResource icon; + private String iconColor; - private String iconColor; - - private String iconActiveColor; - - public ImageButton() { - this(DEFAULT_BUTTON_APPEARANCE, ""); - } - - public ImageButton(String text) { - this(DEFAULT_BUTTON_APPEARANCE, text); - } - - public ImageButton(ImageResource icon) { - this(DEFAULT_BUTTON_APPEARANCE, icon, ""); - } - - public ImageButton(ImageButtonAppearance appearance, String text) { - this(appearance, null, text); - } - - public ImageButton(ImageButtonAppearance appearance, ImageResource iconImage, String text) { - super(appearance); - this.appearance = appearance; - setElement(appearance.uiBinder().createAndBindUi(this)); - this.iconColor = appearance.css().ICON_BACKGROUND_COLOR(); - this.iconActiveColor = appearance.css().ICON_BACKGROUND_COLOR_ACTIVE(); - setIcon(iconImage); - - // iOS6 and old android have problems with the aligning in flexible box model with inline-block - // elements - if (MGWT.getOsDetection().isAndroid4_3_orLower() || MGWT.getOsDetection().isIOS6()) { - this.text.getStyle().setDisplay(Display.BLOCK); - } - - addTouchHandler(new TouchHandler() { - - @Override - public void onTouchCancel(TouchCancelEvent event) { - - IconHandler.setIcons(image, icon, iconColor); - } - - @Override - public void onTouchEnd(TouchEndEvent event) { - - IconHandler.setIcons(image, icon, iconColor); - } - - @Override - public void onTouchMove(TouchMoveEvent event) { - } - - @Override - public void onTouchStart(TouchStartEvent event) { - IconHandler.setIcons(image, icon, iconActiveColor); - } - }); - } - - @UiFactory - public ImageButtonAppearance getAppearance() { - return appearance; - } - - @Override - public String getText() { - return text.getInnerText(); - } - - @Override - public void setText(String text) { - this.text.setInnerText(text); - } - - public void setIcon(ImageResource icon) { - this.icon = icon; - updateIcon(); - } - - @Override - public void setSmall(boolean small) { - if (small) { - addStyleName(appearance.css().small()); - } else { - removeStyleName(appearance.css().small()); - } - } - - public void setIconColor(String iconColor) { - this.iconColor = iconColor; - updateIcon(); - } - - public void setIconActiveColor(String iconActiveColor) { - this.iconActiveColor = iconActiveColor; - updateIcon(); - } - - protected void updateIcon() { - if (isActive()) { - IconHandler.setIcons(image, icon, iconActiveColor); - } else { - IconHandler.setIcons(image, icon, iconColor); - } - } + private String iconActiveColor; + + public ImageButton() { + this(DEFAULT_BUTTON_APPEARANCE, ""); + } + + public ImageButton(String text) { + this(DEFAULT_BUTTON_APPEARANCE, text); + } + + public ImageButton(ImageResource icon) { + this(DEFAULT_BUTTON_APPEARANCE, icon, ""); + } + + public ImageButton(ImageButtonAppearance appearance, String text) { + this(appearance, null, text); + } + + public ImageButton(ImageButtonAppearance appearance, ImageResource iconImage, String text) { + super(appearance); + this.appearance = appearance; + setElement(appearance.uiBinder().createAndBindUi(this)); + this.iconColor = appearance.css().ICON_BACKGROUND_COLOR(); + this.iconActiveColor = appearance.css().ICON_BACKGROUND_COLOR_ACTIVE(); + setIcon(iconImage); + + // iOS6 and old android have problems with the aligning in flexible box + // model with inline-block + // elements + if (MGWT.getOsDetection().isAndroid4_3_orLower() || MGWT.getOsDetection().isIOS6()) { + this.text.getStyle().setDisplay(Display.BLOCK); + } + + addTouchHandler(new TouchHandler() { + + @Override + public void onTouchCancel(TouchCancelEvent event) { + + IconHandler.setIcons(image, icon, iconColor); + } + + @Override + public void onTouchEnd(TouchEndEvent event) { + + IconHandler.setIcons(image, icon, iconColor); + } + + @Override + public void onTouchMove(TouchMoveEvent event) { + } + + @Override + public void onTouchStart(TouchStartEvent event) { + IconHandler.setIcons(image, icon, iconActiveColor); + } + }); + } + + @UiFactory + public ImageButtonAppearance getAppearance() { + return appearance; + } + + @Override + public String getText() { + return text.getInnerText(); + } + + @Override + public void setText(String text) { + this.text.setInnerText(text); + } + + public void setIcon(ImageResource icon) { + this.icon = icon; + updateIcon(); + } + + @Override + public void setSmall(boolean small) { + if (small) { + addStyleName(appearance.css().small()); + } else { + removeStyleName(appearance.css().small()); + } + } + + public void setIconColor(String iconColor) { + this.iconColor = iconColor; + updateIcon(); + } + + public void setIconActiveColor(String iconActiveColor) { + this.iconActiveColor = iconActiveColor; + updateIcon(); + } + + protected void updateIcon() { + if (isActive()) { + IconHandler.setIcons(image, icon, iconActiveColor); + } else { + IconHandler.setIcons(image, icon, iconColor); + } + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/button.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/button.css index c288ceda5..9ff119b5e 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/button.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/button.css @@ -8,12 +8,12 @@ color: #454545; display: inline-block; position: relative; - padding: 10px; + padding: 0.2em; margin: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - font-size: 16px; + font-size: 1em; background-color: #e5e9e8; border: 1px solid #9daca9; border-radius: 6px; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/imagebutton.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/imagebutton.css index a8ada1935..51541dcf8 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/button/imagebutton.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/button/imagebutton.css @@ -14,9 +14,10 @@ } } -@if user.agent gecko1_8 { +@if user.agent ie10 { .mgwt-ImageButton { display: -moz-box; + display: -ms-flexbox; } } @@ -32,13 +33,21 @@ max-width: 130px; overflow: hidden; background-color: #e5e9e8; - box-shadow: inset 0 1px #fff; border: 1px solid #9daca9; border-radius: 6px; + box-shadow: inset 0 1px #fff; + -moz-box-shadow: inset 0 1px #fff; + -ms-box-shadow: inset 0 1px #fff; + -o-box-shadow: inset 0 1px #fff; + -webkit-box-shadow: inset 0 1px #fff; } .mgwt-ImageButton-active { box-shadow: inset 0 1px rgba(255, 255, 255, 0.36); + -moz-box-shadow: inset 0 1px rgba(255, 255, 255, 0.36); + -ms-box-shadow: inset 0 1px rgba(255, 255, 255, 0.36); + -o-box-shadow: inset 0 1px rgba(255, 255, 255, 0.36); + -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.36); } .mgwt-ImageButton-disabled { @@ -46,7 +55,7 @@ } .mgwt-ImageButton-image { - z-index: 1; + /*z-index: 1;*/ display: inline-block; background-repeat: no-repeat; height: 32px; @@ -72,6 +81,10 @@ } .mgwt-ImageButton.mgwt-ImageButton-small { + -moz-box-shadow: none; + -ms-box-shadow: none; + -o-box-shadow: none; + -webkit-box-shadow: none; box-shadow: none; border: none; border-radius: 0px; @@ -80,8 +93,12 @@ } .mgwt-ImageButton.mgwt-ImageButton-small.mgwt-ImageButton-active { + -moz-box-shadow: none; + -ms-box-shadow: none; + -o-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; color: #eff1f1; border: none; - box-shadow: none; outline: 0; } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/buttonbar/buttonbar.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/buttonbar/buttonbar.css index 936a6c2a9..f293aab60 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/buttonbar/buttonbar.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/buttonbar/buttonbar.css @@ -23,15 +23,24 @@ .mgwt-ButtonBar { display: -moz-box; -moz-box-orient: horizontal; + display: -ms-flexbox; + -ms-box-orient: horizontal; } } -@if user.agent ie9 ie10 { +@if user.agent ie9 { .mgwt-ButtonBar { display: table; } } +@if user.agent ie10 { + .mgwt-ButtonBar { + display: -ms-flexbox; + -ms-flex-direction: horizontal; + } +} + .mgwt-ButtonBar { display: flex; align-items: center; @@ -46,7 +55,7 @@ font-weight: bold; } -@if user.agent ie9 ie10 { +@if user.agent ie9 { .mgwt-ButtonBar-text { display: table-cell; vertical-align: middle; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/carousel/carousel.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/carousel/carousel.css index b912d0e36..5660f4d55 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/carousel/carousel.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/carousel/carousel.css @@ -15,11 +15,22 @@ } } +@if user.agent ie10 { + .mgwt-Carousel { + display: -ms-flexbox; + -ms-flex: 1 1; + } +} + .mgwt-Carousel { position: relative; flex:1; - flex-flow: column; + flex-direction: column; overflow: visible; + display: -moz-flexbox; + display: -ms-flexbox; + -moz-flex: 1; + -ms-flex: 1 1; } @if user.agent safari { @@ -29,12 +40,22 @@ } } +@if user.agent ie10 { + .mgwt-Carousel-Scroller, .mgwt-Carousel-Container { + -ms-flex: 1 1; + } +} + .mgwt-Carousel-Scroller { flex: 1 + -moz-flex: 1; + -ms-flex: 1 1; } .mgwt-Carousel-Container { flex: 1; + -moz-flex: 1; + -ms-flex: 1 1; } .mgwt-Carousel-Holder { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/options/options-dialog.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/options/options-dialog.css index 25e727cc2..7559d4837 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/options/options-dialog.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/options/options-dialog.css @@ -9,6 +9,14 @@ right: 0px; background-color: rgba(0, 0, 0, 0.9); background-image: literal('-webkit-gradient(linear, 0% 0, 0% 100%, from(rgba(50, 74, 103, 0.9)), color-stop(0.02, rgba(20, 25, 35, 0.9) ), to(rgba(0, 0, 0, 0.0) ) )'); + background-image: literal('-moz-gradient(linear, 0% 0, 0% 100%, from(rgba(50, 74, 103, 0.9)), color-stop(0.02, rgba(20, 25, 35, 0.9) ), to(rgba(0, 0, 0, 0.0) ) )'); + background-image: literal('-ms-gradient(linear, 0% 0, 0% 100%, from(rgba(50, 74, 103, 0.9)), color-stop(0.02, rgba(20, 25, 35, 0.9) ), to(rgba(0, 0, 0, 0.0) ) )'); border-top: 1px solid #030506; padding: 10px; +} + +@if user.agent ie10 { + .mgwt-OptionsDialog { + background-image: linear-gradient(to bottom, rgba(50, 74, 103, 0.9) 0%, rgba(20, 25, 35, 0.9) 2%, rgba(0, 0, 0, 0.0) 100%); + } } \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog-button.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog-button.css index dfb2020ae..db0f13947 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog-button.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog-button.css @@ -3,6 +3,7 @@ @external mgwt-DialogButton-cancel, mgwt-DialogButton-active; } .mgwt-DialogButton { + -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; padding: 9px 13px; @@ -23,13 +24,19 @@ } } +@if user.agent ie10 { + .mgwt-DialogButton { + -ms-flex: 1 1; + } +} + .mgwt-DialogButton-ok, .mgwt-DialogButton-cancel { margin-top: 10px; margin-right: 5px; padding-right: 5px; padding-left: 5px; min-width: 55px; - height: 24px; + height: 100%; line-height: 24px; text-shadow: none; background-color: #288edf; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog.css index 8b45fc404..6737820c2 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/dialog/panel/dialog.css @@ -33,15 +33,38 @@ text-align: center; } +@if user.agent ie10 { + .mgwt-DialogPanel-footer { + display: -ms-flexbox; + -ms-flex-pack: center; + } +} + +@if user.agent safari { + .mgwt-DialogPanel-footer { + display: -webkit-box; /* iOS < 7 && Android < 4.4*/ + display: -webkit-flex; + -webkit-box-pack: center; /* iOS < 7 && Android < 4.4*/ + -webkit-justify-content: center; + } +} + +@if user.agent gecko1_8 { + .mgwt-DialogPanel-footer { + display: -moz-box; + -moz-justify-content: center; + } +} + .mgwt-DialogPanel-footer { margin-top: 10px; - display: -webkit-box; /* iOS < 7 && Android < 4.4*/ - display: -moz-box; - display: -ms-flexbox; - display: -webkit-flex; display: flex; -webkit-box-pack: center; /* iOS < 7 && Android < 4.4*/ -webkit-justify-content: center; + -moz-box-pack: center; /* iOS < 7 && Android < 4.4*/ -moz-justify-content: center; + -ms-box-pack: center; /* iOS < 7 && Android < 4.4*/ + -ms-justify-content: center; justify-content: center; } + diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/form/form.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/form/form.css index cfe769c52..b9a79e75a 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/form/form.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/form/form.css @@ -27,12 +27,19 @@ } } +@if user.agent ie10 { + .mgwt-Form-Entry { + display: -ms-flexbox; + -ms-flex-pack: center; + } +} + @if user.agent gecko1_8 { .mgwt-Form-Entry { width: 100%; -moz-justify-content: center; + -ms-justify-content: center; display: -moz-box; - display: -ms-flexbox; /* IE is in FF permutation */ } } @@ -57,10 +64,18 @@ } } +@if user.agent ie10 { + .mgwt-Form-Entry-label { + width: 30%; + display: -ms-flexbox; + } +} + @if user.agent gecko1_8 { .mgwt-Form-Entry-label { width: 30%; display: -moz-box; + display: -ms-flexbox; } } @@ -81,11 +96,20 @@ } } +@if user.agent ie10 { + .mgwt-Form-Entry-container { + -ms-flex: 1 1; + -ms-flex-pack: end; + display: -ms-flexbox; + } +} + @if user.agent gecko1_8 { .mgwt-Form-Entry-container { -moz-box-flex: 1; -moz-box-pack: end; display: -moz-box; + display: -ms-flexbox; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolder.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolder.java index 760f02217..f1b229045 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolder.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolder.java @@ -15,305 +15,306 @@ import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ImageResource; - import com.googlecode.mgwt.ui.client.widget.image.ImageHolder.ImageHolderAppearance.Images; public class ImageHolder { - private static final ImageHolderAppearance APPEARANCE = GWT.create(ImageHolderAppearance.class); + private static final ImageHolderAppearance APPEARANCE = GWT.create(ImageHolderAppearance.class); + + public interface ImageHolderAppearance { + public interface Images { + ImageResource about(); - public interface ImageHolderAppearance { - public interface Images { - ImageResource about(); + ImageResource accept(); - ImageResource accept(); + ImageResource accounts(); - ImageResource accounts(); + ImageResource addAlarm(); - ImageResource addAlarm(); + ImageResource addGroup(); - ImageResource addGroup(); + ImageResource addPerson(); - ImageResource addPerson(); + ImageResource addToQueue(); - ImageResource addToQueue(); + ImageResource airplaneModeOff(); - ImageResource airplaneModeOff(); + ImageResource airplaneModeOn(); - ImageResource airplaneModeOn(); + ImageResource alarms(); - ImageResource alarms(); + ImageResource attachment(); - ImageResource attachment(); + ImageResource back(); - ImageResource back(); + ImageResource backspace(); - ImageResource backspace(); + ImageResource bad(); - ImageResource bad(); + ImageResource battery(); - ImageResource battery(); + ImageResource bightnessLow(); - ImageResource bightnessLow(); + ImageResource bluetoothConnected(); - ImageResource bluetoothConnected(); + ImageResource bluetooth(); - ImageResource bluetooth(); + ImageResource bluetoothSearching(); - ImageResource bluetoothSearching(); + ImageResource brightnessAuto(); - ImageResource brightnessAuto(); + ImageResource brightnessHigh(); - ImageResource brightnessHigh(); + ImageResource brightnessMedium(); - ImageResource brightnessMedium(); + ImageResource call(); - ImageResource call(); + ImageResource camera(); - ImageResource camera(); + ImageResource cancel(); - ImageResource cancel(); + ImageResource cast(); - ImageResource cast(); + ImageResource ccBcc(); - ImageResource ccBcc(); + ImageResource chat(); - ImageResource chat(); + ImageResource cloud(); - ImageResource cloud(); + ImageResource collapse(); - ImageResource collapse(); + ImageResource collection(); - ImageResource collection(); + ImageResource computer(); - ImageResource computer(); + ImageResource copy(); - ImageResource copy(); + ImageResource crop(); - ImageResource crop(); + ImageResource cut(); - ImageResource cut(); + ImageResource dataUsage(); - ImageResource dataUsage(); + ImageResource dialPad(); - ImageResource dialPad(); + ImageResource directions(); - ImageResource directions(); + ImageResource discard(); - ImageResource discard(); + ImageResource dock(); - ImageResource dock(); + ImageResource download(); - ImageResource download(); + ImageResource edit(); - ImageResource edit(); + ImageResource email(); - ImageResource email(); + ImageResource endCall(); - ImageResource endCall(); + ImageResource error(); - ImageResource error(); + ImageResource event(); - ImageResource event(); + ImageResource expand(); - ImageResource expand(); + ImageResource fastForward(); - ImageResource fastForward(); + ImageResource favorite(); - ImageResource favorite(); + ImageResource flashAutomatic(); - ImageResource flashAutomatic(); + ImageResource flashOff(); - ImageResource flashOff(); + ImageResource flashOn(); - ImageResource flashOn(); + ImageResource forward(); - ImageResource forward(); + ImageResource fullScreen(); - ImageResource fullScreen(); + ImageResource gamepad(); - ImageResource gamepad(); + ImageResource goToToday(); - ImageResource goToToday(); + ImageResource good(); - ImageResource good(); + ImageResource group(); - ImageResource group(); + ImageResource halfImportant(); - ImageResource halfImportant(); + ImageResource headphones(); - ImageResource headphones(); + ImageResource headset(); - ImageResource headset(); + ImageResource help(); - ImageResource help(); + ImageResource importExport(); - ImageResource importExport(); + ImageResource important(); - ImageResource important(); + ImageResource keyboard(); - ImageResource keyboard(); + ImageResource labels(); - ImageResource labels(); + ImageResource locationFound(); - ImageResource locationFound(); + ImageResource locationOff(); - ImageResource locationOff(); + ImageResource locationSearching(); - ImageResource locationSearching(); + ImageResource makeAvailableOffline(); - ImageResource makeAvailableOffline(); + ImageResource map(); - ImageResource map(); + ImageResource merge(); - ImageResource merge(); + ImageResource mic(); - ImageResource mic(); + ImageResource micMuted(); - ImageResource micMuted(); + ImageResource mouse(); - ImageResource mouse(); + ImageResource networkCell(); - ImageResource networkCell(); + ImageResource networkWifi(); - ImageResource networkWifi(); + ImageResource newAccount(); - ImageResource newAccount(); + ImageResource newAttachment(); - ImageResource newAttachment(); + ImageResource newEmail(); - ImageResource newEmail(); + ImageResource newEvent(); - ImageResource newEvent(); + ImageResource newItem(); - ImageResource newItem(); + ImageResource newLabel(); - ImageResource newLabel(); + ImageResource newPicture(); - ImageResource newPicture(); + ImageResource next(); - ImageResource next(); + ImageResource nextItem(); - ImageResource nextItem(); + ImageResource notImportant(); - ImageResource notImportant(); + ImageResource notSecure(); - ImageResource notSecure(); + ImageResource overflow(); - ImageResource overflow(); + ImageResource paste(); - ImageResource paste(); + ImageResource pause(); - ImageResource pause(); + ImageResource pauseOverVideo(); - ImageResource pauseOverVideo(); + ImageResource person(); - ImageResource person(); + ImageResource phone(); - ImageResource phone(); + ImageResource picture(); - ImageResource picture(); + ImageResource place(); - ImageResource place(); + ImageResource play(); - ImageResource play(); + ImageResource playOverVideo(); - ImageResource playOverVideo(); + ImageResource previous(); - ImageResource previous(); + ImageResource previousItem(); - ImageResource previousItem(); + ImageResource print(); - ImageResource read(); + ImageResource read(); - ImageResource refresh(); + ImageResource refresh(); - ImageResource remove(); + ImageResource remove(); - ImageResource repeat(); + ImageResource repeat(); - ImageResource replay(); + ImageResource replay(); - ImageResource replyAll(); + ImageResource replyAll(); - ImageResource reply(); + ImageResource reply(); - ImageResource returnFromFullScreen(); + ImageResource returnFromFullScreen(); - ImageResource rewind(); + ImageResource rewind(); - ImageResource ringVolume(); + ImageResource ringVolume(); - ImageResource rotateLeft(); + ImageResource rotateLeft(); - ImageResource rotateRight(); + ImageResource rotateRight(); - ImageResource save(); + ImageResource save(); - ImageResource screenLockedToLandscape(); + ImageResource screenLockedToLandscape(); - ImageResource screenLockedToPortrait(); + ImageResource screenLockedToPortrait(); - ImageResource screenRotation(); + ImageResource screenRotation(); - ImageResource sdStorage(); + ImageResource sdStorage(); - ImageResource search(); + ImageResource search(); - ImageResource secure(); + ImageResource secure(); - ImageResource selectAll(); + ImageResource selectAll(); - ImageResource sendNow(); + ImageResource sendNow(); - ImageResource settings(); + ImageResource settings(); - ImageResource share(); + ImageResource share(); - ImageResource shuffle(); + ImageResource shuffle(); - ImageResource slideshow(); + ImageResource slideshow(); - ImageResource sortBySize(); + ImageResource sortBySize(); - ImageResource split(); + ImageResource split(); - ImageResource stop(); + ImageResource stop(); - ImageResource storage(); + ImageResource storage(); - ImageResource switchCamera(); + ImageResource switchCamera(); - ImageResource switchVideo(); + ImageResource switchVideo(); - ImageResource time(); + ImageResource time(); - ImageResource undo(); + ImageResource undo(); - ImageResource unread(); + ImageResource unread(); - ImageResource upload(); + ImageResource upload(); - ImageResource usb(); + ImageResource usb(); - ImageResource video(); + ImageResource video(); - ImageResource viewAsGrid(); + ImageResource viewAsGrid(); - ImageResource viewAsList(); + ImageResource viewAsList(); - ImageResource volumeMuted(); + ImageResource volumeMuted(); - ImageResource volumeOn(); + ImageResource volumeOn(); - ImageResource warning(); + ImageResource warning(); - ImageResource webSite(); - } + ImageResource webSite(); + } - Images get(); - } + Images get(); + } - public static Images get() { - return APPEARANCE.get(); - } + public static Images get() { + return APPEARANCE.get(); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultAppearance.java index 6c65c9805..eb68905dc 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultAppearance.java @@ -18,448 +18,449 @@ import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; - import com.googlecode.mgwt.ui.client.widget.image.ImageHolder.ImageHolderAppearance; public class ImageHolderDefaultAppearance implements ImageHolderAppearance { - interface Resources extends ClientBundle, Images { + interface Resources extends ClientBundle, Images { - Resources INSTANCE = GWT.create(Resources.class); + Resources INSTANCE = GWT.create(Resources.class); - @Source("resources/ic_action_about_mdpi.png") - ImageResource about(); + @Source("resources/ic_action_about_mdpi.png") + ImageResource about(); - @Source("resources/ic_action_accept_mdpi.png") - ImageResource accept(); + @Source("resources/ic_action_accept_mdpi.png") + ImageResource accept(); - @Source("resources/ic_action_accounts_mdpi.png") - ImageResource accounts(); + @Source("resources/ic_action_accounts_mdpi.png") + ImageResource accounts(); - @Source("resources/ic_action_add_alarm_mdpi.png") - ImageResource addAlarm(); + @Source("resources/ic_action_add_alarm_mdpi.png") + ImageResource addAlarm(); - @Source("resources/ic_action_add_group_mdpi.png") - ImageResource addGroup(); + @Source("resources/ic_action_add_group_mdpi.png") + ImageResource addGroup(); - @Source("resources/ic_action_add_person_mdpi.png") - ImageResource addPerson(); + @Source("resources/ic_action_add_person_mdpi.png") + ImageResource addPerson(); - @Source("resources/ic_action_add_to_queue_mdpi.png") - ImageResource addToQueue(); + @Source("resources/ic_action_add_to_queue_mdpi.png") + ImageResource addToQueue(); - @Source("resources/ic_action_airplane_mode_off_mdpi.png") - ImageResource airplaneModeOff(); + @Source("resources/ic_action_airplane_mode_off_mdpi.png") + ImageResource airplaneModeOff(); - @Source("resources/ic_action_airplane_mode_on_mdpi.png") - ImageResource airplaneModeOn(); + @Source("resources/ic_action_airplane_mode_on_mdpi.png") + ImageResource airplaneModeOn(); - @Source("resources/ic_action_alarms_mdpi.png") - ImageResource alarms(); + @Source("resources/ic_action_alarms_mdpi.png") + ImageResource alarms(); - @Source("resources/ic_action_attachment_mdpi.png") - ImageResource attachment(); + @Source("resources/ic_action_attachment_mdpi.png") + ImageResource attachment(); - @Source("resources/ic_action_back_mdpi.png") - ImageResource back(); + @Source("resources/ic_action_back_mdpi.png") + ImageResource back(); - @Source("resources/ic_action_backspace_mdpi.png") - ImageResource backspace(); + @Source("resources/ic_action_backspace_mdpi.png") + ImageResource backspace(); - @Source("resources/ic_action_bad_mdpi.png") - ImageResource bad(); + @Source("resources/ic_action_bad_mdpi.png") + ImageResource bad(); - @Source("resources/ic_action_battery_mdpi.png") - ImageResource battery(); + @Source("resources/ic_action_battery_mdpi.png") + ImageResource battery(); - @Source("resources/ic_action_bightness_low_mdpi.png") - ImageResource bightnessLow(); + @Source("resources/ic_action_bightness_low_mdpi.png") + ImageResource bightnessLow(); - @Source("resources/ic_action_bluetooth_connected_mdpi.png") - ImageResource bluetoothConnected(); + @Source("resources/ic_action_bluetooth_connected_mdpi.png") + ImageResource bluetoothConnected(); - @Source("resources/ic_action_bluetooth_mdpi.png") - ImageResource bluetooth(); + @Source("resources/ic_action_bluetooth_mdpi.png") + ImageResource bluetooth(); - @Source("resources/ic_action_bluetooth_searching_mdpi.png") - ImageResource bluetoothSearching(); + @Source("resources/ic_action_bluetooth_searching_mdpi.png") + ImageResource bluetoothSearching(); - @Source("resources/ic_action_brightness_auto_mdpi.png") - ImageResource brightnessAuto(); + @Source("resources/ic_action_brightness_auto_mdpi.png") + ImageResource brightnessAuto(); - @Source("resources/ic_action_brightness_high_mdpi.png") - ImageResource brightnessHigh(); + @Source("resources/ic_action_brightness_high_mdpi.png") + ImageResource brightnessHigh(); - @Source("resources/ic_action_brightness_medium_mdpi.png") - ImageResource brightnessMedium(); + @Source("resources/ic_action_brightness_medium_mdpi.png") + ImageResource brightnessMedium(); - @Source("resources/ic_action_call_mdpi.png") - ImageResource call(); + @Source("resources/ic_action_call_mdpi.png") + ImageResource call(); - @Source("resources/ic_action_camera_mdpi.png") - ImageResource camera(); + @Source("resources/ic_action_camera_mdpi.png") + ImageResource camera(); - @Source("resources/ic_action_cancel_mdpi.png") - ImageResource cancel(); + @Source("resources/ic_action_cancel_mdpi.png") + ImageResource cancel(); - @Source("resources/ic_action_cast_mdpi.png") - ImageResource cast(); + @Source("resources/ic_action_cast_mdpi.png") + ImageResource cast(); - @Source("resources/ic_action_cc_bcc_mdpi.png") - ImageResource ccBcc(); + @Source("resources/ic_action_cc_bcc_mdpi.png") + ImageResource ccBcc(); - @Source("resources/ic_action_chat_mdpi.png") - ImageResource chat(); + @Source("resources/ic_action_chat_mdpi.png") + ImageResource chat(); - @Source("resources/ic_action_cloud_mdpi.png") - ImageResource cloud(); + @Source("resources/ic_action_cloud_mdpi.png") + ImageResource cloud(); - @Source("resources/ic_action_collapse_mdpi.png") - ImageResource collapse(); + @Source("resources/ic_action_collapse_mdpi.png") + ImageResource collapse(); - @Source("resources/ic_action_collection_mdpi.png") - ImageResource collection(); + @Source("resources/ic_action_collection_mdpi.png") + ImageResource collection(); - @Source("resources/ic_action_computer_mdpi.png") - ImageResource computer(); + @Source("resources/ic_action_computer_mdpi.png") + ImageResource computer(); - @Source("resources/ic_action_copy_mdpi.png") - ImageResource copy(); + @Source("resources/ic_action_copy_mdpi.png") + ImageResource copy(); - @Source("resources/ic_action_crop_mdpi.png") - ImageResource crop(); + @Source("resources/ic_action_crop_mdpi.png") + ImageResource crop(); - @Source("resources/ic_action_cut_mdpi.png") - ImageResource cut(); + @Source("resources/ic_action_cut_mdpi.png") + ImageResource cut(); - @Source("resources/ic_action_data_usage_mdpi.png") - ImageResource dataUsage(); + @Source("resources/ic_action_data_usage_mdpi.png") + ImageResource dataUsage(); - @Source("resources/ic_action_dial_pad_mdpi.png") - ImageResource dialPad(); + @Source("resources/ic_action_dial_pad_mdpi.png") + ImageResource dialPad(); - @Source("resources/ic_action_directions_mdpi.png") - ImageResource directions(); + @Source("resources/ic_action_directions_mdpi.png") + ImageResource directions(); - @Source("resources/ic_action_discard_mdpi.png") - ImageResource discard(); + @Source("resources/ic_action_discard_mdpi.png") + ImageResource discard(); - @Source("resources/ic_action_dock_mdpi.png") - ImageResource dock(); + @Source("resources/ic_action_dock_mdpi.png") + ImageResource dock(); - @Source("resources/ic_action_download_mdpi.png") - ImageResource download(); + @Source("resources/ic_action_download_mdpi.png") + ImageResource download(); - @Source("resources/ic_action_edit_mdpi.png") - ImageResource edit(); + @Source("resources/ic_action_edit_mdpi.png") + ImageResource edit(); - @Source("resources/ic_action_email_mdpi.png") - ImageResource email(); + @Source("resources/ic_action_email_mdpi.png") + ImageResource email(); - @Source("resources/ic_action_end_call_mdpi.png") - ImageResource endCall(); + @Source("resources/ic_action_end_call_mdpi.png") + ImageResource endCall(); - @Source("resources/ic_action_error_mdpi.png") - ImageResource error(); + @Source("resources/ic_action_error_mdpi.png") + ImageResource error(); - @Source("resources/ic_action_event_mdpi.png") - ImageResource event(); + @Source("resources/ic_action_event_mdpi.png") + ImageResource event(); - @Source("resources/ic_action_expand_mdpi.png") - ImageResource expand(); + @Source("resources/ic_action_expand_mdpi.png") + ImageResource expand(); - @Source("resources/ic_action_fast_forward_mdpi.png") - ImageResource fastForward(); + @Source("resources/ic_action_fast_forward_mdpi.png") + ImageResource fastForward(); - @Source("resources/ic_action_favorite_mdpi.png") - ImageResource favorite(); + @Source("resources/ic_action_favorite_mdpi.png") + ImageResource favorite(); - @Source("resources/ic_action_flash_automatic_mdpi.png") - ImageResource flashAutomatic(); + @Source("resources/ic_action_flash_automatic_mdpi.png") + ImageResource flashAutomatic(); - @Source("resources/ic_action_flash_off_mdpi.png") - ImageResource flashOff(); + @Source("resources/ic_action_flash_off_mdpi.png") + ImageResource flashOff(); - @Source("resources/ic_action_flash_on_mdpi.png") - ImageResource flashOn(); + @Source("resources/ic_action_flash_on_mdpi.png") + ImageResource flashOn(); - @Source("resources/ic_action_forward_mdpi.png") - ImageResource forward(); + @Source("resources/ic_action_forward_mdpi.png") + ImageResource forward(); - @Source("resources/ic_action_full_screen_mdpi.png") - ImageResource fullScreen(); + @Source("resources/ic_action_full_screen_mdpi.png") + ImageResource fullScreen(); - @Source("resources/ic_action_gamepad_mdpi.png") - ImageResource gamepad(); + @Source("resources/ic_action_gamepad_mdpi.png") + ImageResource gamepad(); - @Source("resources/ic_action_go_to_today_mdpi.png") - ImageResource goToToday(); + @Source("resources/ic_action_go_to_today_mdpi.png") + ImageResource goToToday(); - @Source("resources/ic_action_good_mdpi.png") - ImageResource good(); + @Source("resources/ic_action_good_mdpi.png") + ImageResource good(); - @Source("resources/ic_action_group_mdpi.png") - ImageResource group(); + @Source("resources/ic_action_group_mdpi.png") + ImageResource group(); - @Source("resources/ic_action_half_important_mdpi.png") - ImageResource halfImportant(); + @Source("resources/ic_action_half_important_mdpi.png") + ImageResource halfImportant(); - @Source("resources/ic_action_headphones_mdpi.png") - ImageResource headphones(); + @Source("resources/ic_action_headphones_mdpi.png") + ImageResource headphones(); - @Source("resources/ic_action_headset_mdpi.png") - ImageResource headset(); + @Source("resources/ic_action_headset_mdpi.png") + ImageResource headset(); - @Source("resources/ic_action_help_mdpi.png") - ImageResource help(); + @Source("resources/ic_action_help_mdpi.png") + ImageResource help(); - @Source("resources/ic_action_import_export_mdpi.png") - ImageResource importExport(); + @Source("resources/ic_action_import_export_mdpi.png") + ImageResource importExport(); - @Source("resources/ic_action_important_mdpi.png") - ImageResource important(); + @Source("resources/ic_action_important_mdpi.png") + ImageResource important(); - @Source("resources/ic_action_keyboard_mdpi.png") - ImageResource keyboard(); + @Source("resources/ic_action_keyboard_mdpi.png") + ImageResource keyboard(); - @Source("resources/ic_action_labels_mdpi.png") - ImageResource labels(); + @Source("resources/ic_action_labels_mdpi.png") + ImageResource labels(); - @Source("resources/ic_action_location_found_mdpi.png") - ImageResource locationFound(); + @Source("resources/ic_action_location_found_mdpi.png") + ImageResource locationFound(); - @Source("resources/ic_action_location_off_mdpi.png") - ImageResource locationOff(); + @Source("resources/ic_action_location_off_mdpi.png") + ImageResource locationOff(); - @Source("resources/ic_action_location_searching_mdpi.png") - ImageResource locationSearching(); + @Source("resources/ic_action_location_searching_mdpi.png") + ImageResource locationSearching(); - @Source("resources/ic_action_make_available_offline_mdpi.png") - ImageResource makeAvailableOffline(); + @Source("resources/ic_action_make_available_offline_mdpi.png") + ImageResource makeAvailableOffline(); - @Source("resources/ic_action_map_mdpi.png") - ImageResource map(); + @Source("resources/ic_action_map_mdpi.png") + ImageResource map(); - @Source("resources/ic_action_merge_mdpi.png") - ImageResource merge(); + @Source("resources/ic_action_merge_mdpi.png") + ImageResource merge(); - @Source("resources/ic_action_mic_mdpi.png") - ImageResource mic(); + @Source("resources/ic_action_mic_mdpi.png") + ImageResource mic(); - @Source("resources/ic_action_mic_muted_mdpi.png") - ImageResource micMuted(); + @Source("resources/ic_action_mic_muted_mdpi.png") + ImageResource micMuted(); - @Source("resources/ic_action_mouse_mdpi.png") - ImageResource mouse(); + @Source("resources/ic_action_mouse_mdpi.png") + ImageResource mouse(); - @Source("resources/ic_action_network_cell_mdpi.png") - ImageResource networkCell(); + @Source("resources/ic_action_network_cell_mdpi.png") + ImageResource networkCell(); - @Source("resources/ic_action_network_wifi_mdpi.png") - ImageResource networkWifi(); + @Source("resources/ic_action_network_wifi_mdpi.png") + ImageResource networkWifi(); - @Source("resources/ic_action_new_account_mdpi.png") - ImageResource newAccount(); + @Source("resources/ic_action_new_account_mdpi.png") + ImageResource newAccount(); - @Source("resources/ic_action_new_attachment_mdpi.png") - ImageResource newAttachment(); + @Source("resources/ic_action_new_attachment_mdpi.png") + ImageResource newAttachment(); - @Source("resources/ic_action_new_email_mdpi.png") - ImageResource newEmail(); + @Source("resources/ic_action_new_email_mdpi.png") + ImageResource newEmail(); - @Source("resources/ic_action_new_event_mdpi.png") - ImageResource newEvent(); + @Source("resources/ic_action_new_event_mdpi.png") + ImageResource newEvent(); - @Source("resources/ic_action_new_label_mdpi.png") - ImageResource newLabel(); + @Source("resources/ic_action_new_label_mdpi.png") + ImageResource newLabel(); - @Source("resources/ic_action_new_mdpi.png") - ImageResource newItem(); + @Source("resources/ic_action_new_mdpi.png") + ImageResource newItem(); - @Source("resources/ic_action_new_picture_mdpi.png") - ImageResource newPicture(); + @Source("resources/ic_action_new_picture_mdpi.png") + ImageResource newPicture(); - @Source("resources/ic_action_next_item_mdpi.png") - ImageResource nextItem(); + @Source("resources/ic_action_next_item_mdpi.png") + ImageResource nextItem(); - @Source("resources/ic_action_next_mdpi.png") - ImageResource next(); + @Source("resources/ic_action_next_mdpi.png") + ImageResource next(); - @Source("resources/ic_action_not_important_mdpi.png") - ImageResource notImportant(); + @Source("resources/ic_action_not_important_mdpi.png") + ImageResource notImportant(); - @Source("resources/ic_action_not_secure_mdpi.png") - ImageResource notSecure(); + @Source("resources/ic_action_not_secure_mdpi.png") + ImageResource notSecure(); - @Source("resources/ic_action_overflow_mdpi.png") - ImageResource overflow(); + @Source("resources/ic_action_overflow_mdpi.png") + ImageResource overflow(); - @Source("resources/ic_action_paste_mdpi.png") - ImageResource paste(); + @Source("resources/ic_action_paste_mdpi.png") + ImageResource paste(); - @Source("resources/ic_action_pause_mdpi.png") - ImageResource pause(); + @Source("resources/ic_action_pause_mdpi.png") + ImageResource pause(); - @Source("resources/ic_action_pause_over_video_mdpi.png") - ImageResource pauseOverVideo(); + @Source("resources/ic_action_pause_over_video_mdpi.png") + ImageResource pauseOverVideo(); - @Source("resources/ic_action_person_mdpi.png") - ImageResource person(); + @Source("resources/ic_action_person_mdpi.png") + ImageResource person(); - @Source("resources/ic_action_phone_mdpi.png") - ImageResource phone(); + @Source("resources/ic_action_phone_mdpi.png") + ImageResource phone(); - @Source("resources/ic_action_picture_mdpi.png") - ImageResource picture(); + @Source("resources/ic_action_picture_mdpi.png") + ImageResource picture(); - @Source("resources/ic_action_place_mdpi.png") - ImageResource place(); + @Source("resources/ic_action_place_mdpi.png") + ImageResource place(); - @Source("resources/ic_action_play_mdpi.png") - ImageResource play(); + @Source("resources/ic_action_play_mdpi.png") + ImageResource play(); - @Source("resources/ic_action_play_over_video_mdpi.png") - ImageResource playOverVideo(); + @Source("resources/ic_action_play_over_video_mdpi.png") + ImageResource playOverVideo(); - @Source("resources/ic_action_previous_item_mdpi.png") - ImageResource previousItem(); + @Source("resources/ic_action_previous_item_mdpi.png") + ImageResource previousItem(); - @Source("resources/ic_action_previous_mdpi.png") - ImageResource previous(); + @Source("resources/ic_action_previous_mdpi.png") + ImageResource previous(); - @Source("resources/ic_action_read_mdpi.png") - ImageResource read(); + @Source("resources/ic_action_print_mdpi.png") + ImageResource print(); - @Source("resources/ic_action_refresh_mdpi.png") - ImageResource refresh(); + @Source("resources/ic_action_read_mdpi.png") + ImageResource read(); - @Source("resources/ic_action_remove_mdpi.png") - ImageResource remove(); + @Source("resources/ic_action_refresh_mdpi.png") + ImageResource refresh(); - @Source("resources/ic_action_repeat_mdpi.png") - ImageResource repeat(); + @Source("resources/ic_action_remove_mdpi.png") + ImageResource remove(); - @Source("resources/ic_action_replay_mdpi.png") - ImageResource replay(); + @Source("resources/ic_action_repeat_mdpi.png") + ImageResource repeat(); - @Source("resources/ic_action_reply_all_mdpi.png") - ImageResource replyAll(); + @Source("resources/ic_action_replay_mdpi.png") + ImageResource replay(); - @Source("resources/ic_action_reply_mdpi.png") - ImageResource reply(); + @Source("resources/ic_action_reply_all_mdpi.png") + ImageResource replyAll(); - @Source("resources/ic_action_return_from_full_screen_mdpi.png") - ImageResource returnFromFullScreen(); + @Source("resources/ic_action_reply_mdpi.png") + ImageResource reply(); - @Source("resources/ic_action_rewind_mdpi.png") - ImageResource rewind(); + @Source("resources/ic_action_return_from_full_screen_mdpi.png") + ImageResource returnFromFullScreen(); - @Source("resources/ic_action_ring_volume_mdpi.png") - ImageResource ringVolume(); + @Source("resources/ic_action_rewind_mdpi.png") + ImageResource rewind(); - @Source("resources/ic_action_rotate_left_mdpi.png") - ImageResource rotateLeft(); + @Source("resources/ic_action_ring_volume_mdpi.png") + ImageResource ringVolume(); - @Source("resources/ic_action_rotate_right_mdpi.png") - ImageResource rotateRight(); + @Source("resources/ic_action_rotate_left_mdpi.png") + ImageResource rotateLeft(); - @Source("resources/ic_action_save_mdpi.png") - ImageResource save(); + @Source("resources/ic_action_rotate_right_mdpi.png") + ImageResource rotateRight(); - @Source("resources/ic_action_screen_locked_to_landscape_mdpi.png") - ImageResource screenLockedToLandscape(); + @Source("resources/ic_action_save_mdpi.png") + ImageResource save(); - @Source("resources/ic_action_screen_locked_to_portrait_mdpi.png") - ImageResource screenLockedToPortrait(); + @Source("resources/ic_action_screen_locked_to_landscape_mdpi.png") + ImageResource screenLockedToLandscape(); - @Source("resources/ic_action_screen_rotation_mdpi.png") - ImageResource screenRotation(); + @Source("resources/ic_action_screen_locked_to_portrait_mdpi.png") + ImageResource screenLockedToPortrait(); - @Source("resources/ic_action_sd_storage_mdpi.png") - ImageResource sdStorage(); + @Source("resources/ic_action_screen_rotation_mdpi.png") + ImageResource screenRotation(); - @Source("resources/ic_action_search_mdpi.png") - ImageResource search(); + @Source("resources/ic_action_sd_storage_mdpi.png") + ImageResource sdStorage(); - @Source("resources/ic_action_secure_mdpi.png") - ImageResource secure(); + @Source("resources/ic_action_search_mdpi.png") + ImageResource search(); - @Source("resources/ic_action_select_all_mdpi.png") - ImageResource selectAll(); + @Source("resources/ic_action_secure_mdpi.png") + ImageResource secure(); - @Source("resources/ic_action_send_now_mdpi.png") - ImageResource sendNow(); + @Source("resources/ic_action_select_all_mdpi.png") + ImageResource selectAll(); - @Source("resources/ic_action_settings_mdpi.png") - ImageResource settings(); + @Source("resources/ic_action_send_now_mdpi.png") + ImageResource sendNow(); - @Source("resources/ic_action_share_mdpi.png") - ImageResource share(); + @Source("resources/ic_action_settings_mdpi.png") + ImageResource settings(); - @Source("resources/ic_action_shuffle_mdpi.png") - ImageResource shuffle(); + @Source("resources/ic_action_share_mdpi.png") + ImageResource share(); - @Source("resources/ic_action_slideshow_mdpi.png") - ImageResource slideshow(); + @Source("resources/ic_action_shuffle_mdpi.png") + ImageResource shuffle(); - @Source("resources/ic_action_sort_by_size_mdpi.png") - ImageResource sortBySize(); + @Source("resources/ic_action_slideshow_mdpi.png") + ImageResource slideshow(); - @Source("resources/ic_action_split_mdpi.png") - ImageResource split(); + @Source("resources/ic_action_sort_by_size_mdpi.png") + ImageResource sortBySize(); - @Source("resources/ic_action_stop_mdpi.png") - ImageResource stop(); + @Source("resources/ic_action_split_mdpi.png") + ImageResource split(); - @Source("resources/ic_action_storage_mdpi.png") - ImageResource storage(); + @Source("resources/ic_action_stop_mdpi.png") + ImageResource stop(); - @Source("resources/ic_action_switch_camera_mdpi.png") - ImageResource switchCamera(); + @Source("resources/ic_action_storage_mdpi.png") + ImageResource storage(); - @Source("resources/ic_action_switch_video_mdpi.png") - ImageResource switchVideo(); + @Source("resources/ic_action_switch_camera_mdpi.png") + ImageResource switchCamera(); - @Source("resources/ic_action_time_mdpi.png") - ImageResource time(); + @Source("resources/ic_action_switch_video_mdpi.png") + ImageResource switchVideo(); - @Source("resources/ic_action_undo_mdpi.png") - ImageResource undo(); + @Source("resources/ic_action_time_mdpi.png") + ImageResource time(); - @Source("resources/ic_action_unread_mdpi.png") - ImageResource unread(); + @Source("resources/ic_action_undo_mdpi.png") + ImageResource undo(); - @Source("resources/ic_action_upload_mdpi.png") - ImageResource upload(); + @Source("resources/ic_action_unread_mdpi.png") + ImageResource unread(); - @Source("resources/ic_action_usb_mdpi.png") - ImageResource usb(); + @Source("resources/ic_action_upload_mdpi.png") + ImageResource upload(); - @Source("resources/ic_action_video_mdpi.png") - ImageResource video(); + @Source("resources/ic_action_usb_mdpi.png") + ImageResource usb(); - @Source("resources/ic_action_view_as_grid_mdpi.png") - ImageResource viewAsGrid(); + @Source("resources/ic_action_video_mdpi.png") + ImageResource video(); - @Source("resources/ic_action_view_as_list_mdpi.png") - ImageResource viewAsList(); + @Source("resources/ic_action_view_as_grid_mdpi.png") + ImageResource viewAsGrid(); - @Source("resources/ic_action_volume_muted_mdpi.png") - ImageResource volumeMuted(); + @Source("resources/ic_action_view_as_list_mdpi.png") + ImageResource viewAsList(); - @Source("resources/ic_action_volume_on_mdpi.png") - ImageResource volumeOn(); + @Source("resources/ic_action_volume_muted_mdpi.png") + ImageResource volumeMuted(); - @Source("resources/ic_action_warning_mdpi.png") - ImageResource warning(); + @Source("resources/ic_action_volume_on_mdpi.png") + ImageResource volumeOn(); - @Source("resources/ic_action_web_site_mdpi.png") - ImageResource webSite(); + @Source("resources/ic_action_warning_mdpi.png") + ImageResource warning(); + @Source("resources/ic_action_web_site_mdpi.png") + ImageResource webSite(); - } + } - @Override - public Images get() { - return Resources.INSTANCE; - } + @Override + public Images get() { + return Resources.INSTANCE; + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultHighAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultHighAppearance.java index d1a5d5092..04bd72401 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultHighAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultHighAppearance.java @@ -18,448 +18,449 @@ import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; - import com.googlecode.mgwt.ui.client.widget.image.ImageHolder.ImageHolderAppearance; public class ImageHolderDefaultHighAppearance implements ImageHolderAppearance { - interface Resources extends ClientBundle, Images { + interface Resources extends ClientBundle, Images { - Resources INSTANCE = GWT.create(Resources.class); + Resources INSTANCE = GWT.create(Resources.class); - @Source("resources/ic_action_about_hdpi.png") - ImageResource about(); + @Source("resources/ic_action_about_hdpi.png") + ImageResource about(); - @Source("resources/ic_action_accept_hdpi.png") - ImageResource accept(); + @Source("resources/ic_action_accept_hdpi.png") + ImageResource accept(); - @Source("resources/ic_action_accounts_hdpi.png") - ImageResource accounts(); + @Source("resources/ic_action_accounts_hdpi.png") + ImageResource accounts(); - @Source("resources/ic_action_add_alarm_hdpi.png") - ImageResource addAlarm(); + @Source("resources/ic_action_add_alarm_hdpi.png") + ImageResource addAlarm(); - @Source("resources/ic_action_add_group_hdpi.png") - ImageResource addGroup(); + @Source("resources/ic_action_add_group_hdpi.png") + ImageResource addGroup(); - @Source("resources/ic_action_add_person_hdpi.png") - ImageResource addPerson(); + @Source("resources/ic_action_add_person_hdpi.png") + ImageResource addPerson(); - @Source("resources/ic_action_add_to_queue_hdpi.png") - ImageResource addToQueue(); + @Source("resources/ic_action_add_to_queue_hdpi.png") + ImageResource addToQueue(); - @Source("resources/ic_action_airplane_mode_off_hdpi.png") - ImageResource airplaneModeOff(); + @Source("resources/ic_action_airplane_mode_off_hdpi.png") + ImageResource airplaneModeOff(); - @Source("resources/ic_action_airplane_mode_on_hdpi.png") - ImageResource airplaneModeOn(); + @Source("resources/ic_action_airplane_mode_on_hdpi.png") + ImageResource airplaneModeOn(); - @Source("resources/ic_action_alarms_hdpi.png") - ImageResource alarms(); + @Source("resources/ic_action_alarms_hdpi.png") + ImageResource alarms(); - @Source("resources/ic_action_attachment_hdpi.png") - ImageResource attachment(); + @Source("resources/ic_action_attachment_hdpi.png") + ImageResource attachment(); - @Source("resources/ic_action_back_hdpi.png") - ImageResource back(); + @Source("resources/ic_action_back_hdpi.png") + ImageResource back(); - @Source("resources/ic_action_backspace_hdpi.png") - ImageResource backspace(); + @Source("resources/ic_action_backspace_hdpi.png") + ImageResource backspace(); - @Source("resources/ic_action_bad_hdpi.png") - ImageResource bad(); + @Source("resources/ic_action_bad_hdpi.png") + ImageResource bad(); - @Source("resources/ic_action_battery_hdpi.png") - ImageResource battery(); + @Source("resources/ic_action_battery_hdpi.png") + ImageResource battery(); - @Source("resources/ic_action_bightness_low_hdpi.png") - ImageResource bightnessLow(); + @Source("resources/ic_action_bightness_low_hdpi.png") + ImageResource bightnessLow(); - @Source("resources/ic_action_bluetooth_connected_hdpi.png") - ImageResource bluetoothConnected(); + @Source("resources/ic_action_bluetooth_connected_hdpi.png") + ImageResource bluetoothConnected(); - @Source("resources/ic_action_bluetooth_hdpi.png") - ImageResource bluetooth(); + @Source("resources/ic_action_bluetooth_hdpi.png") + ImageResource bluetooth(); - @Source("resources/ic_action_bluetooth_searching_hdpi.png") - ImageResource bluetoothSearching(); + @Source("resources/ic_action_bluetooth_searching_hdpi.png") + ImageResource bluetoothSearching(); - @Source("resources/ic_action_brightness_auto_hdpi.png") - ImageResource brightnessAuto(); + @Source("resources/ic_action_brightness_auto_hdpi.png") + ImageResource brightnessAuto(); - @Source("resources/ic_action_brightness_high_hdpi.png") - ImageResource brightnessHigh(); + @Source("resources/ic_action_brightness_high_hdpi.png") + ImageResource brightnessHigh(); - @Source("resources/ic_action_brightness_medium_hdpi.png") - ImageResource brightnessMedium(); + @Source("resources/ic_action_brightness_medium_hdpi.png") + ImageResource brightnessMedium(); - @Source("resources/ic_action_call_hdpi.png") - ImageResource call(); + @Source("resources/ic_action_call_hdpi.png") + ImageResource call(); - @Source("resources/ic_action_camera_hdpi.png") - ImageResource camera(); + @Source("resources/ic_action_camera_hdpi.png") + ImageResource camera(); - @Source("resources/ic_action_cancel_hdpi.png") - ImageResource cancel(); + @Source("resources/ic_action_cancel_hdpi.png") + ImageResource cancel(); - @Source("resources/ic_action_cast_hdpi.png") - ImageResource cast(); + @Source("resources/ic_action_cast_hdpi.png") + ImageResource cast(); - @Source("resources/ic_action_cc_bcc_hdpi.png") - ImageResource ccBcc(); + @Source("resources/ic_action_cc_bcc_hdpi.png") + ImageResource ccBcc(); - @Source("resources/ic_action_chat_hdpi.png") - ImageResource chat(); + @Source("resources/ic_action_chat_hdpi.png") + ImageResource chat(); - @Source("resources/ic_action_cloud_hdpi.png") - ImageResource cloud(); + @Source("resources/ic_action_cloud_hdpi.png") + ImageResource cloud(); - @Source("resources/ic_action_collapse_hdpi.png") - ImageResource collapse(); + @Source("resources/ic_action_collapse_hdpi.png") + ImageResource collapse(); - @Source("resources/ic_action_collection_hdpi.png") - ImageResource collection(); + @Source("resources/ic_action_collection_hdpi.png") + ImageResource collection(); - @Source("resources/ic_action_computer_hdpi.png") - ImageResource computer(); + @Source("resources/ic_action_computer_hdpi.png") + ImageResource computer(); - @Source("resources/ic_action_copy_hdpi.png") - ImageResource copy(); + @Source("resources/ic_action_copy_hdpi.png") + ImageResource copy(); - @Source("resources/ic_action_crop_hdpi.png") - ImageResource crop(); + @Source("resources/ic_action_crop_hdpi.png") + ImageResource crop(); - @Source("resources/ic_action_cut_hdpi.png") - ImageResource cut(); + @Source("resources/ic_action_cut_hdpi.png") + ImageResource cut(); - @Source("resources/ic_action_data_usage_hdpi.png") - ImageResource dataUsage(); + @Source("resources/ic_action_data_usage_hdpi.png") + ImageResource dataUsage(); - @Source("resources/ic_action_dial_pad_hdpi.png") - ImageResource dialPad(); + @Source("resources/ic_action_dial_pad_hdpi.png") + ImageResource dialPad(); - @Source("resources/ic_action_directions_hdpi.png") - ImageResource directions(); + @Source("resources/ic_action_directions_hdpi.png") + ImageResource directions(); - @Source("resources/ic_action_discard_hdpi.png") - ImageResource discard(); + @Source("resources/ic_action_discard_hdpi.png") + ImageResource discard(); - @Source("resources/ic_action_dock_hdpi.png") - ImageResource dock(); + @Source("resources/ic_action_dock_hdpi.png") + ImageResource dock(); - @Source("resources/ic_action_download_hdpi.png") - ImageResource download(); + @Source("resources/ic_action_download_hdpi.png") + ImageResource download(); - @Source("resources/ic_action_edit_hdpi.png") - ImageResource edit(); + @Source("resources/ic_action_edit_hdpi.png") + ImageResource edit(); - @Source("resources/ic_action_email_hdpi.png") - ImageResource email(); + @Source("resources/ic_action_email_hdpi.png") + ImageResource email(); - @Source("resources/ic_action_end_call_hdpi.png") - ImageResource endCall(); + @Source("resources/ic_action_end_call_hdpi.png") + ImageResource endCall(); - @Source("resources/ic_action_error_hdpi.png") - ImageResource error(); + @Source("resources/ic_action_error_hdpi.png") + ImageResource error(); - @Source("resources/ic_action_event_hdpi.png") - ImageResource event(); + @Source("resources/ic_action_event_hdpi.png") + ImageResource event(); - @Source("resources/ic_action_expand_hdpi.png") - ImageResource expand(); + @Source("resources/ic_action_expand_hdpi.png") + ImageResource expand(); - @Source("resources/ic_action_fast_forward_hdpi.png") - ImageResource fastForward(); + @Source("resources/ic_action_fast_forward_hdpi.png") + ImageResource fastForward(); - @Source("resources/ic_action_favorite_hdpi.png") - ImageResource favorite(); + @Source("resources/ic_action_favorite_hdpi.png") + ImageResource favorite(); - @Source("resources/ic_action_flash_automatic_hdpi.png") - ImageResource flashAutomatic(); + @Source("resources/ic_action_flash_automatic_hdpi.png") + ImageResource flashAutomatic(); - @Source("resources/ic_action_flash_off_hdpi.png") - ImageResource flashOff(); + @Source("resources/ic_action_flash_off_hdpi.png") + ImageResource flashOff(); - @Source("resources/ic_action_flash_on_hdpi.png") - ImageResource flashOn(); + @Source("resources/ic_action_flash_on_hdpi.png") + ImageResource flashOn(); - @Source("resources/ic_action_forward_hdpi.png") - ImageResource forward(); + @Source("resources/ic_action_forward_hdpi.png") + ImageResource forward(); - @Source("resources/ic_action_full_screen_hdpi.png") - ImageResource fullScreen(); + @Source("resources/ic_action_full_screen_hdpi.png") + ImageResource fullScreen(); - @Source("resources/ic_action_gamepad_hdpi.png") - ImageResource gamepad(); + @Source("resources/ic_action_gamepad_hdpi.png") + ImageResource gamepad(); - @Source("resources/ic_action_go_to_today_hdpi.png") - ImageResource goToToday(); + @Source("resources/ic_action_go_to_today_hdpi.png") + ImageResource goToToday(); - @Source("resources/ic_action_good_hdpi.png") - ImageResource good(); + @Source("resources/ic_action_good_hdpi.png") + ImageResource good(); - @Source("resources/ic_action_group_hdpi.png") - ImageResource group(); + @Source("resources/ic_action_group_hdpi.png") + ImageResource group(); - @Source("resources/ic_action_half_important_hdpi.png") - ImageResource halfImportant(); + @Source("resources/ic_action_half_important_hdpi.png") + ImageResource halfImportant(); - @Source("resources/ic_action_headphones_hdpi.png") - ImageResource headphones(); + @Source("resources/ic_action_headphones_hdpi.png") + ImageResource headphones(); - @Source("resources/ic_action_headset_hdpi.png") - ImageResource headset(); + @Source("resources/ic_action_headset_hdpi.png") + ImageResource headset(); - @Source("resources/ic_action_help_hdpi.png") - ImageResource help(); + @Source("resources/ic_action_help_hdpi.png") + ImageResource help(); - @Source("resources/ic_action_import_export_hdpi.png") - ImageResource importExport(); + @Source("resources/ic_action_import_export_hdpi.png") + ImageResource importExport(); - @Source("resources/ic_action_important_hdpi.png") - ImageResource important(); + @Source("resources/ic_action_important_hdpi.png") + ImageResource important(); - @Source("resources/ic_action_keyboard_hdpi.png") - ImageResource keyboard(); + @Source("resources/ic_action_keyboard_hdpi.png") + ImageResource keyboard(); - @Source("resources/ic_action_labels_hdpi.png") - ImageResource labels(); + @Source("resources/ic_action_labels_hdpi.png") + ImageResource labels(); - @Source("resources/ic_action_location_found_hdpi.png") - ImageResource locationFound(); + @Source("resources/ic_action_location_found_hdpi.png") + ImageResource locationFound(); - @Source("resources/ic_action_location_off_hdpi.png") - ImageResource locationOff(); + @Source("resources/ic_action_location_off_hdpi.png") + ImageResource locationOff(); - @Source("resources/ic_action_location_searching_hdpi.png") - ImageResource locationSearching(); + @Source("resources/ic_action_location_searching_hdpi.png") + ImageResource locationSearching(); - @Source("resources/ic_action_make_available_offline_hdpi.png") - ImageResource makeAvailableOffline(); + @Source("resources/ic_action_make_available_offline_hdpi.png") + ImageResource makeAvailableOffline(); - @Source("resources/ic_action_map_hdpi.png") - ImageResource map(); + @Source("resources/ic_action_map_hdpi.png") + ImageResource map(); - @Source("resources/ic_action_merge_hdpi.png") - ImageResource merge(); + @Source("resources/ic_action_merge_hdpi.png") + ImageResource merge(); - @Source("resources/ic_action_mic_hdpi.png") - ImageResource mic(); + @Source("resources/ic_action_mic_hdpi.png") + ImageResource mic(); - @Source("resources/ic_action_mic_muted_hdpi.png") - ImageResource micMuted(); + @Source("resources/ic_action_mic_muted_hdpi.png") + ImageResource micMuted(); - @Source("resources/ic_action_mouse_hdpi.png") - ImageResource mouse(); + @Source("resources/ic_action_mouse_hdpi.png") + ImageResource mouse(); - @Source("resources/ic_action_network_cell_hdpi.png") - ImageResource networkCell(); + @Source("resources/ic_action_network_cell_hdpi.png") + ImageResource networkCell(); - @Source("resources/ic_action_network_wifi_hdpi.png") - ImageResource networkWifi(); + @Source("resources/ic_action_network_wifi_hdpi.png") + ImageResource networkWifi(); - @Source("resources/ic_action_new_account_hdpi.png") - ImageResource newAccount(); + @Source("resources/ic_action_new_account_hdpi.png") + ImageResource newAccount(); - @Source("resources/ic_action_new_attachment_hdpi.png") - ImageResource newAttachment(); + @Source("resources/ic_action_new_attachment_hdpi.png") + ImageResource newAttachment(); - @Source("resources/ic_action_new_email_hdpi.png") - ImageResource newEmail(); + @Source("resources/ic_action_new_email_hdpi.png") + ImageResource newEmail(); - @Source("resources/ic_action_new_event_hdpi.png") - ImageResource newEvent(); + @Source("resources/ic_action_new_event_hdpi.png") + ImageResource newEvent(); - @Source("resources/ic_action_new_hdpi.png") - ImageResource newItem(); + @Source("resources/ic_action_new_hdpi.png") + ImageResource newItem(); - @Source("resources/ic_action_new_label_hdpi.png") - ImageResource newLabel(); + @Source("resources/ic_action_new_label_hdpi.png") + ImageResource newLabel(); - @Source("resources/ic_action_new_picture_hdpi.png") - ImageResource newPicture(); + @Source("resources/ic_action_new_picture_hdpi.png") + ImageResource newPicture(); - @Source("resources/ic_action_next_hdpi.png") - ImageResource next(); + @Source("resources/ic_action_next_hdpi.png") + ImageResource next(); - @Source("resources/ic_action_next_item_hdpi.png") - ImageResource nextItem(); + @Source("resources/ic_action_next_item_hdpi.png") + ImageResource nextItem(); - @Source("resources/ic_action_not_important_hdpi.png") - ImageResource notImportant(); + @Source("resources/ic_action_not_important_hdpi.png") + ImageResource notImportant(); - @Source("resources/ic_action_not_secure_hdpi.png") - ImageResource notSecure(); + @Source("resources/ic_action_not_secure_hdpi.png") + ImageResource notSecure(); - @Source("resources/ic_action_overflow_hdpi.png") - ImageResource overflow(); + @Source("resources/ic_action_overflow_hdpi.png") + ImageResource overflow(); - @Source("resources/ic_action_paste_hdpi.png") - ImageResource paste(); + @Source("resources/ic_action_paste_hdpi.png") + ImageResource paste(); - @Source("resources/ic_action_pause_hdpi.png") - ImageResource pause(); + @Source("resources/ic_action_pause_hdpi.png") + ImageResource pause(); - @Source("resources/ic_action_pause_over_video_hdpi.png") - ImageResource pauseOverVideo(); + @Source("resources/ic_action_pause_over_video_hdpi.png") + ImageResource pauseOverVideo(); - @Source("resources/ic_action_person_hdpi.png") - ImageResource person(); + @Source("resources/ic_action_person_hdpi.png") + ImageResource person(); - @Source("resources/ic_action_phone_hdpi.png") - ImageResource phone(); + @Source("resources/ic_action_phone_hdpi.png") + ImageResource phone(); - @Source("resources/ic_action_picture_hdpi.png") - ImageResource picture(); + @Source("resources/ic_action_picture_hdpi.png") + ImageResource picture(); - @Source("resources/ic_action_place_hdpi.png") - ImageResource place(); + @Source("resources/ic_action_place_hdpi.png") + ImageResource place(); - @Source("resources/ic_action_play_hdpi.png") - ImageResource play(); + @Source("resources/ic_action_play_hdpi.png") + ImageResource play(); - @Source("resources/ic_action_play_over_video_hdpi.png") - ImageResource playOverVideo(); + @Source("resources/ic_action_play_over_video_hdpi.png") + ImageResource playOverVideo(); - @Source("resources/ic_action_previous_hdpi.png") - ImageResource previous(); + @Source("resources/ic_action_previous_hdpi.png") + ImageResource previous(); - @Source("resources/ic_action_previous_item_hdpi.png") - ImageResource previousItem(); + @Source("resources/ic_action_previous_item_hdpi.png") + ImageResource previousItem(); - @Source("resources/ic_action_read_hdpi.png") - ImageResource read(); + @Source("resources/ic_action_print_hdpi.png") + ImageResource print(); - @Source("resources/ic_action_refresh_hdpi.png") - ImageResource refresh(); + @Source("resources/ic_action_read_hdpi.png") + ImageResource read(); - @Source("resources/ic_action_remove_hdpi.png") - ImageResource remove(); + @Source("resources/ic_action_refresh_hdpi.png") + ImageResource refresh(); - @Source("resources/ic_action_repeat_hdpi.png") - ImageResource repeat(); + @Source("resources/ic_action_remove_hdpi.png") + ImageResource remove(); - @Source("resources/ic_action_replay_hdpi.png") - ImageResource replay(); + @Source("resources/ic_action_repeat_hdpi.png") + ImageResource repeat(); - @Source("resources/ic_action_reply_all_hdpi.png") - ImageResource replyAll(); + @Source("resources/ic_action_replay_hdpi.png") + ImageResource replay(); - @Source("resources/ic_action_reply_hdpi.png") - ImageResource reply(); + @Source("resources/ic_action_reply_all_hdpi.png") + ImageResource replyAll(); - @Source("resources/ic_action_return_from_full_screen_hdpi.png") - ImageResource returnFromFullScreen(); + @Source("resources/ic_action_reply_hdpi.png") + ImageResource reply(); - @Source("resources/ic_action_rewind_hdpi.png") - ImageResource rewind(); + @Source("resources/ic_action_return_from_full_screen_hdpi.png") + ImageResource returnFromFullScreen(); - @Source("resources/ic_action_ring_volume_hdpi.png") - ImageResource ringVolume(); + @Source("resources/ic_action_rewind_hdpi.png") + ImageResource rewind(); - @Source("resources/ic_action_rotate_left_hdpi.png") - ImageResource rotateLeft(); + @Source("resources/ic_action_ring_volume_hdpi.png") + ImageResource ringVolume(); - @Source("resources/ic_action_rotate_right_hdpi.png") - ImageResource rotateRight(); + @Source("resources/ic_action_rotate_left_hdpi.png") + ImageResource rotateLeft(); - @Source("resources/ic_action_save_hdpi.png") - ImageResource save(); + @Source("resources/ic_action_rotate_right_hdpi.png") + ImageResource rotateRight(); - @Source("resources/ic_action_screen_locked_to_landscape_hdpi.png") - ImageResource screenLockedToLandscape(); + @Source("resources/ic_action_save_hdpi.png") + ImageResource save(); - @Source("resources/ic_action_screen_locked_to_portrait_hdpi.png") - ImageResource screenLockedToPortrait(); + @Source("resources/ic_action_screen_locked_to_landscape_hdpi.png") + ImageResource screenLockedToLandscape(); - @Source("resources/ic_action_screen_rotation_hdpi.png") - ImageResource screenRotation(); + @Source("resources/ic_action_screen_locked_to_portrait_hdpi.png") + ImageResource screenLockedToPortrait(); - @Source("resources/ic_action_sd_storage_hdpi.png") - ImageResource sdStorage(); + @Source("resources/ic_action_screen_rotation_hdpi.png") + ImageResource screenRotation(); - @Source("resources/ic_action_search_hdpi.png") - ImageResource search(); + @Source("resources/ic_action_sd_storage_hdpi.png") + ImageResource sdStorage(); - @Source("resources/ic_action_secure_hdpi.png") - ImageResource secure(); + @Source("resources/ic_action_search_hdpi.png") + ImageResource search(); - @Source("resources/ic_action_select_all_hdpi.png") - ImageResource selectAll(); + @Source("resources/ic_action_secure_hdpi.png") + ImageResource secure(); - @Source("resources/ic_action_send_now_hdpi.png") - ImageResource sendNow(); + @Source("resources/ic_action_select_all_hdpi.png") + ImageResource selectAll(); - @Source("resources/ic_action_settings_hdpi.png") - ImageResource settings(); + @Source("resources/ic_action_send_now_hdpi.png") + ImageResource sendNow(); - @Source("resources/ic_action_share_hdpi.png") - ImageResource share(); + @Source("resources/ic_action_settings_hdpi.png") + ImageResource settings(); - @Source("resources/ic_action_shuffle_hdpi.png") - ImageResource shuffle(); + @Source("resources/ic_action_share_hdpi.png") + ImageResource share(); - @Source("resources/ic_action_slideshow_hdpi.png") - ImageResource slideshow(); + @Source("resources/ic_action_shuffle_hdpi.png") + ImageResource shuffle(); - @Source("resources/ic_action_sort_by_size_hdpi.png") - ImageResource sortBySize(); + @Source("resources/ic_action_slideshow_hdpi.png") + ImageResource slideshow(); - @Source("resources/ic_action_split_hdpi.png") - ImageResource split(); + @Source("resources/ic_action_sort_by_size_hdpi.png") + ImageResource sortBySize(); - @Source("resources/ic_action_stop_hdpi.png") - ImageResource stop(); + @Source("resources/ic_action_split_hdpi.png") + ImageResource split(); - @Source("resources/ic_action_storage_hdpi.png") - ImageResource storage(); + @Source("resources/ic_action_stop_hdpi.png") + ImageResource stop(); - @Source("resources/ic_action_switch_camera_hdpi.png") - ImageResource switchCamera(); + @Source("resources/ic_action_storage_hdpi.png") + ImageResource storage(); - @Source("resources/ic_action_switch_video_hdpi.png") - ImageResource switchVideo(); + @Source("resources/ic_action_switch_camera_hdpi.png") + ImageResource switchCamera(); - @Source("resources/ic_action_time_hdpi.png") - ImageResource time(); + @Source("resources/ic_action_switch_video_hdpi.png") + ImageResource switchVideo(); - @Source("resources/ic_action_undo_hdpi.png") - ImageResource undo(); + @Source("resources/ic_action_time_hdpi.png") + ImageResource time(); - @Source("resources/ic_action_unread_hdpi.png") - ImageResource unread(); + @Source("resources/ic_action_undo_hdpi.png") + ImageResource undo(); - @Source("resources/ic_action_upload_hdpi.png") - ImageResource upload(); + @Source("resources/ic_action_unread_hdpi.png") + ImageResource unread(); - @Source("resources/ic_action_usb_hdpi.png") - ImageResource usb(); + @Source("resources/ic_action_upload_hdpi.png") + ImageResource upload(); - @Source("resources/ic_action_video_hdpi.png") - ImageResource video(); + @Source("resources/ic_action_usb_hdpi.png") + ImageResource usb(); - @Source("resources/ic_action_view_as_grid_hdpi.png") - ImageResource viewAsGrid(); + @Source("resources/ic_action_video_hdpi.png") + ImageResource video(); - @Source("resources/ic_action_view_as_list_hdpi.png") - ImageResource viewAsList(); + @Source("resources/ic_action_view_as_grid_hdpi.png") + ImageResource viewAsGrid(); - @Source("resources/ic_action_volume_muted_hdpi.png") - ImageResource volumeMuted(); + @Source("resources/ic_action_view_as_list_hdpi.png") + ImageResource viewAsList(); - @Source("resources/ic_action_volume_on_hdpi.png") - ImageResource volumeOn(); + @Source("resources/ic_action_volume_muted_hdpi.png") + ImageResource volumeMuted(); - @Source("resources/ic_action_warning_hdpi.png") - ImageResource warning(); + @Source("resources/ic_action_volume_on_hdpi.png") + ImageResource volumeOn(); - @Source("resources/ic_action_web_site_hdpi.png") - ImageResource webSite(); + @Source("resources/ic_action_warning_hdpi.png") + ImageResource warning(); + @Source("resources/ic_action_web_site_hdpi.png") + ImageResource webSite(); - } + } - @Override - public Images get() { - return Resources.INSTANCE; - } + @Override + public Images get() { + return Resources.INSTANCE; + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultXHighAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultXHighAppearance.java index 06632fc05..5d0a05694 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultXHighAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/ImageHolderDefaultXHighAppearance.java @@ -18,448 +18,449 @@ import com.google.gwt.core.shared.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.ImageResource; - import com.googlecode.mgwt.ui.client.widget.image.ImageHolder.ImageHolderAppearance; public class ImageHolderDefaultXHighAppearance implements ImageHolderAppearance { - interface Resources extends ClientBundle, Images { + interface Resources extends ClientBundle, Images { - Resources INSTANCE = GWT.create(Resources.class); + Resources INSTANCE = GWT.create(Resources.class); - @Source("resources/ic_action_about_xhdpi.png") - ImageResource about(); + @Source("resources/ic_action_about_xhdpi.png") + ImageResource about(); - @Source("resources/ic_action_accept_xhdpi.png") - ImageResource accept(); + @Source("resources/ic_action_accept_xhdpi.png") + ImageResource accept(); - @Source("resources/ic_action_accounts_xhdpi.png") - ImageResource accounts(); + @Source("resources/ic_action_accounts_xhdpi.png") + ImageResource accounts(); - @Source("resources/ic_action_add_alarm_xhdpi.png") - ImageResource addAlarm(); + @Source("resources/ic_action_add_alarm_xhdpi.png") + ImageResource addAlarm(); - @Source("resources/ic_action_add_group_xhdpi.png") - ImageResource addGroup(); + @Source("resources/ic_action_add_group_xhdpi.png") + ImageResource addGroup(); - @Source("resources/ic_action_add_person_xhdpi.png") - ImageResource addPerson(); + @Source("resources/ic_action_add_person_xhdpi.png") + ImageResource addPerson(); - @Source("resources/ic_action_add_to_queue_xhdpi.png") - ImageResource addToQueue(); + @Source("resources/ic_action_add_to_queue_xhdpi.png") + ImageResource addToQueue(); - @Source("resources/ic_action_airplane_mode_off_xhdpi.png") - ImageResource airplaneModeOff(); + @Source("resources/ic_action_airplane_mode_off_xhdpi.png") + ImageResource airplaneModeOff(); - @Source("resources/ic_action_airplane_mode_on_xhdpi.png") - ImageResource airplaneModeOn(); + @Source("resources/ic_action_airplane_mode_on_xhdpi.png") + ImageResource airplaneModeOn(); - @Source("resources/ic_action_alarms_xhdpi.png") - ImageResource alarms(); + @Source("resources/ic_action_alarms_xhdpi.png") + ImageResource alarms(); - @Source("resources/ic_action_attachment_xhdpi.png") - ImageResource attachment(); + @Source("resources/ic_action_attachment_xhdpi.png") + ImageResource attachment(); - @Source("resources/ic_action_back_xhdpi.png") - ImageResource back(); + @Source("resources/ic_action_back_xhdpi.png") + ImageResource back(); - @Source("resources/ic_action_backspace_xhdpi.png") - ImageResource backspace(); + @Source("resources/ic_action_backspace_xhdpi.png") + ImageResource backspace(); - @Source("resources/ic_action_bad_xhdpi.png") - ImageResource bad(); + @Source("resources/ic_action_bad_xhdpi.png") + ImageResource bad(); - @Source("resources/ic_action_battery_xhdpi.png") - ImageResource battery(); + @Source("resources/ic_action_battery_xhdpi.png") + ImageResource battery(); - @Source("resources/ic_action_bightness_low_xhdpi.png") - ImageResource bightnessLow(); + @Source("resources/ic_action_bightness_low_xhdpi.png") + ImageResource bightnessLow(); - @Source("resources/ic_action_bluetooth_connected_xhdpi.png") - ImageResource bluetoothConnected(); + @Source("resources/ic_action_bluetooth_connected_xhdpi.png") + ImageResource bluetoothConnected(); - @Source("resources/ic_action_bluetooth_searching_xhdpi.png") - ImageResource bluetoothSearching(); + @Source("resources/ic_action_bluetooth_searching_xhdpi.png") + ImageResource bluetoothSearching(); - @Source("resources/ic_action_bluetooth_xhdpi.png") - ImageResource bluetooth(); + @Source("resources/ic_action_bluetooth_xhdpi.png") + ImageResource bluetooth(); - @Source("resources/ic_action_brightness_auto_xhdpi.png") - ImageResource brightnessAuto(); + @Source("resources/ic_action_brightness_auto_xhdpi.png") + ImageResource brightnessAuto(); - @Source("resources/ic_action_brightness_high_xhdpi.png") - ImageResource brightnessHigh(); + @Source("resources/ic_action_brightness_high_xhdpi.png") + ImageResource brightnessHigh(); - @Source("resources/ic_action_brightness_medium_xhdpi.png") - ImageResource brightnessMedium(); + @Source("resources/ic_action_brightness_medium_xhdpi.png") + ImageResource brightnessMedium(); - @Source("resources/ic_action_call_xhdpi.png") - ImageResource call(); + @Source("resources/ic_action_call_xhdpi.png") + ImageResource call(); - @Source("resources/ic_action_camera_xhdpi.png") - ImageResource camera(); + @Source("resources/ic_action_camera_xhdpi.png") + ImageResource camera(); - @Source("resources/ic_action_cancel_xhdpi.png") - ImageResource cancel(); + @Source("resources/ic_action_cancel_xhdpi.png") + ImageResource cancel(); - @Source("resources/ic_action_cast_xhdpi.png") - ImageResource cast(); + @Source("resources/ic_action_cast_xhdpi.png") + ImageResource cast(); - @Source("resources/ic_action_cc_bcc_xhdpi.png") - ImageResource ccBcc(); + @Source("resources/ic_action_cc_bcc_xhdpi.png") + ImageResource ccBcc(); - @Source("resources/ic_action_chat_xhdpi.png") - ImageResource chat(); + @Source("resources/ic_action_chat_xhdpi.png") + ImageResource chat(); - @Source("resources/ic_action_cloud_xhdpi.png") - ImageResource cloud(); + @Source("resources/ic_action_cloud_xhdpi.png") + ImageResource cloud(); - @Source("resources/ic_action_collapse_xhdpi.png") - ImageResource collapse(); + @Source("resources/ic_action_collapse_xhdpi.png") + ImageResource collapse(); - @Source("resources/ic_action_collection_xhdpi.png") - ImageResource collection(); + @Source("resources/ic_action_collection_xhdpi.png") + ImageResource collection(); - @Source("resources/ic_action_computer_xhdpi.png") - ImageResource computer(); + @Source("resources/ic_action_computer_xhdpi.png") + ImageResource computer(); - @Source("resources/ic_action_copy_xhdpi.png") - ImageResource copy(); + @Source("resources/ic_action_copy_xhdpi.png") + ImageResource copy(); - @Source("resources/ic_action_crop_xhdpi.png") - ImageResource crop(); + @Source("resources/ic_action_crop_xhdpi.png") + ImageResource crop(); - @Source("resources/ic_action_cut_xhdpi.png") - ImageResource cut(); + @Source("resources/ic_action_cut_xhdpi.png") + ImageResource cut(); - @Source("resources/ic_action_data_usage_xhdpi.png") - ImageResource dataUsage(); + @Source("resources/ic_action_data_usage_xhdpi.png") + ImageResource dataUsage(); - @Source("resources/ic_action_dial_pad_xhdpi.png") - ImageResource dialPad(); + @Source("resources/ic_action_dial_pad_xhdpi.png") + ImageResource dialPad(); - @Source("resources/ic_action_directions_xhdpi.png") - ImageResource directions(); + @Source("resources/ic_action_directions_xhdpi.png") + ImageResource directions(); - @Source("resources/ic_action_discard_xhdpi.png") - ImageResource discard(); + @Source("resources/ic_action_discard_xhdpi.png") + ImageResource discard(); - @Source("resources/ic_action_dock_xhdpi.png") - ImageResource dock(); + @Source("resources/ic_action_dock_xhdpi.png") + ImageResource dock(); - @Source("resources/ic_action_download_xhdpi.png") - ImageResource download(); + @Source("resources/ic_action_download_xhdpi.png") + ImageResource download(); - @Source("resources/ic_action_edit_xhdpi.png") - ImageResource edit(); + @Source("resources/ic_action_edit_xhdpi.png") + ImageResource edit(); - @Source("resources/ic_action_email_xhdpi.png") - ImageResource email(); + @Source("resources/ic_action_email_xhdpi.png") + ImageResource email(); - @Source("resources/ic_action_end_call_xhdpi.png") - ImageResource endCall(); + @Source("resources/ic_action_end_call_xhdpi.png") + ImageResource endCall(); - @Source("resources/ic_action_error_xhdpi.png") - ImageResource error(); + @Source("resources/ic_action_error_xhdpi.png") + ImageResource error(); - @Source("resources/ic_action_event_xhdpi.png") - ImageResource event(); + @Source("resources/ic_action_event_xhdpi.png") + ImageResource event(); - @Source("resources/ic_action_expand_xhdpi.png") - ImageResource expand(); + @Source("resources/ic_action_expand_xhdpi.png") + ImageResource expand(); - @Source("resources/ic_action_fast_forward_xhdpi.png") - ImageResource fastForward(); + @Source("resources/ic_action_fast_forward_xhdpi.png") + ImageResource fastForward(); - @Source("resources/ic_action_favorite_xhdpi.png") - ImageResource favorite(); + @Source("resources/ic_action_favorite_xhdpi.png") + ImageResource favorite(); - @Source("resources/ic_action_flash_automatic_xhdpi.png") - ImageResource flashAutomatic(); + @Source("resources/ic_action_flash_automatic_xhdpi.png") + ImageResource flashAutomatic(); - @Source("resources/ic_action_flash_off_xhdpi.png") - ImageResource flashOff(); + @Source("resources/ic_action_flash_off_xhdpi.png") + ImageResource flashOff(); - @Source("resources/ic_action_flash_on_xhdpi.png") - ImageResource flashOn(); + @Source("resources/ic_action_flash_on_xhdpi.png") + ImageResource flashOn(); - @Source("resources/ic_action_forward_xhdpi.png") - ImageResource forward(); + @Source("resources/ic_action_forward_xhdpi.png") + ImageResource forward(); - @Source("resources/ic_action_full_screen_xhdpi.png") - ImageResource fullScreen(); + @Source("resources/ic_action_full_screen_xhdpi.png") + ImageResource fullScreen(); - @Source("resources/ic_action_gamepad_xhdpi.png") - ImageResource gamepad(); + @Source("resources/ic_action_gamepad_xhdpi.png") + ImageResource gamepad(); - @Source("resources/ic_action_go_to_today_xhdpi.png") - ImageResource goToToday(); + @Source("resources/ic_action_go_to_today_xhdpi.png") + ImageResource goToToday(); - @Source("resources/ic_action_good_xhdpi.png") - ImageResource good(); + @Source("resources/ic_action_good_xhdpi.png") + ImageResource good(); - @Source("resources/ic_action_group_xhdpi.png") - ImageResource group(); + @Source("resources/ic_action_group_xhdpi.png") + ImageResource group(); - @Source("resources/ic_action_half_important_xhdpi.png") - ImageResource halfImportant(); + @Source("resources/ic_action_half_important_xhdpi.png") + ImageResource halfImportant(); - @Source("resources/ic_action_headphones_xhdpi.png") - ImageResource headphones(); + @Source("resources/ic_action_headphones_xhdpi.png") + ImageResource headphones(); - @Source("resources/ic_action_headset_xhdpi.png") - ImageResource headset(); + @Source("resources/ic_action_headset_xhdpi.png") + ImageResource headset(); - @Source("resources/ic_action_help_xhdpi.png") - ImageResource help(); + @Source("resources/ic_action_help_xhdpi.png") + ImageResource help(); - @Source("resources/ic_action_import_export_xhdpi.png") - ImageResource importExport(); + @Source("resources/ic_action_import_export_xhdpi.png") + ImageResource importExport(); - @Source("resources/ic_action_important_xhdpi.png") - ImageResource important(); + @Source("resources/ic_action_important_xhdpi.png") + ImageResource important(); - @Source("resources/ic_action_keyboard_xhdpi.png") - ImageResource keyboard(); + @Source("resources/ic_action_keyboard_xhdpi.png") + ImageResource keyboard(); - @Source("resources/ic_action_labels_xhdpi.png") - ImageResource labels(); + @Source("resources/ic_action_labels_xhdpi.png") + ImageResource labels(); - @Source("resources/ic_action_location_found_xhdpi.png") - ImageResource locationFound(); + @Source("resources/ic_action_location_found_xhdpi.png") + ImageResource locationFound(); - @Source("resources/ic_action_location_off_xhdpi.png") - ImageResource locationOff(); + @Source("resources/ic_action_location_off_xhdpi.png") + ImageResource locationOff(); - @Source("resources/ic_action_location_searching_xhdpi.png") - ImageResource locationSearching(); + @Source("resources/ic_action_location_searching_xhdpi.png") + ImageResource locationSearching(); - @Source("resources/ic_action_make_available_offline_xhdpi.png") - ImageResource makeAvailableOffline(); + @Source("resources/ic_action_make_available_offline_xhdpi.png") + ImageResource makeAvailableOffline(); - @Source("resources/ic_action_map_xhdpi.png") - ImageResource map(); + @Source("resources/ic_action_map_xhdpi.png") + ImageResource map(); - @Source("resources/ic_action_merge_xhdpi.png") - ImageResource merge(); + @Source("resources/ic_action_merge_xhdpi.png") + ImageResource merge(); - @Source("resources/ic_action_mic_muted_xhdpi.png") - ImageResource micMuted(); + @Source("resources/ic_action_mic_muted_xhdpi.png") + ImageResource micMuted(); - @Source("resources/ic_action_mic_xhdpi.png") - ImageResource mic(); + @Source("resources/ic_action_mic_xhdpi.png") + ImageResource mic(); - @Source("resources/ic_action_mouse_xhdpi.png") - ImageResource mouse(); + @Source("resources/ic_action_mouse_xhdpi.png") + ImageResource mouse(); - @Source("resources/ic_action_network_cell_xhdpi.png") - ImageResource networkCell(); + @Source("resources/ic_action_network_cell_xhdpi.png") + ImageResource networkCell(); - @Source("resources/ic_action_network_wifi_xhdpi.png") - ImageResource networkWifi(); + @Source("resources/ic_action_network_wifi_xhdpi.png") + ImageResource networkWifi(); - @Source("resources/ic_action_new_account_xhdpi.png") - ImageResource newAccount(); + @Source("resources/ic_action_new_account_xhdpi.png") + ImageResource newAccount(); - @Source("resources/ic_action_new_attachment_xhdpi.png") - ImageResource newAttachment(); + @Source("resources/ic_action_new_attachment_xhdpi.png") + ImageResource newAttachment(); - @Source("resources/ic_action_new_email_xhdpi.png") - ImageResource newEmail(); + @Source("resources/ic_action_new_email_xhdpi.png") + ImageResource newEmail(); - @Source("resources/ic_action_new_event_xhdpi.png") - ImageResource newEvent(); + @Source("resources/ic_action_new_event_xhdpi.png") + ImageResource newEvent(); - @Source("resources/ic_action_new_label_xhdpi.png") - ImageResource newLabel(); + @Source("resources/ic_action_new_label_xhdpi.png") + ImageResource newLabel(); - @Source("resources/ic_action_new_picture_xhdpi.png") - ImageResource newPicture(); + @Source("resources/ic_action_new_picture_xhdpi.png") + ImageResource newPicture(); - @Source("resources/ic_action_new_xhdpi.png") - ImageResource newItem(); + @Source("resources/ic_action_new_xhdpi.png") + ImageResource newItem(); - @Source("resources/ic_action_next_item_xhdpi.png") - ImageResource nextItem(); + @Source("resources/ic_action_next_item_xhdpi.png") + ImageResource nextItem(); - @Source("resources/ic_action_next_xhdpi.png") - ImageResource next(); + @Source("resources/ic_action_next_xhdpi.png") + ImageResource next(); - @Source("resources/ic_action_not_important_xhdpi.png") - ImageResource notImportant(); + @Source("resources/ic_action_not_important_xhdpi.png") + ImageResource notImportant(); - @Source("resources/ic_action_not_secure_xhdpi.png") - ImageResource notSecure(); + @Source("resources/ic_action_not_secure_xhdpi.png") + ImageResource notSecure(); - @Source("resources/ic_action_overflow_xhdpi.png") - ImageResource overflow(); + @Source("resources/ic_action_overflow_xhdpi.png") + ImageResource overflow(); - @Source("resources/ic_action_paste_xhdpi.png") - ImageResource paste(); + @Source("resources/ic_action_paste_xhdpi.png") + ImageResource paste(); - @Source("resources/ic_action_pause_over_video_xhdpi.png") - ImageResource pauseOverVideo(); + @Source("resources/ic_action_pause_over_video_xhdpi.png") + ImageResource pauseOverVideo(); - @Source("resources/ic_action_pause_xhdpi.png") - ImageResource pause(); + @Source("resources/ic_action_pause_xhdpi.png") + ImageResource pause(); - @Source("resources/ic_action_person_xhdpi.png") - ImageResource person(); + @Source("resources/ic_action_person_xhdpi.png") + ImageResource person(); - @Source("resources/ic_action_phone_xhdpi.png") - ImageResource phone(); + @Source("resources/ic_action_phone_xhdpi.png") + ImageResource phone(); - @Source("resources/ic_action_picture_xhdpi.png") - ImageResource picture(); + @Source("resources/ic_action_picture_xhdpi.png") + ImageResource picture(); - @Source("resources/ic_action_place_xhdpi.png") - ImageResource place(); + @Source("resources/ic_action_place_xhdpi.png") + ImageResource place(); - @Source("resources/ic_action_play_over_video_xhdpi.png") - ImageResource playOverVideo(); + @Source("resources/ic_action_play_over_video_xhdpi.png") + ImageResource playOverVideo(); - @Source("resources/ic_action_play_xhdpi.png") - ImageResource play(); + @Source("resources/ic_action_play_xhdpi.png") + ImageResource play(); - @Source("resources/ic_action_previous_item_xhdpi.png") - ImageResource previousItem(); + @Source("resources/ic_action_previous_item_xhdpi.png") + ImageResource previousItem(); - @Source("resources/ic_action_previous_xhdpi.png") - ImageResource previous(); + @Source("resources/ic_action_previous_xhdpi.png") + ImageResource previous(); - @Source("resources/ic_action_read_xhdpi.png") - ImageResource read(); + @Source("resources/ic_action_print_xhdpi.png") + ImageResource print(); - @Source("resources/ic_action_refresh_xhdpi.png") - ImageResource refresh(); + @Source("resources/ic_action_read_xhdpi.png") + ImageResource read(); - @Source("resources/ic_action_remove_xhdpi.png") - ImageResource remove(); + @Source("resources/ic_action_refresh_xhdpi.png") + ImageResource refresh(); - @Source("resources/ic_action_repeat_xhdpi.png") - ImageResource repeat(); + @Source("resources/ic_action_remove_xhdpi.png") + ImageResource remove(); - @Source("resources/ic_action_replay_xhdpi.png") - ImageResource replay(); + @Source("resources/ic_action_repeat_xhdpi.png") + ImageResource repeat(); - @Source("resources/ic_action_reply_all_xhdpi.png") - ImageResource replyAll(); + @Source("resources/ic_action_replay_xhdpi.png") + ImageResource replay(); - @Source("resources/ic_action_reply_xhdpi.png") - ImageResource reply(); + @Source("resources/ic_action_reply_all_xhdpi.png") + ImageResource replyAll(); - @Source("resources/ic_action_return_from_full_screen_xhdpi.png") - ImageResource returnFromFullScreen(); + @Source("resources/ic_action_reply_xhdpi.png") + ImageResource reply(); - @Source("resources/ic_action_rewind_xhdpi.png") - ImageResource rewind(); + @Source("resources/ic_action_return_from_full_screen_xhdpi.png") + ImageResource returnFromFullScreen(); - @Source("resources/ic_action_ring_volume_xhdpi.png") - ImageResource ringVolume(); + @Source("resources/ic_action_rewind_xhdpi.png") + ImageResource rewind(); - @Source("resources/ic_action_rotate_left_xhdpi.png") - ImageResource rotateLeft(); + @Source("resources/ic_action_ring_volume_xhdpi.png") + ImageResource ringVolume(); - @Source("resources/ic_action_rotate_right_xhdpi.png") - ImageResource rotateRight(); + @Source("resources/ic_action_rotate_left_xhdpi.png") + ImageResource rotateLeft(); - @Source("resources/ic_action_save_xhdpi.png") - ImageResource save(); + @Source("resources/ic_action_rotate_right_xhdpi.png") + ImageResource rotateRight(); - @Source("resources/ic_action_screen_locked_to_landscape_xhdpi.png") - ImageResource screenLockedToLandscape(); + @Source("resources/ic_action_save_xhdpi.png") + ImageResource save(); - @Source("resources/ic_action_screen_locked_to_portrait_xhdpi.png") - ImageResource screenLockedToPortrait(); + @Source("resources/ic_action_screen_locked_to_landscape_xhdpi.png") + ImageResource screenLockedToLandscape(); - @Source("resources/ic_action_screen_rotation_xhdpi.png") - ImageResource screenRotation(); + @Source("resources/ic_action_screen_locked_to_portrait_xhdpi.png") + ImageResource screenLockedToPortrait(); - @Source("resources/ic_action_sd_storage_xhdpi.png") - ImageResource sdStorage(); + @Source("resources/ic_action_screen_rotation_xhdpi.png") + ImageResource screenRotation(); - @Source("resources/ic_action_search_xhdpi.png") - ImageResource search(); + @Source("resources/ic_action_sd_storage_xhdpi.png") + ImageResource sdStorage(); - @Source("resources/ic_action_secure_xhdpi.png") - ImageResource secure(); + @Source("resources/ic_action_search_xhdpi.png") + ImageResource search(); - @Source("resources/ic_action_select_all_xhdpi.png") - ImageResource selectAll(); + @Source("resources/ic_action_secure_xhdpi.png") + ImageResource secure(); - @Source("resources/ic_action_send_now_xhdpi.png") - ImageResource sendNow(); + @Source("resources/ic_action_select_all_xhdpi.png") + ImageResource selectAll(); - @Source("resources/ic_action_settings_xhdpi.png") - ImageResource settings(); + @Source("resources/ic_action_send_now_xhdpi.png") + ImageResource sendNow(); - @Source("resources/ic_action_share_xhdpi.png") - ImageResource share(); + @Source("resources/ic_action_settings_xhdpi.png") + ImageResource settings(); - @Source("resources/ic_action_shuffle_xhdpi.png") - ImageResource shuffle(); + @Source("resources/ic_action_share_xhdpi.png") + ImageResource share(); - @Source("resources/ic_action_slideshow_xhdpi.png") - ImageResource slideshow(); + @Source("resources/ic_action_shuffle_xhdpi.png") + ImageResource shuffle(); - @Source("resources/ic_action_sort_by_size_xhdpi.png") - ImageResource sortBySize(); + @Source("resources/ic_action_slideshow_xhdpi.png") + ImageResource slideshow(); - @Source("resources/ic_action_split_xhdpi.png") - ImageResource split(); + @Source("resources/ic_action_sort_by_size_xhdpi.png") + ImageResource sortBySize(); - @Source("resources/ic_action_stop_xhdpi.png") - ImageResource stop(); + @Source("resources/ic_action_split_xhdpi.png") + ImageResource split(); - @Source("resources/ic_action_storage_xhdpi.png") - ImageResource storage(); + @Source("resources/ic_action_stop_xhdpi.png") + ImageResource stop(); - @Source("resources/ic_action_switch_camera_xhdpi.png") - ImageResource switchCamera(); + @Source("resources/ic_action_storage_xhdpi.png") + ImageResource storage(); - @Source("resources/ic_action_switch_video_xhdpi.png") - ImageResource switchVideo(); + @Source("resources/ic_action_switch_camera_xhdpi.png") + ImageResource switchCamera(); - @Source("resources/ic_action_time_xhdpi.png") - ImageResource time(); + @Source("resources/ic_action_switch_video_xhdpi.png") + ImageResource switchVideo(); - @Source("resources/ic_action_undo_xhdpi.png") - ImageResource undo(); + @Source("resources/ic_action_time_xhdpi.png") + ImageResource time(); - @Source("resources/ic_action_unread_xhdpi.png") - ImageResource unread(); + @Source("resources/ic_action_undo_xhdpi.png") + ImageResource undo(); - @Source("resources/ic_action_upload_xhdpi.png") - ImageResource upload(); + @Source("resources/ic_action_unread_xhdpi.png") + ImageResource unread(); - @Source("resources/ic_action_usb_xhdpi.png") - ImageResource usb(); + @Source("resources/ic_action_upload_xhdpi.png") + ImageResource upload(); - @Source("resources/ic_action_video_xhdpi.png") - ImageResource video(); + @Source("resources/ic_action_usb_xhdpi.png") + ImageResource usb(); - @Source("resources/ic_action_view_as_grid_xhdpi.png") - ImageResource viewAsGrid(); + @Source("resources/ic_action_video_xhdpi.png") + ImageResource video(); - @Source("resources/ic_action_view_as_list_xhdpi.png") - ImageResource viewAsList(); + @Source("resources/ic_action_view_as_grid_xhdpi.png") + ImageResource viewAsGrid(); - @Source("resources/ic_action_volume_muted_xhdpi.png") - ImageResource volumeMuted(); + @Source("resources/ic_action_view_as_list_xhdpi.png") + ImageResource viewAsList(); - @Source("resources/ic_action_volume_on_xhdpi.png") - ImageResource volumeOn(); + @Source("resources/ic_action_volume_muted_xhdpi.png") + ImageResource volumeMuted(); - @Source("resources/ic_action_warning_xhdpi.png") - ImageResource warning(); + @Source("resources/ic_action_volume_on_xhdpi.png") + ImageResource volumeOn(); - @Source("resources/ic_action_web_site_xhdpi.png") - ImageResource webSite(); + @Source("resources/ic_action_warning_xhdpi.png") + ImageResource warning(); + @Source("resources/ic_action_web_site_xhdpi.png") + ImageResource webSite(); - } + } - @Override - public Images get() { - return Resources.INSTANCE; - } + @Override + public Images get() { + return Resources.INSTANCE; + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_hdpi.png b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_hdpi.png new file mode 100644 index 000000000..f6579d2b7 Binary files /dev/null and b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_hdpi.png differ diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_mdpi.png b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_mdpi.png new file mode 100644 index 000000000..d7ac5b152 Binary files /dev/null and b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_mdpi.png differ diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xhdpi.png b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xhdpi.png new file mode 100644 index 000000000..3981764a2 Binary files /dev/null and b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xhdpi.png differ diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xxhdpi.png b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xxhdpi.png new file mode 100644 index 000000000..eea0d11f2 Binary files /dev/null and b/src/main/java/com/googlecode/mgwt/ui/client/widget/image/resources/ic_action_print_xxhdpi.png differ diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputApperanceHolder.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputAppearanceHolder.java similarity index 80% rename from src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputApperanceHolder.java rename to src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputAppearanceHolder.java index 2bdc8f96e..a013fbd54 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputApperanceHolder.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/InputAppearanceHolder.java @@ -17,9 +17,9 @@ import com.google.gwt.core.shared.GWT; -public class InputApperanceHolder { +public class InputAppearanceHolder { - public static final InputAppearance DEFAULT_APPERAERANCE = GWT.create(InputAppearance.class); + public static final InputAppearance DEFAULT_APPEARANCE = GWT.create(InputAppearance.class); - private InputApperanceHolder() {} + private InputAppearanceHolder() {} } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDateBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDateBox.java index ee5507eb1..de73d5928 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDateBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDateBox.java @@ -154,7 +154,7 @@ public Date parse(CharSequence text) throws ParseException { private DateTimeFormat format; public MDateBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MDateBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDoubleBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDoubleBox.java index b0bf7ff4e..2c11cf0d6 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDoubleBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MDoubleBox.java @@ -1,12 +1,12 @@ /* * Copyright 2011 Daniel Kurka - * + * * 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 @@ -22,7 +22,7 @@ /** * A input box that accepts doubles - * + * * @author Daniel Kurka */ public class MDoubleBox extends MValueBoxBase { @@ -31,6 +31,10 @@ private static class SDoubleBox extends DoubleBox implements HasSource { private Object source; + public SDoubleBox() { + setStylePrimaryName("gwt-DoubleBox"); + } + @Override protected HandlerManager createHandlerManager() { return new HandlerManager(source); @@ -42,7 +46,7 @@ public void setSource(Object source) { } public MDoubleBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MDoubleBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MEmailTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MEmailTextBox.java index 2a3c55d04..1aabba361 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MEmailTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MEmailTextBox.java @@ -24,7 +24,7 @@ public class MEmailTextBox extends MTextBox { public MEmailTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MIntegerBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MIntegerBox.java index 8c7cd1175..89ca8a12f 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MIntegerBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MIntegerBox.java @@ -1,12 +1,12 @@ /* * Copyright 2011 Daniel Kurka - * + * * 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 @@ -22,7 +22,7 @@ /** * An input element that handles integers - * + * * @author Daniel Kurka */ public class MIntegerBox extends MValueBoxBase { @@ -31,6 +31,10 @@ private static class SIntegerBox extends IntegerBox implements HasSource { private Object source; + public SIntegerBox() { + setStylePrimaryName("gwt-IntegerBox"); + } + @Override protected HandlerManager createHandlerManager() { return new HandlerManager(source); @@ -44,7 +48,7 @@ public void setSource(Object source) { } public MIntegerBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MIntegerBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MLongBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MLongBox.java index 66ae4313a..e68c2743f 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MLongBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MLongBox.java @@ -1,12 +1,12 @@ /* * Copyright 2011 Daniel Kurka - * + * * 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 @@ -22,7 +22,7 @@ /** * An input element that handles longs - * + * * @author Daniel Kurka */ public class MLongBox extends MValueBoxBase { @@ -30,6 +30,10 @@ public class MLongBox extends MValueBoxBase { private static class SLongBox extends LongBox implements HasSource { private Object source; + public SLongBox() { + setStylePrimaryName("gwt-LongBox"); + } + @Override public void setSource(Object source) { this.source = source; @@ -43,7 +47,7 @@ protected HandlerManager createHandlerManager() { } public MLongBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MLongBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MNumberTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MNumberTextBox.java index d1ca04ef1..58e0af7d3 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MNumberTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MNumberTextBox.java @@ -24,7 +24,7 @@ public class MNumberTextBox extends MTextBox { public MNumberTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MNumberTextBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPasswordTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPasswordTextBox.java index e6b40f2c1..5da10c999 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPasswordTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPasswordTextBox.java @@ -40,7 +40,7 @@ protected HandlerManager createHandlerManager() { } public MPasswordTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MPasswordTextBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPhoneNumberTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPhoneNumberTextBox.java index 1fb01c792..74ed25421 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPhoneNumberTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MPhoneNumberTextBox.java @@ -24,7 +24,7 @@ public class MPhoneNumberTextBox extends MTextBox { public MPhoneNumberTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MPhoneNumberTextBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextArea.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextArea.java index bf2fc00e3..8730984f8 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextArea.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextArea.java @@ -45,7 +45,7 @@ protected HandlerManager createHandlerManager() { } public MTextArea() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MTextArea(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextBox.java index 79633f6e7..b3ddb7e5b 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MTextBox.java @@ -43,7 +43,7 @@ protected HandlerManager createHandlerManager() { } public MTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MTextBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MUrlTextBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MUrlTextBox.java index 4dbfb4bc2..5e7639276 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MUrlTextBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/MUrlTextBox.java @@ -21,7 +21,7 @@ */ public class MUrlTextBox extends MTextBox { public MUrlTextBox() { - this(InputApperanceHolder.DEFAULT_APPERAERANCE); + this(InputAppearanceHolder.DEFAULT_APPEARANCE); } public MUrlTextBox(InputAppearance appearance) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/MCheckBox.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/MCheckBox.java index a479b7788..f24fb1bbc 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/MCheckBox.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/MCheckBox.java @@ -31,9 +31,8 @@ import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.HasValue; - import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; -import com.googlecode.mgwt.ui.client.MGWT; +import com.googlecode.mgwt.ui.client.TouchSupport; import com.googlecode.mgwt.ui.client.util.CssUtil; import com.googlecode.mgwt.ui.client.widget.touch.TouchWidget; @@ -59,7 +58,7 @@ public void onTouchCancel(TouchCancelEvent event) { } event.stopPropagation(); event.preventDefault(); - if (MGWT.getFormFactor().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { DOM.releaseCapture(getElement()); } setValue(getValue()); @@ -73,7 +72,7 @@ public void onTouchEnd(TouchEndEvent event) { event.stopPropagation(); event.preventDefault(); - if (MGWT.getFormFactor().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { DOM.releaseCapture(getElement()); } @@ -120,7 +119,7 @@ public void onTouchStart(TouchStartEvent event) { } event.stopPropagation(); event.preventDefault(); - if (MGWT.getFormFactor().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { DOM.setCapture(getElement()); } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/checkbox.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/checkbox.css index 648fe6eba..db0687bc8 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/checkbox.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/checkbox/checkbox.css @@ -12,7 +12,6 @@ @def CONTAINER_MAX_OFF 41; @def CONTAINER_OFFSET_OFF -41; - .mgwt-CheckBox { width: 81px; height: 27px; @@ -41,10 +40,18 @@ } } +@if user.agent ie10 { + .mgwt-CheckBox-middle { + transition: all 0.1s ease-in-out; + } +} + @if user.agent gecko1_8 { .mgwt-CheckBox-middle { -moz-transition: all 0.1s ease-in-out; -moz-border-radius: 6px; + -ms-transition: all 0.1s ease-in-out; + -ms-border-radius: 6px; } } @@ -63,9 +70,16 @@ } } +@if user.agent ie10 { + .mgwt-CheckBox-middle-content { + box-sizing: border-box; + } +} + @if user.agent gecko1_8 { .mgwt-CheckBox-middle-content { -moz-box-sizing: border-box; + -ms-box-sizing: border-box; } } @@ -85,9 +99,16 @@ } } +@if user.agent ie10 { + .mgwt-CheckBox-on { + transition: all 0.1s ease-in-out; + } +} + @if user.agent gecko1_8 { .mgwt-CheckBox-on { -moz-transition: all 0.1s ease-in-out; + -ms-transition: all 0.1s ease-in-out; } } @@ -108,9 +129,16 @@ } } +@if user.agent ie10 { + .mgwt-CheckBox-off { + transition: all 0.1s ease-in-out; + } +} + @if user.agent gecko1_8 { .mgwt-CheckBox-off { -moz-transition: all 0.1s ease-in-out; + -ms-transition: all 0.1s ease-in-out; } } @@ -138,6 +166,30 @@ } } +@if user.agent ie10 { + .mgwt-CheckBox-important .mgwt-CheckBox-on { + background-color: #fe9c12; + } + .mgwt-CheckBox-notchecked .mgwt-CheckBox-middle { + transform: translate3d(-41px,0,0); + } + .mgwt-CheckBox-checked .mgwt-CheckBox-middle { + transform: translate3d(0px,0,0); + } + .mgwt-CheckBox-notchecked .mgwt-CheckBox-off { + transform: translate3d(-41px,0,0); + } + .mgwt-CheckBox-checked .mgwt-CheckBox-off { + transform: translate3d(10px,0,0); + } + .mgwt-CheckBox-notchecked .mgwt-CheckBox-on { + transform: translate3d(-81px,0,0); + } + .mgwt-CheckBox-checked .mgwt-CheckBox-on { + transform: translate3d(0px,0,0); + } +} + @if user.agent gecko1_8 { .mgwt-CheckBox-important .mgwt-CheckBox-on { border: solid 1px #d87101; @@ -145,26 +197,32 @@ } .mgwt-CheckBox-notchecked .mgwt-CheckBox-middle { -moz-transform: translate(-54px,0); + -ms-transform: translate(-54px,0); } .mgwt-CheckBox-checked .mgwt-CheckBox-middle { -moz-transform: translate(0px,0); + -ms-transform: translate(0px,0); } .mgwt-CheckBox-notchecked .mgwt-CheckBox-off { -moz-transform: translate(-54px,0); + -ms-transform: translate(-54px,0); } .mgwt-CheckBox-checked .mgwt-CheckBox-off { -moz-transform: translate(0px,0); + -ms-transform: translate(0px,0); } .mgwt-CheckBox-notchecked .mgwt-CheckBox-on { -moz-transform: translate(-62px,0); + -ms-transform: translate(-62px,0); } .mgwt-CheckBox-checked .mgwt-CheckBox-on { -moz-transform: translate(0px,0); + -ms-transform: translate(0px,0); } } /*TODO add browser....*/ -@if user.agent ie8 ie9 ie10 { +@if user.agent ie8 ie9 { .mgwt-CheckBox-important .mgwt-CheckBox-on {} .mgwt-CheckBox-notchecked .mgwt-CheckBox-middle {} .mgwt-CheckBox-checked .mgwt-CheckBox-middle {} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/input.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/input.css index 56a30e7e6..bf92222ad 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/input.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/input.css @@ -17,6 +17,19 @@ } } +@if user.agent ie10 { + .mgwt-TextBox, .mgwt-InputBox-box, .mgwt-PasswordTextBox, + .mgwt-InputBox-box, .mgwt-TextArea, .mgwt-InputBox-box { + display: -ms-flexbox; + -ms-flex: 1 1; + -ms-user-select: text; + } + + textarea.mgwt-InputBox-box { + -ms-touch-action: pan-y; + } +} + @if user.agent gecko1_8 { .mgwt-TextBox, .mgwt-InputBox-box, .mgwt-PasswordTextBox, .mgwt-InputBox-box, .mgwt-TextArea, .mgwt-InputBox-box { @@ -24,6 +37,9 @@ -moz-box-flex: 1; -moz-appearance: none; -moz-user-select: text; + + display: -ms-flexbox; + -ms-user-select: text; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/listbox/mlistbox.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/listbox/mlistbox.css index 600144b7a..2157ccd96 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/listbox/mlistbox.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/listbox/mlistbox.css @@ -16,11 +16,25 @@ } } +@if user.agent ie10 { + .mgwt-ListBox { + display: -ms-flexbox; + -ms-user-select: text; + } + + select::-ms-expand { + display: none; + } +} + @if user.agent gecko1_8 { .mgwt-ListBox { display: -moz-box; -moz-appearance: none; -moz-user-select: text; + display: -ms-flexbox; + -ms-appearance: none; + -ms-user-select: text; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/radio/mradiobutton.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/radio/mradiobutton.css index c2eff4c5a..e519223a3 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/radio/mradiobutton.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/radio/mradiobutton.css @@ -29,14 +29,28 @@ } } +@if user.agent ie10 { + .mgwt-RadioButton { + display: -ms-flexbox; + -ms-flex-direction: row; + -ms-flex: 1 1; + } + .mgwt-RadioButton-label { + display: -ms-flexbox; + -ms-flex: 1 1; + } +} + @if user.agent gecko1_8 { .mgwt-RadioButton { display: -moz-box; -moz-box-orient: horizontal; -moz-box-flex: 1; + -ms-box-orient: horizontal; } .mgwt-RadioButton-label { display: -moz-box; + display: -ms-flexbox; -moz-box-flex: 1; } } @@ -83,11 +97,20 @@ } } +@if user.agent ie10 { + .mgwt-RadioButton-input { + } + .mgwt-RadioButton-input:CHECKED { + } +} + @if user.agent gecko1_8 { .mgwt-RadioButton-input { -moz-appearance: none !important; + -ms-appearance: none !important; } .mgwt-RadioButton-input:CHECKED { -moz-appearance: none !important; + -ms-appearance: none !important; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/search/searchbox.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/search/searchbox.css index 4947d2f9a..3b6bf7119 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/search/searchbox.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/search/searchbox.css @@ -7,7 +7,15 @@ @external mgwt-SearchBox-icon; } -::-webkit-search-cancel-button { -webkit-appearance: none; } +::-webkit-search-cancel-button { + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; +} + +@if user.agent safari { + ::-webkit-search-cancel-button { -webkit-appearance: none; } +} .mgwt-SearchBox { height: 44px; @@ -38,9 +46,16 @@ } } +@if user.agent ie10 { + .mgwt-SearchBox-input { + width: literal("calc(100% - 47px)"); + } +} + @if user.agent gecko1_8 { .mgwt-SearchBox-input { width: literal("-moz-calc(100% - 47px);"); + width: literal("-ms-calc(100% - 47px);"); } } @@ -52,16 +67,25 @@ } } +@if user.agent ie10 { + .mgwt-SearchBox-input { + -ms-user-select: text; + } +} + @if user.agent gecko1_8 { .mgwt-SearchBox-input { top: 5px; -moz-appearance: none; -moz-user-select: text; -moz-tap-highlight-color: rgba(0, 0, 0, 0); + -ms-appearance: none; + -ms-user-select: text; + -ms-tap-highlight-color: rgba(0, 0, 0, 0); } } -@if user.agent ie9 ie10 { +@if user.agent ie9 { .mgwt-SearchBox-input { top: 5px; } @@ -90,6 +114,23 @@ .mgwt-SearchBox-icon { -webkit-mask-image: searchImage; -webkit-mask-repeat: no-repeat; + + background-image: searchImage; + background-repeat: no-repeat; + background-color: inherit; } +} + +@if user.agent gecko1_8 { + .mgwt-SearchBox-icon { + background-image: searchImage; + background-repeat: no-repeat; + } +} + +@if user.agent ie10 { + .mgwt-SearchBox-icon { + background-image: searchImage; + background-repeat: no-repeat; } } @@ -99,22 +140,38 @@ left: 8px; height: 16px; width: 16px; - background-color: #78787E; } @if mgwt.density high { .mgwt-SearchBox-icon { -webkit-mask-size: 17px 17px; + -moz-mask-size: 17px 17px; + -ms-mask-size: 17px 17px; } } @if mgwt.density xhigh { .mgwt-SearchBox-icon { -webkit-mask-size: 12px 12px; + -moz-mask-size: 12px 12px; + -ms-mask-size: 12px 12px; } } @if user.agent safari { + + @if mgwt.density high { + .mgwt-SearchBox-icon { + -webkit-mask-size: 17px 17px; + } + } + + @if mgwt.density xhigh { + .mgwt-SearchBox-icon { + -webkit-mask-size: 12px 12px; + } + } + .mgwt-SearchBox-clear { -webkit-mask-image: clearImage; -webkit-mask-position: center center; @@ -122,23 +179,86 @@ } } +@if user.agent gecko1_8 { + .mgwt-SearchBox-clear { + background-image: clearImage; + background-repeat: no-repeat; + background-position: center center; + } +} + +@if user.agent ie10 { + + @if mgwt.density high { + .mgwt-SearchBox-icon { + background-size: 17px 17px; + } + } + + @if mgwt.density xhigh { + .mgwt-SearchBox-icon { + background-size: 12px 12px; + } + } + + .mgwt-SearchBox-clear { + background-image: clearImage; + background-position: center center; + background-repeat: no-repeat; + } +} + .mgwt-SearchBox-clear { position: absolute; top: -2px; right: 0px; height: 30px; width: 30px; - background-color: #78787E; + background-color: inherit; } @if mgwt.density high { .mgwt-SearchBox-clear { -webkit-mask-size: 19px 19px; + -moz-mask-size: 19px 19px; + -ms-mask-size: 19px 19px; } } @if mgwt.density xhigh { .mgwt-SearchBox-clear { -webkit-mask-size: 14px 14px; + -moz-mask-size: 14px 14px; + -ms-mask-size: 14px 14px; } } + +@if user.agent safari { + + @if mgwt.density high { + .mgwt-SearchBox-clear { + -webkit-mask-size: 19px 19px; + } + } + + @if mgwt.density xhigh { + .mgwt-SearchBox-clear { + -webkit-mask-size: 14px 14px; + } + } +} + +@if user.agent ie10 { + + @if mgwt.density high { + .mgwt-SearchBox-clear { + background-size: 19px 19px; + } + } + + @if mgwt.density xhigh { + .mgwt-SearchBox-clear { + background-size: 14px 14px; + } + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/slider/Slider.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/slider/Slider.java index fbfac2043..9b35c4a3a 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/input/slider/Slider.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/input/slider/Slider.java @@ -30,194 +30,195 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.HasValue; import com.google.gwt.user.client.ui.Widget; - import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; -import com.googlecode.mgwt.ui.client.MGWT; +import com.googlecode.mgwt.ui.client.TouchSupport; import com.googlecode.mgwt.ui.client.util.CssUtil; import com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl; /** * The mgwt pointer widget. * - * The pointer element is moved along the bar element to represent the value of the Slider + * The pointer element is moved along the bar element to represent the value of + * the Slider */ public class Slider extends Widget implements HasValue, LeafValueEditor { - private class SliderTouchHandler implements TouchHandler { - - @Override - public void onTouchStart(TouchStartEvent event) { - setValueContrained(event.getTouches().get(0).getClientX()); - if (MGWT.getFormFactor().isDesktop()) { - DOM.setCapture(getElement()); - } - event.stopPropagation(); - event.preventDefault(); - } - - @Override - public void onTouchMove(TouchMoveEvent event) { - - setValueContrained(event.getTouches().get(0).getClientX()); - event.stopPropagation(); - event.preventDefault(); - } - - @Override - public void onTouchEnd(TouchEndEvent event) { - if (MGWT.getFormFactor().isDesktop()) { - DOM.releaseCapture(getElement()); - } - event.stopPropagation(); - event.preventDefault(); - } - - @Override - public void onTouchCancel(TouchCancelEvent event) { - if (MGWT.getFormFactor().isDesktop()) { - DOM.releaseCapture(getElement()); - } - } - } - - private static final SliderAppearance DEFAULT_APPEARANCE = GWT.create(SliderAppearance.class); - - private static final TouchWidgetImpl TOUCH_WIDGET_IMPL = GWT.create(TouchWidgetImpl.class); - - private int value; - private int max; - private final SliderAppearance apperance; - - @UiField - public Element pointer; - @UiField - public Element bar; - - public Slider() { - this(DEFAULT_APPEARANCE); - } - - public Slider(SliderAppearance apperance) { - this.apperance = apperance; - setElement(this.apperance.uiBinder().createAndBindUi(this)); - TOUCH_WIDGET_IMPL.addTouchHandler(this, new SliderTouchHandler()); - max = 100; - value = 0; - } - - @Override - public HandlerRegistration addValueChangeHandler(ValueChangeHandler handler) { - return addHandler(handler, ValueChangeEvent.getType()); - } - - /** - * Set the maximum of the pointer - * - * @param max the maximum to use - */ - public void setMax(int max) { - if (max <= 0) { - throw new IllegalArgumentException("max > 0"); - } - this.max = max; - } - - /** - * get the maximum of the pointer - * - * @return the maximum of the pointer - */ - public int getMax() { - return max; - } - - @Override - public Integer getValue() { - return value; - } - - @Override - public void setValue(Integer value) { - setValue(value, true); - } - - @Override - protected void onAttach() { - super.onAttach(); - Scheduler.get().scheduleDeferred(new ScheduledCommand() { - @Override - public void execute() { - setSliderPos(value); - } - }); - } - - @Override - public void setValue(Integer value, boolean fireEvents) { - setValue(value, fireEvents, true); - } - - @UiFactory - public SliderAppearance getApperance() { - return apperance; - } - - protected void setValue(Integer value, boolean fireEvents, boolean updateSlider) { - if (value == null) { - throw new IllegalArgumentException("value can not be null"); - } - - if (value < 0) { - throw new IllegalArgumentException("value >= 0"); - } - - if (value >= max) { - throw new IllegalArgumentException("value >= max"); - } - - int oldValue = this.value; - this.value = value; - if (updateSlider) { - setSliderPos(value); - } - - if (fireEvents) { - ValueChangeEvent.fireIfNotEqual(this, oldValue, value); - } - } - - private void setSliderPos(int value) { - - if (!isAttached()) { - return; - } - - int width = bar.getOffsetWidth(); - int sliderPos = value * width / max; - setPos(sliderPos); - - } - - private void setValueContrained(int x) { - x = x - Slider.this.getAbsoluteLeft(); - int width = bar.getOffsetWidth(); - - if (x < 0) { - x = 0; - } - - if (x > (width - 1)) { - x = width - 1; - } - - // scale it to max - int componentValue = x * max / width; - setValue(componentValue, true, false); - - setPos(x); - } - - private void setPos(int x) { - CssUtil.translate(pointer, x, 0); - } + private class SliderTouchHandler implements TouchHandler { + + @Override + public void onTouchStart(TouchStartEvent event) { + setValueContrained(event.getTouches().get(0).getClientX()); + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.setCapture(getElement()); + } + event.stopPropagation(); + event.preventDefault(); + } + + @Override + public void onTouchMove(TouchMoveEvent event) { + + setValueContrained(event.getTouches().get(0).getClientX()); + event.stopPropagation(); + event.preventDefault(); + } + + @Override + public void onTouchEnd(TouchEndEvent event) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.releaseCapture(getElement()); + } + event.stopPropagation(); + event.preventDefault(); + } + + @Override + public void onTouchCancel(TouchCancelEvent event) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { + DOM.releaseCapture(getElement()); + } + } + } + + private static final SliderAppearance DEFAULT_APPEARANCE = GWT.create(SliderAppearance.class); + + private static final TouchWidgetImpl TOUCH_WIDGET_IMPL = GWT.create(TouchWidgetImpl.class); + + private int value; + private int max; + private final SliderAppearance apperance; + + @UiField + public Element pointer; + @UiField + public Element bar; + + public Slider() { + this(DEFAULT_APPEARANCE); + } + + public Slider(SliderAppearance apperance) { + this.apperance = apperance; + setElement(this.apperance.uiBinder().createAndBindUi(this)); + TOUCH_WIDGET_IMPL.addTouchHandler(this, new SliderTouchHandler()); + max = 100; + value = 0; + } + + @Override + public HandlerRegistration addValueChangeHandler(ValueChangeHandler handler) { + return addHandler(handler, ValueChangeEvent.getType()); + } + + /** + * Set the maximum of the pointer + * + * @param max + * the maximum to use + */ + public void setMax(int max) { + if (max <= 0) { + throw new IllegalArgumentException("max > 0"); + } + this.max = max; + } + + /** + * get the maximum of the pointer + * + * @return the maximum of the pointer + */ + public int getMax() { + return max; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public void setValue(Integer value) { + setValue(value, true); + } + + @Override + protected void onAttach() { + super.onAttach(); + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + setSliderPos(value); + } + }); + } + + @Override + public void setValue(Integer value, boolean fireEvents) { + setValue(value, fireEvents, true); + } + + @UiFactory + public SliderAppearance getApperance() { + return apperance; + } + + protected void setValue(Integer value, boolean fireEvents, boolean updateSlider) { + if (value == null) { + throw new IllegalArgumentException("value can not be null"); + } + + if (value < 0) { + throw new IllegalArgumentException("value >= 0"); + } + + if (value >= max) { + throw new IllegalArgumentException("value >= max"); + } + + int oldValue = this.value; + this.value = value; + if (updateSlider) { + setSliderPos(value); + } + + if (fireEvents) { + ValueChangeEvent.fireIfNotEqual(this, oldValue, value); + } + } + + private void setSliderPos(int value) { + + if (!isAttached()) { + return; + } + + int width = bar.getOffsetWidth(); + int sliderPos = value * width / max; + setPos(sliderPos); + + } + + private void setValueContrained(int x) { + x = x - Slider.this.getAbsoluteLeft(); + int width = bar.getOffsetWidth(); + + if (x < 0) { + x = 0; + } + + if (x > (width - 1)) { + x = width - 1; + } + + // scale it to max + int componentValue = x * max / width; + setValue(componentValue, true, false); + + setPos(x); + } + + private void setPos(int x) { + CssUtil.translate(pointer, x, 0); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/CellList.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/CellList.java index 964d140de..45ee21280 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/CellList.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/CellList.java @@ -13,6 +13,8 @@ */ package com.googlecode.mgwt.ui.client.widget.list.celllist; +import java.util.List; + import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.EventTarget; @@ -29,14 +31,12 @@ import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.Widget; - import com.googlecode.mgwt.dom.client.event.tap.Tap; import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; import com.googlecode.mgwt.dom.client.recognizer.EventPropagator; +import com.googlecode.mgwt.ui.client.MGWT; import com.googlecode.mgwt.ui.client.widget.touch.TouchWidgetImpl; -import java.util.List; - /** * * A widget that renders its children as a list @@ -123,7 +123,12 @@ public void onTouchStart(TouchStartEvent event) { return; } - event.preventDefault(); + // if windows phone then do not prevent default, causes scrolling issues when + // in scroll panel (not sure why), ie10 desktop is fine + if (!MGWT.getOsDetection().isWindowsPhone()) + { + event.preventDefault(); + } // text node use the parent.. if (Node.is(eventTarget) && !Element.is(eventTarget)) { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/GroupingCellListDefaultAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/GroupingCellListDefaultAppearance.java index 9e96d5e3f..aff53525b 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/GroupingCellListDefaultAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/GroupingCellListDefaultAppearance.java @@ -23,6 +23,7 @@ public class GroupingCellListDefaultAppearance extends GroupingCellListAbstractA static { Resources.INSTANCE.css().ensureInjected(); + Resources.INSTANCE.groupCss().ensureInjected(); } interface Resources extends ClientBundle { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/celllist.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/celllist.css index 605fcc0e2..6ec315966 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/celllist.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/celllist.css @@ -71,6 +71,12 @@ } } +@if user.agent ie10 { + .mgwt-List-Head-Element, .mgwt-List > .mgwt-List-Head-Element { + background-color: #288ede; + } +} + @if user.agent gecko1_8 { .mgwt-List-Head-Element, .mgwt-List > .mgwt-List-Head-Element { background-color: #288ede; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/grouping-celllist.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/grouping-celllist.css index e43c31bd5..e97145a35 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/grouping-celllist.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/celllist/grouping-celllist.css @@ -9,9 +9,16 @@ } } +@if user.agent ie10 { + .mgwt-GroupingList { + display: -ms-flexbox; + } +} + @if user.agent gecko1_8 { .mgwt-GroupingList { display: -moz-box; + display: -ms-flexbox; } } @@ -45,9 +52,17 @@ } } +@if user.agent ie10 { + .mgwt-GroupingList-Selection-Bar { + display: -ms-flexbox; + -ms-flex-direction: column; + } +} + @if user.agent gecko1_8 { .mgwt-GroupingList-Selection-Bar { display: -moz-box; + display: -ms-flexbox; -moz-box-orient: vertical; } } @@ -69,6 +84,12 @@ } } +@if user.agent ie10 { + .mgwt-GroupingList-Selection-Bar > li{ + -ms-flex: 1 1; + } +} + @if user.agent gecko1_8 { .mgwt-GroupingList-Selection-Bar > li{ -moz-box-flex: 1; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/widgetlist/widgetlist.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/widgetlist/widgetlist.css index c735fefe3..1cfbd8a52 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/list/widgetlist/widgetlist.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/list/widgetlist/widgetlist.css @@ -43,6 +43,12 @@ } } +@if user.agent ie10 { + .mgwt-WidgetList-Entry { + display: -ms-flexbox; + } +} + @if user.agent gecko1_8 { .mgwt-WidgetList-Entry { width: 100%; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/IOS71BodyBug.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/IOS71BodyBug.java index 37227190b..1dde0bb9a 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/IOS71BodyBug.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/IOS71BodyBug.java @@ -45,30 +45,36 @@ interface Resources extends ClientBundle { TextResource css(); } + /** + * Only apply fix if ios71 + */ public static void applyWorkaround() { - // iOS bug fix needs only be applied in portrait orientation. - // Fix is deferred until the orientation change event is fired. - if (MGWT.getOrientation() == ORIENTATION.PORTRAIT) { - registerOrientationChangeEvent(); - return; + if (isIOS71() && (MGWT.getOsDetection().isIPad() || MGWT.getOsDetection().isIPadRetina())) { + // iOS bug fix needs only be applied in portrait orientation. + // Fix is deferred until the orientation change event is fired. + if (MGWT.getOrientation() == ORIENTATION.PORTRAIT) { + registerOrientationChangeEvent(); + return; + } + applyFix(); } + } - if (MGWT.getOsDetection().isIPad() || MGWT.getOsDetection().isIPadRetina()) { - if (isIOS71() && windowInnerHeight() == 672) { + private static void applyFix() { + if (windowInnerHeight() == 672) { String text = Resources.INSTANCE.css().getText(); StyleInjector.inject(text); Document.get().getBody().addClassName("__fixIOS7BodyBug"); } - } } - private static void registerOrientationChangeEvent() { orientationChangeHandler = MGWT.addOrientationChangeHandler(new OrientationChangeHandler() { @Override public void onOrientationChanged(OrientationChangeEvent event) { + orientationChangeHandler.removeHandler(); orientationChangeHandler = null; - applyWorkaround(); + applyFix(); } }); } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/main.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/main.css index a13553213..bf3411158 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/main.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/main.css @@ -1,13 +1,27 @@ @external body, *; + * { -webkit-text-size-adjust: none; -webkit-touch-callout: none; -webkit-text-size-adjust: none; + -moz-text-size-adjust: none; + -moz-touch-callout: none; + -moz-text-size-adjust: none; + -ms-text-size-adjust: none; + -ms-touch-callout: none; + -ms-text-size-adjust: none; margin: 0px; padding: 0px; font-family: Helvetica, sans-serif; } +@if user.agent safari { +* { + -webkit-text-size-adjust: none; + -webkit-touch-callout: none; + -webkit-text-size-adjust: none; + -webkit-user-select: none; + } body { margin: 0; @@ -17,6 +31,10 @@ body { font-weight: 400; -webkit-perspective: 800; -webkit-transform-style: preserve-3d; + -moz-perspective: 800; + -moz-transform-style: preserve-3d; + -ms-perspective: 800; + -ms-transform-style: preserve-3d; position: absolute; width: 100%; height: 100%; @@ -25,32 +43,80 @@ body { :focus { outline-color: transparent; outline-style: none; + input , textarea{ + -webkit-user-select: text; + } } -@if user.agent gecko1_8 { +@if user.agent ie10 { * { -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; } input, textarea { -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + -ms-user-select: none; + -ms-text-size-adjust: none; + -ms-touch-select: none; + -ms-flex: 0 1 auto; + } + + input , textarea{ + -ms-user-select: text; + } + + a img { + border: none; } } @if user.agent gecko1_8 { * { -moz-user-select: none; + -ms-user-select: none; } input, textarea { -moz-user-select: text; + -ms-user-select: text; } } + +@if user.agent safari { +body { + -webkit-perspective: 800; + -webkit-transform-style: preserve-3d; + } +} + +body { + margin: 0; + padding: 0; + background: #dfe2e2; + color: #000; + font-weight: 400; + position: absolute; + width: 100%; + height: 100%; + perspective: 800; + transform-style: preserve-3d; +} + + +:focus { + outline-color: transparent; + outline-style: none; +} + input:FOCUS,button:FOCUS { outline: none; } button { outline: none; -} +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/selection.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/selection.css index 7d6f24c66..f8e60086e 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/selection.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/selection.css @@ -8,9 +8,16 @@ } } +@if user.agent ie10 { + .userSelectNone { + -ms-user-select: none; + } +} + @if user.agent gecko1_8 { .userSelectNone { -moz-user-select: none; + -ms-user-select: none; } } @@ -26,9 +33,16 @@ } } +@if user.agent ie10 { + .userSelectText { + -ms-user-select: text; + } +} + @if user.agent gecko1_8 { .userSelectText { -moz-user-select: text; + -ms-user-select: text; } } @@ -44,9 +58,16 @@ } } +@if user.agent ie10 { + .userSelectAll { + -ms-user-select: all; + } +} + @if user.agent gecko1_8 { .userSelectAll { -moz-user-select: all; + -ms-user-select: all; } } @@ -62,9 +83,16 @@ } } +@if user.agent ie10 { + .userSelectElement { + -ms-user-select: element; + } +} + @if user.agent gecko1_8 { .userSelectElement { -moz-user-select: element; + -ms-user-select: element; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/util.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/util.css index 81a67de77..a4ed37733 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/main/util.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/main/util.css @@ -1,11 +1,11 @@ @media (orientation:portrait) { .landscapeonly { - display: none; + display: none !important; } } @media (orientation:landscape) { .portraitonly { - display: none; + display: none !important; } } \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/overlay/overlay-menu.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/overlay/overlay-menu.css index 616dd80fb..2df185205 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/overlay/overlay-menu.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/overlay/overlay-menu.css @@ -39,18 +39,27 @@ @if user.agent safari { .mgwt-OverlayMenu-nav { - -webkit-transform-property: opacity; + -webkit-transition-property: opacity; } .mgwt-OverlayMenu-main { - -webkit-transform-property: left; + -webkit-transition-property: left; + } +} + +@if user.agent ie10 { + .mgwt-OverlayMenu-nav { + transition-property: opacity; + } + .mgwt-OverlayMenu-main { + transition-property: left; } } @if user.agent gecko1_8 { .mgwt-OverlayMenu-nav { - -moz-transform-property: opacity; + -moz-transition-property: opacity; } .mgwt-OverlayMenu-main { - -moz-transform-property: left; + -moz-transition-property: left; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/swipe/swipe-menu.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/swipe/swipe-menu.css index 0733b6fa3..783cfdd2f 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/swipe/swipe-menu.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/menu/swipe/swipe-menu.css @@ -40,12 +40,23 @@ } } +@if user.agent ie10 { + .opened { + transform: translate3d(0, 0, 0); + } + .closed { + transform: translate3d(-40%, 0, 0); + } +} + @if user.agent gecko1_8 { .opened { -moz-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); } .closed { -moz-transform: translate3d(-40%, 0, 0); + -ms-transform: translate3d(-40%, 0, 0); } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.gwt.xml b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.gwt.xml index d3e37785d..495a94487 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.gwt.xml +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.gwt.xml @@ -15,4 +15,29 @@ under * the License. + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.java index 8d90ae98a..c47cf53c5 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanel.java @@ -13,6 +13,8 @@ */ package com.googlecode.mgwt.ui.client.widget.panel.flex; +import java.util.Iterator; + import com.google.gwt.core.shared.GWT; import com.google.gwt.uibinder.client.UiFactory; import com.google.gwt.uibinder.client.UiField; @@ -22,146 +24,142 @@ import com.google.gwt.user.client.ui.IndexedPanel; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.Widget; - import com.googlecode.mgwt.ui.client.widget.panel.flex.FlexPropertyHelper.Alignment; import com.googlecode.mgwt.ui.client.widget.panel.flex.FlexPropertyHelper.Justification; import com.googlecode.mgwt.ui.client.widget.panel.flex.FlexPropertyHelper.Orientation; -import java.util.Iterator; - /** * A FlexPanel uses the flexible box model to layout its children. *

- * Note: For children implementing {@link IsFlexible} flex:1 is applied automatically when added - * to this panel. + * Note: For children implementing {@link IsFlexible} flex:1 is applied + * automatically when added to this panel. * * @author Daniel Kurka */ public class FlexPanel extends Composite implements HasWidgets.ForIsWidget, IndexedPanel.ForIsWidget { - public static final FlexPanelAppearance DEFAULT_APPERANCE = GWT.create(FlexPanelAppearance.class); - - @UiField - protected FlowPanel container; - - private FlexPanelAppearance appearance; - - public FlexPanel() { - this(DEFAULT_APPERANCE); - } - - public FlexPanel(FlexPanelAppearance appearance) { - this.appearance = appearance; - initWidget(this.appearance.uiBinder().createAndBindUi(this)); - } - - @Override - public void add(Widget w) { - if (w instanceof IsFlexible) { - w.addStyleName(appearance.css().flexible()); - } - container.add(w); - } - - @Override - public void clear() { - Iterator iterator = container.iterator(); - while (iterator.hasNext()) { - Widget w = iterator.next(); - if (w instanceof IsFlexible) { - w.removeStyleName(appearance.css().flexible()); - } - } - container.clear(); - } - - @Override - public Iterator iterator() { - return container.iterator(); - } - - @Override - public boolean remove(Widget w) { - if (w instanceof IsFlexible) { - w.removeStyleName(appearance.css().flexible()); - } - return container.remove(w); - } - - @Override - public void add(IsWidget w) { - if (w.asWidget() instanceof IsFlexible) { - w.asWidget().addStyleName(appearance.css().flexible()); - } - container.add(w); - } - - public void add(Widget widget, double flex) { - container.add(widget); - - FlexPropertyHelper.setFlex(widget.getElement(), flex); - } - - @Override - public boolean remove(IsWidget w) { - if (w.asWidget() instanceof IsFlexible) { - w.asWidget().removeStyleName(appearance.css().flexible()); - } - return container.remove(w); - } - - public void setOrientation(Orientation value) { - FlexPropertyHelper.setOrientation(getElement(), value); - } - - public void setAlignment(Alignment value) { - FlexPropertyHelper.setAlignment(getElement(), value); - } - - public void setJustification(Justification value) { - FlexPropertyHelper.setJustification(getElement(), value); - } - - - public void clearAlignment() { - FlexPropertyHelper.clearAlignment(getElement()); - } - - public void clearJustification() { - FlexPropertyHelper.clearJustification(getElement()); - } - - @UiFactory - protected FlexPanelAppearance getAppearance() { - return appearance; - } - - @Override - public Widget getWidget(int index) { - return container.getWidget(index); - } - - @Override - public int getWidgetCount() { - return container.getWidgetCount(); - } - - @Override - public int getWidgetIndex(Widget child) { - return container.getWidgetIndex(child); - } - - @Override - public boolean remove(int index) { - Widget w = getWidget(index); - if (w instanceof IsFlexible) { - w.removeStyleName(appearance.css().flexible()); - } - return container.remove(index); - } - - @Override - public int getWidgetIndex(IsWidget child) { - return container.getWidgetIndex(child); - } + public static final FlexPanelAppearance DEFAULT_APPERANCE = GWT.create(FlexPanelAppearance.class); + + @UiField + protected FlowPanel container; + + private FlexPanelAppearance appearance; + + public FlexPanel() { + this(DEFAULT_APPERANCE); + } + + public FlexPanel(FlexPanelAppearance appearance) { + this.appearance = appearance; + initWidget(this.appearance.uiBinder().createAndBindUi(this)); + } + + @Override + public void add(Widget w) { + if (w instanceof IsFlexible) { + w.addStyleName(appearance.css().flexible()); + } + container.add(w); + } + + @Override + public void clear() { + Iterator iterator = container.iterator(); + while (iterator.hasNext()) { + Widget w = iterator.next(); + if (w instanceof IsFlexible) { + w.removeStyleName(appearance.css().flexible()); + } + } + container.clear(); + } + + @Override + public Iterator iterator() { + return container.iterator(); + } + + @Override + public boolean remove(Widget w) { + if (w instanceof IsFlexible) { + w.removeStyleName(appearance.css().flexible()); + } + return container.remove(w); + } + + @Override + public void add(IsWidget w) { + if (w.asWidget() instanceof IsFlexible) { + w.asWidget().addStyleName(appearance.css().flexible()); + } + container.add(w); + } + + public void add(Widget widget, double flex) { + container.add(widget); + + FlexPropertyHelper.setFlex(widget.getElement(), flex); + } + + @Override + public boolean remove(IsWidget w) { + if (w.asWidget() instanceof IsFlexible) { + w.asWidget().removeStyleName(appearance.css().flexible()); + } + return container.remove(w); + } + + public void setOrientation(Orientation value) { + FlexPropertyHelper.setOrientation(getElement(), value); + } + + public void setAlignment(Alignment value) { + FlexPropertyHelper.setAlignment(getElement(), value); + } + + public void setJustification(Justification value) { + FlexPropertyHelper.setJustification(getElement(), value); + } + + public void clearAlignment() { + FlexPropertyHelper.clearAlignment(getElement()); + } + + public void clearJustification() { + FlexPropertyHelper.clearJustification(getElement()); + } + + @UiFactory + protected FlexPanelAppearance getAppearance() { + return appearance; + } + + @Override + public Widget getWidget(int index) { + return container.getWidget(index); + } + + @Override + public int getWidgetCount() { + return container.getWidgetCount(); + } + + @Override + public int getWidgetIndex(Widget child) { + return container.getWidgetIndex(child); + } + + @Override + public boolean remove(int index) { + Widget w = getWidget(index); + if (w instanceof IsFlexible) { + w.removeStyleName(appearance.css().flexible()); + } + return container.remove(index); + } + + @Override + public int getWidgetIndex(IsWidget child) { + return container.getWidgetIndex(child); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanelDefaultAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanelDefaultAppearance.java index cbc913028..4b1b4d7b2 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanelDefaultAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPanelDefaultAppearance.java @@ -20,31 +20,31 @@ import com.google.gwt.user.client.ui.Panel; public class FlexPanelDefaultAppearance implements FlexPanelAppearance { - static { - Resources.INSTANCE.css().ensureInjected(); - } + static { + Resources.INSTANCE.css().ensureInjected(); + } - interface Resources extends ClientBundle { + interface Resources extends ClientBundle { - Resources INSTANCE = GWT.create(Resources.class); + Resources INSTANCE = GWT.create(Resources.class); - @Source({"flex.css"}) - FlexPanelCss css(); - } + @Source({ "flex.css" }) + FlexPanelCss css(); + } - @UiTemplate("FlexPanelBaseAppearance.ui.xml") - interface Binder extends UiBinder { - } + @UiTemplate("FlexPanelBaseAppearance.ui.xml") + interface Binder extends UiBinder { + } - private static final Binder UI_BINDER = GWT.create(Binder.class); + private static final Binder UI_BINDER = GWT.create(Binder.class); - @Override - public UiBinder uiBinder() { - return UI_BINDER; - } + @Override + public UiBinder uiBinder() { + return UI_BINDER; + } - @Override - public FlexPanelCss css() { - return Resources.INSTANCE.css(); - } + @Override + public FlexPanelCss css() { + return Resources.INSTANCE.css(); + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelper.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelper.java index 4c71034e9..255695009 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelper.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelper.java @@ -15,157 +15,106 @@ */ package com.googlecode.mgwt.ui.client.widget.panel.flex; +import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; -public final class FlexPropertyHelper { +public abstract class FlexPropertyHelper { + private static final FlexPropertyHelper impl = GWT.create(FlexPropertyHelper.class); + public static enum Alignment { - START("flex-start"), END("flex-end"), CENTER("center"), STRETCH("stretch"), BASELINE("baseline"); - - private final String cssValue; - - private Alignment(String cssValue) { - this.cssValue = cssValue; - } - - private static String getCssProperty() { - return "AlignItems"; - } + START, END, CENTER, STRETCH, BASELINE, NONE; + } - private String getCssValue() { - return cssValue; - } + public static enum AlignmentSelf { + START, END, CENTER, STRETCH, BASELINE, AUTO; } public static enum Justification { - START("flex-start"), END("flex-end"), CENTER("center"), SPACE_BETWEEN("space-between"); - - private final String cssValue; - - private Justification(String cssValue) { - this.cssValue = cssValue; - } - - private static String getCssProperty() { - return "JustifyContent"; - } - - private String getCssValue() { - return cssValue; - } + START, END, CENTER, SPACE_BETWEEN, SPACE_AROUND, NONE; } - + public static enum Orientation { - HORIZONTAL("row"), VERTICAL("column"); + HORIZONTAL, HORIZONTAL_REVERSE, VERTICAL, VERTICAL_REVERSE; + } - private final String cssValue; + public static enum FlexWrap { + NOWRAP, WRAP, WRAP_REVERSE; + } - private Orientation(String cssValue) { - this.cssValue = cssValue; + public static void setElementAsFlexContainer(Element el) + { + setElementAsFlexContainer(el, null); + } + + public static void setElementAsFlexContainer(Element el, Orientation orientation) + { + if (orientation == null) + { + orientation = Orientation.HORIZONTAL; // the default } + impl._setElementAsFlexContainer(el, orientation); + } - private static String getCssProperty() { - return "Direction"; - } + public static void setFlex(Element el, double grow) { + setFlex(el, grow, "0%"); + } - private String getCssValue() { - return cssValue; - } + public static void setFlex(Element el, double grow, double shrink) { + setFlex(el, grow, shrink, "0%"); } - public static void setFlex(Element el, double flex) { - /* iOS < 7 && Android < 4.4*/ - el.getStyle().setProperty("WebkitBoxFlex", Double.toString(flex)); + public static void setFlex(Element el, double grow, double shrink, String basis) { + impl._setFlex(el, grow, shrink, basis); + } - el.getStyle().setProperty("MozFlex", Double.toString(flex)); - el.getStyle().setProperty("WebkitFlex", Double.toString(flex)); - el.getStyle().setProperty("flex", Double.toString(flex)); + public static void setFlex(Element el, double grow, String basis) { + impl._setFlex(el, grow, basis); } - private static void setFlexProperty(Element el, String name, String value) { - setStyleProperty(el, "MozFlex" + name, value); - setStyleProperty(el, "webkitFlex" + name, value); - setStyleProperty(el, "flex" + name, value); + public static void setFlexOrder(Element el, int order) { + impl._setFlexOrder(el, order); } - private static void setProperty(Element el, String name, String value) { - setStyleProperty(el, "Moz" + name, value); - setStyleProperty(el, "webkit" + name, value); - setStyleProperty(el, name, value); + public static void setAlignment(Element el, Alignment alignment) { + impl._setAlignmentProperty(el, alignment); } - public static void setOrientation(Element el, Orientation value) { - // iOS6 & Android < 4.4 - switch (value) { - case HORIZONTAL: - el.getStyle().setProperty("WebkitBoxOrient", "horizontal"); - break; - case VERTICAL: - el.getStyle().setProperty("WebkitBoxOrient", "vertical"); - break; - default: - throw new RuntimeException(); - } - setFlexProperty(el, Orientation.getCssProperty(), value.getCssValue()); - } - - public static void setAlignment(Element el, Alignment value) { - // iOS6 & Android < 4.4 - switch (value) { - case START: - el.getStyle().setProperty("WebkitBoxAlign", "start"); - break; - case CENTER: - el.getStyle().setProperty("WebkitBoxAlign", "center"); - break; - case END: - el.getStyle().setProperty("WebkitBoxAlign", "end"); - break; - case BASELINE: - el.getStyle().setProperty("WebkitBoxAlign", "baseline"); - break; - case STRETCH: - el.getStyle().setProperty("WebkitBoxAlign", "stretch"); - break; - default: - throw new RuntimeException(); - } - setProperty(el, Alignment.getCssProperty(), value.getCssValue()); - } - - public static void setJustification(Element el, Justification value) { - // iOS6 & Android < 4.4 - switch (value) { - case START: - el.getStyle().setProperty("WebkitBoxPack", "start"); - break; - case CENTER: - el.getStyle().setProperty("WebkitBoxPack", "center"); - break; - case END: - el.getStyle().setProperty("WebkitBoxPack", "end"); - break; - case SPACE_BETWEEN: - el.getStyle().setProperty("WebkitBoxPack", "justify"); - break; - default: - throw new RuntimeException(); - } - setProperty(el, Justification.getCssProperty(), value.getCssValue()); + public static void setAlignmentSelf(Element el, AlignmentSelf alignmentSelf) { + impl._setAlignmentSelfProperty(el, alignmentSelf); } - private static void setStyleProperty(Element el, String property, String value) { - el.getStyle().setProperty(property, value); + public static void setOrientation(Element el, Orientation orientation) { + impl._setOrientationProperty(el, orientation); + } + + public static void setJustification(Element el, Justification justification) { + impl._setJustificationProperty(el, justification); } - private FlexPropertyHelper() { + public static void setFlexWrap(Element el, FlexWrap flexWrap) { + impl._setFlexWrapProperty(el, flexWrap); } - public static void clearAlignment(Element element) { - setProperty(element, Alignment.getCssProperty(), ""); + public static void clearAlignment(Element el) { + impl._setAlignmentProperty(el,Alignment.NONE); } - public static void clearJustification(Element element) { - setProperty(element, Justification.getCssProperty(), ""); + public static void clearJustification(Element el) { + impl._setJustificationProperty(el,Justification.NONE); + } + + protected void setStyleProperty(Element el, String property, String value) { + el.getStyle().setProperty(property, value); } + + protected abstract void _setElementAsFlexContainer(Element el, Orientation orientation); + protected abstract void _setFlex(Element el, double grow, String basis); + protected abstract void _setFlex(Element el, double grow, double shrink, String basis); + protected abstract void _setFlexOrder(Element el, int order); + protected abstract void _setAlignmentProperty(Element el, Alignment alignment); + protected abstract void _setAlignmentSelfProperty(Element el, AlignmentSelf alignmentSelf); + protected abstract void _setOrientationProperty(Element el, Orientation orientation); + protected abstract void _setJustificationProperty(Element el, Justification justification); + protected abstract void _setFlexWrapProperty(Element el, FlexWrap flexWrap); } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperIE10.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperIE10.java new file mode 100644 index 000000000..6cf4efd40 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperIE10.java @@ -0,0 +1,183 @@ +package com.googlecode.mgwt.ui.client.widget.panel.flex; + +import com.google.gwt.dom.client.Element; + +/** + * Unbelievable - IE10 does not obey the camel case rule correctly + * + * @author pfrench + * + */ +public class FlexPropertyHelperIE10 extends FlexPropertyHelper { + + @Override + public void _setAlignmentProperty(Element el, Alignment alignment) { + String value; + switch (alignment) { + case START: { + value = "start"; + break; + } + case END: { + value = "end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "msFlexAlign", value); + } + + @Override + public void _setOrientationProperty(Element el, Orientation orientation) { + String value; + switch (orientation) { + case HORIZONTAL: { + value = "row"; + break; + } + case VERTICAL: { + value = "column"; + break; + } + case HORIZONTAL_REVERSE: { + value = "row-reverse"; + break; + } + case VERTICAL_REVERSE: { + value = "column-reverse"; + break; + } + default: { + value = ""; + break; + } + } + setStyleProperty(el, "msFlexDirection", value); + } + + @Override + public void _setJustificationProperty(Element el, Justification justification) { + String value; + switch (justification) { + case START: { + value = "start"; + break; + } + case END: { + value = "end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case SPACE_AROUND: { + value = "distribute"; + break; + } + case SPACE_BETWEEN: { + value = "justify"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "msFlexPack", value); + } + + @Override + protected void _setAlignmentSelfProperty(Element el, AlignmentSelf alignmentSelf) { + String value; + switch (alignmentSelf) { + case START: { + value = "start"; + break; + } + case END: { + value = "end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = "auto"; + } + } + setStyleProperty(el, "msFlexItemAlign", value); + } + + @Override + protected void _setFlexWrapProperty(Element el, FlexWrap flexWrap) { + String value; + switch (flexWrap) { + case NOWRAP: { + value = "nowrap"; + break; + } + case WRAP: { + value = "wrap"; + break; + } + case WRAP_REVERSE: { + value = "wrap-reverse"; + break; + } + default: { + value = "nowrap"; + break; + } + } + setStyleProperty(el, "msFlexWrap", value); + } + + /** + * IE10/11 sets flex-shrink to 0 if omitted whereas webkit sets to 1, so + * lets copy webkit + */ + @Override + protected void _setFlex(Element el, double grow, String basis) { + _setFlex(el, grow, 1, basis); + } + + @Override + protected void _setFlex(Element el, double grow, double shrink, String basis) { + setStyleProperty(el, "msFlex", Double.toString(grow) + " " + Double.toString(shrink) + " " + (basis == null ? "0%" : basis)); + } + + @Override + public void _setFlexOrder(Element el, int order) { + setStyleProperty(el, "msFlexOrder", Integer.toString(order)); + } + + @Override + protected void _setElementAsFlexContainer(Element el, Orientation orientation) { + setStyleProperty(el, "display", "-ms-flexbox"); + _setOrientationProperty(el, orientation); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperMoz.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperMoz.java new file mode 100644 index 000000000..b55116f17 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperMoz.java @@ -0,0 +1,175 @@ +package com.googlecode.mgwt.ui.client.widget.panel.flex; + +import com.google.gwt.dom.client.Element; + +public class FlexPropertyHelperMoz extends FlexPropertyHelper { + + @Override + public void _setAlignmentProperty(Element el, Alignment alignment) { + String value; + switch (alignment) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "MozAlignItems", value); + } + + @Override + public void _setOrientationProperty(Element el, Orientation orientation) { + String value; + switch (orientation) { + case HORIZONTAL: { + value = "row"; + break; + } + case VERTICAL: { + value = "column"; + break; + } + case HORIZONTAL_REVERSE: { + value = "row-reverse"; + break; + } + case VERTICAL_REVERSE: { + value = "column-reverse"; + break; + } + default: { + value = ""; + break; + } + } + setStyleProperty(el, "MozFlexDirection", value); + } + + @Override + public void _setJustificationProperty(Element el, Justification justification) { + String value; + switch (justification) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case SPACE_AROUND: { + value = "space-around"; + break; + } + case SPACE_BETWEEN: { + value = "space-between"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "MozJustifyContent", value); + } + + @Override + protected void _setAlignmentSelfProperty(Element el, AlignmentSelf alignmentSelf) + { + String value; + switch (alignmentSelf) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = "auto"; + } + } + setStyleProperty(el, "MozAlignSelf", value); + } + + @Override + protected void _setFlexWrapProperty(Element el, FlexWrap flexWrap) + { + String value; + switch (flexWrap) { + case NOWRAP: { + value = "nowrap"; + break; + } + case WRAP: { + value = "wrap"; + break; + } + case WRAP_REVERSE: { + value = "wrap-reverse"; + break; + } + default: { + value = "nowrap"; + break; + } + } + setStyleProperty(el, "MozFlexWrap", value); + } + + @Override + protected void _setFlex(Element el, double grow, String basis) { + setStyleProperty(el,"MozFlex", Double.toString(grow)+" "+(basis == null ? "0%" : basis)); + } + + @Override + protected void _setFlex(Element el, double grow, double shrink, String basis) { + setStyleProperty(el,"MozFlex", Double.toString(grow)+" "+Double.toString(shrink)+" "+(basis == null ? "0%" : basis)); + } + + @Override + public void _setFlexOrder(Element el, int order) { + setStyleProperty(el,"MozOrder", Integer.toString(order)); + } + + @Override + protected void _setElementAsFlexContainer(Element el, Orientation orientation) { + setStyleProperty(el,"display", "-moz-flex"); + _setOrientationProperty(el,orientation); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperStandard.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperStandard.java new file mode 100644 index 000000000..02c502e32 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperStandard.java @@ -0,0 +1,175 @@ +package com.googlecode.mgwt.ui.client.widget.panel.flex; + +import com.google.gwt.dom.client.Element; + +public class FlexPropertyHelperStandard extends FlexPropertyHelper { + + @Override + public void _setAlignmentProperty(Element el, Alignment alignment) { + String value; + switch (alignment) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "alignItems", value); + } + + @Override + public void _setOrientationProperty(Element el, Orientation orientation) { + String value; + switch (orientation) { + case HORIZONTAL: { + value = "row"; + break; + } + case VERTICAL: { + value = "column"; + break; + } + case HORIZONTAL_REVERSE: { + value = "row-reverse"; + break; + } + case VERTICAL_REVERSE: { + value = "column-reverse"; + break; + } + default: { + value = ""; + break; + } + } + setStyleProperty(el, "flexDirection", value); + } + + @Override + public void _setJustificationProperty(Element el, Justification justification) { + String value; + switch (justification) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case SPACE_AROUND: { + value = "space-around"; + break; + } + case SPACE_BETWEEN: { + value = "space-between"; + break; + } + default: { + value = ""; + } + } + setStyleProperty(el, "justifyContent", value); + } + + @Override + protected void _setAlignmentSelfProperty(Element el, AlignmentSelf alignmentSelf) + { + String value; + switch (alignmentSelf) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = "auto"; + } + } + setStyleProperty(el, "alignSelf", value); + } + + @Override + protected void _setFlexWrapProperty(Element el, FlexWrap flexWrap) + { + String value; + switch (flexWrap) { + case NOWRAP: { + value = "nowrap"; + break; + } + case WRAP: { + value = "wrap"; + break; + } + case WRAP_REVERSE: { + value = "wrap-reverse"; + break; + } + default: { + value = "nowrap"; + break; + } + } + setStyleProperty(el, "flexWrap", value); + } + + @Override + protected void _setFlex(Element el, double grow, String basis) { + setStyleProperty(el,"flex", Double.toString(grow)+" "+(basis == null ? "0%" : basis)); + } + + @Override + protected void _setFlex(Element el, double grow, double shrink, String basis) { + setStyleProperty(el,"flex", Double.toString(grow)+" "+Double.toString(shrink)+" "+(basis == null ? "0%" : basis)); + } + + @Override + public void _setFlexOrder(Element el, int order) { + setStyleProperty(el,"order", Integer.toString(order)); + } + + @Override + protected void _setElementAsFlexContainer(Element el, Orientation orientation) { + setStyleProperty(el,"display", "flex"); + _setOrientationProperty(el,orientation); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperWebkit.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperWebkit.java new file mode 100644 index 000000000..39cd292d4 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/FlexPropertyHelperWebkit.java @@ -0,0 +1,207 @@ +package com.googlecode.mgwt.ui.client.widget.panel.flex; + +import com.google.gwt.dom.client.Element; + +public class FlexPropertyHelperWebkit extends FlexPropertyHelper { + + @Override + public void _setAlignmentProperty(Element el, Alignment alignment) { + String alignItemOldSyntax, alignItemNewSyntax; + switch (alignment) { + case START: { + alignItemOldSyntax = "start"; + alignItemNewSyntax = "flex-start"; + break; + } + case END: { + alignItemOldSyntax = "end"; + alignItemNewSyntax = "flex-end"; + break; + } + case CENTER: { + alignItemOldSyntax = "center"; + alignItemNewSyntax = "center"; + break; + } + case STRETCH: { + alignItemOldSyntax = ""; // not implemented + alignItemNewSyntax = "stretch"; + break; + } + case BASELINE: { + alignItemOldSyntax = ""; // not implemented + alignItemNewSyntax = "baseline"; + break; + } + default: { + alignItemOldSyntax = ""; + alignItemNewSyntax = ""; + } + } + setStyleProperty(el, "WebkitBoxAlign", alignItemOldSyntax); + setStyleProperty(el, "WebkitAlignItems", alignItemNewSyntax); + } + + @Override + public void _setOrientationProperty(Element el, Orientation orientation) { + String orientationOldSyntax, orientationNewSyntax; + boolean reverse = false; + switch (orientation) { + case HORIZONTAL: { + orientationOldSyntax = "horizontal"; + orientationNewSyntax = "row"; + break; + } + case VERTICAL: { + orientationOldSyntax = "vertical"; + orientationNewSyntax = "column"; + break; + } + case HORIZONTAL_REVERSE: { + orientationOldSyntax = "horizontal"; reverse = true; + orientationNewSyntax = "row-reverse"; + break; + } + case VERTICAL_REVERSE: { + orientationOldSyntax = "vertical"; reverse = true; + orientationNewSyntax = "column-reverse"; + break; + } + default: { + orientationOldSyntax = ""; + orientationNewSyntax = ""; + break; + } + } + setStyleProperty(el, "WebkitBoxOrient", orientationOldSyntax); + setStyleProperty(el, "WebkitBoxDirection", reverse ? "reverse" : "normal"); + setStyleProperty(el, "WebkitFlexDirection", orientationNewSyntax); + } + + @Override + public void _setJustificationProperty(Element el, Justification justification) { + String justificationOldSyntax, justificationNewSyntax; + switch (justification) { + case START: { + justificationOldSyntax = "start"; + justificationNewSyntax = "flex-start"; + break; + } + case END: { + justificationOldSyntax = "end"; + justificationNewSyntax = "flex-end"; + break; + } + case CENTER: { + justificationOldSyntax = "center"; + justificationNewSyntax = "center"; + break; + } + case SPACE_AROUND: { + justificationOldSyntax = ""; // not implemented + justificationNewSyntax = "space-around"; + break; + } + case SPACE_BETWEEN: { + justificationOldSyntax = "justify"; + justificationNewSyntax = "space-between"; + break; + } + default: { + justificationOldSyntax = ""; + justificationNewSyntax = ""; + } + } + setStyleProperty(el, "WebkitBoxPack", justificationOldSyntax); + setStyleProperty(el, "WebkitJustifyContent", justificationNewSyntax); + } + + @Override + protected void _setAlignmentSelfProperty(Element el, AlignmentSelf alignmentSelf) + { + String value; + switch (alignmentSelf) { + case START: { + value = "flex-start"; + break; + } + case END: { + value = "flex-end"; + break; + } + case CENTER: { + value = "center"; + break; + } + case STRETCH: { + value = "stretch"; + break; + } + case BASELINE: { + value = "baseline"; + break; + } + default: { + value = "auto"; + } + } + setStyleProperty(el, "WebkitAlignSelf", value); + } + + @Override + protected void _setFlexWrapProperty(Element el, FlexWrap flexWrap) + { + String flexWrapOldSyntax, flexWrapNewSyntax; + switch (flexWrap) { + case NOWRAP: { + flexWrapOldSyntax = "single"; + flexWrapNewSyntax = "nowrap"; + break; + } + case WRAP: { + flexWrapOldSyntax = "multiple"; + flexWrapNewSyntax = "wrap"; + break; + } + case WRAP_REVERSE: { + flexWrapOldSyntax = "multiple"; + flexWrapNewSyntax = "wrap"; + break; + } + default: { + flexWrapOldSyntax = "single"; + flexWrapNewSyntax = "nowrap"; + break; + } + } + setStyleProperty(el, "WebkitBoxLines", flexWrapOldSyntax); + setStyleProperty(el, "WebkitFlexWrap", flexWrapNewSyntax); + } + + @Override + public void _setFlex(Element el, double grow, String basis) { + setStyleProperty(el,"WebkitBoxFlex", Double.toString(grow)); + setStyleProperty(el,"WebkitFlex", Double.toString(grow)+(basis == null ? "0%" : basis)); + } + + @Override + protected void _setFlex(Element el, double grow, double shrink, String basis) { + setStyleProperty(el,"WebkitBoxFlex", Double.toString(grow)); // shrink and basis not supported + setStyleProperty(el,"WebkitFlex", Double.toString(grow)+" "+Double.toString(shrink)+" "+(basis == null ? "0%" : basis)); + } + + @Override + public void _setFlexOrder(Element el, int order) { + setStyleProperty(el,"WebkitBoxOrdinalGroup", Integer.toString(order)); + setStyleProperty(el,"WebkitOrder", Integer.toString(order)); + } + + + @Override + protected void _setElementAsFlexContainer(Element el, Orientation orientation) { + setStyleProperty(el,"display", "-webkit-box"); + setStyleProperty(el,"display", "-webkit-flex"); + _setOrientationProperty(el,orientation); + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/flex.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/flex.css index c481f710c..909db3bb9 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/flex.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/flex/flex.css @@ -7,19 +7,27 @@ display: -webkit-box; /* iOS < 7 && Android < 4.4*/ display: -webkit-flex; -webkit-box-orient: vertical; /* iOS < 7 && Android < 4.4*/ - -webkit-flex-flow: column; + -webkit-flex-direction: column; } } @if user.agent gecko1_8 { .mgwt-FlexPanel { display: -moz-box; + display: -ms-flexbox; + } +} + +@if user.agent ie10 { + .mgwt-FlexPanel { + display: -ms-flexbox; + -ms-flex-direction: column; } } .mgwt-FlexPanel { display: flex; - flex-flow: column; + flex-direction: column; } .mgwt-RootFlexPanel { @@ -37,9 +45,16 @@ } } +@if user.agent ie10 { + .mgwt-FlexPanel-flex { + -ms-flex: 1 1; + } +} + @if user.agent gecko1_8 { .mgwt-FlexPanel-flex { -moz-flex: 1; + -ms-flex: 1 1; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/PullPanelDefaultAppearance.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/PullPanelDefaultAppearance.java index 3728a911e..59e7346b5 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/PullPanelDefaultAppearance.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/PullPanelDefaultAppearance.java @@ -37,7 +37,6 @@ interface Resources extends ClientBundle { @Source("error.png") ImageResource errorImage(); - } @Override diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/pullpanel.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/pullpanel.css index 58ccf23bb..fcc298a63 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/pullpanel.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/pull/pullpanel.css @@ -5,11 +5,31 @@ @external mgwt-PullToRefresh-text, .mgwt-PullToRefresh-arrowFooter; } +@if user.agent safari { + .mgwt-PullPanel { + -webkit-box-flex: 1; /* iOS < 7 && Android < 4.4*/ + -webkit-flex: 1; + } +} + +@if user.agent ie10 { + .mgwt-PullPanel { + -ms-flex: 1 1; + } +} + +@if user.agent gecko1_8 { + .mgwt-PullPanel { + -moz-flex: 1; + } +} + .mgwt-PullPanel { flex: 1; overflow: hidden; } + .mgwt-PullPanel-container{} .mgwt-PullPanel-main{} @@ -41,9 +61,16 @@ } } +@if user.agent ie10 { + .mgwt-PullToRefresh-arrow { + transform-origin: 12px 9px; + } +} + @if user.agent gecko1_8 { .mgwt-PullToRefresh-arrow { -moz-transform-origin: 12px 9px; + -ms-transform-origin: 12px 9px; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/impl/ScrollPanelTouchImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/impl/ScrollPanelTouchImpl.java index 3e2fde207..b9fae5837 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/impl/ScrollPanelTouchImpl.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/impl/ScrollPanelTouchImpl.java @@ -3,6 +3,7 @@ import com.google.gwt.animation.client.AnimationScheduler; import com.google.gwt.animation.client.AnimationScheduler.AnimationCallback; import com.google.gwt.animation.client.AnimationScheduler.AnimationHandle; +import com.google.gwt.core.client.Duration; import com.google.gwt.core.client.JsArray; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; @@ -23,16 +24,12 @@ import com.google.gwt.event.dom.client.TouchEvent; import com.google.gwt.event.dom.client.TouchMoveEvent; import com.google.gwt.event.dom.client.TouchStartEvent; -import com.google.gwt.event.logical.shared.ResizeEvent; -import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.IsWidget; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; - import com.googlecode.mgwt.collection.shared.CollectionFactory; import com.googlecode.mgwt.collection.shared.LightArray; import com.googlecode.mgwt.collection.shared.LightArrayInt; @@ -42,6 +39,7 @@ import com.googlecode.mgwt.dom.client.event.orientation.OrientationChangeHandler; import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; import com.googlecode.mgwt.ui.client.MGWT; +import com.googlecode.mgwt.ui.client.TouchSupport; import com.googlecode.mgwt.ui.client.util.CssUtil; import com.googlecode.mgwt.ui.client.widget.panel.scroll.BeforeScrollEndEvent; import com.googlecode.mgwt.ui.client.widget.panel.scroll.BeforeScrollMoveEvent; @@ -250,7 +248,7 @@ public int getTime() { private int startY; private int pointX; private int pointY; - private long startTime; + private double startTime; private double touchesDist; private double lastScale; private boolean bounce; @@ -334,7 +332,7 @@ public ScrollPanelTouchImpl() { this.fixedScrollbar = MGWT.getOsDetection().isAndroid() && !MGWT.getOsDetection().isAndroid4_4_OrHigher(); this.hideScrollBar = true; - this.fadeScrollBar = MGWT.getOsDetection().isIOs() && CssUtil.has3d(); + this.fadeScrollBar = (MGWT.getOsDetection().isIOs() || MGWT.getOsDetection().isWindowsPhone()) && CssUtil.has3d(); // array for scrollbars this.scrollBar = new boolean[2]; @@ -673,7 +671,7 @@ private void move(TouchMoveEvent event) { int deltaY = touches.get(0).getPageY() - this.pointY; int newX = this.x + deltaX; int newY = this.y + deltaY; - long timeStamp = System.currentTimeMillis(); + double timeStamp = Duration.currentTimeMillis(); // fire onbeforescroll event fireEvent(new BeforeScrollMoveEvent(event)); @@ -774,7 +772,7 @@ private void end(final TouchEvent event) { return; } - long duration = System.currentTimeMillis() - this.startTime; + double duration = Duration.currentTimeMillis() - this.startTime; int newPosX = this.x; int newPosY = this.y; Momentum momentumX = Momentum.ZERO_MOMENTUM; @@ -1081,7 +1079,7 @@ private void startAnimation(final boolean issueEvent) { return; } - final long startTime = System.currentTimeMillis(); + final double startTime = Duration.currentTimeMillis(); final AnimationCallback animationCallback = new AnimationCallback() { @@ -1128,7 +1126,7 @@ private void setTransistionTime(int time) { } - private Momentum momentum(int dist, long time, int maxDistUpper, int maxDistLower, int size) { + private Momentum momentum(int dist, double time, int maxDistUpper, int maxDistLower, int size) { double deceleration = 0.0006; double speed = ((double) (Math.abs(dist))) / time; double newDist = (speed * speed) / (2 * deceleration); @@ -1596,7 +1594,7 @@ public void setWidget(Widget w) { // clear old event handlers unbindStartEvent(); unbindResizeEvent(); - if (MGWT.getOsDetection().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { unbindMouseoutEvent(); unbindMouseWheelEvent(); } @@ -1616,7 +1614,7 @@ public void setWidget(Widget w) { if (isAttached()) { bindResizeEvent(); bindStartEvent(); - if (MGWT.getOsDetection().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { bindMouseoutEvent(); bindMouseWheelEvent(); } @@ -1650,7 +1648,7 @@ protected void onAttach() { // bind events bindResizeEvent(); bindStartEvent(); - if (MGWT.getOsDetection().isDesktop()) { + if (TouchSupport.isTouchEventsEmulatedUsingMouseEvents()) { bindMouseoutEvent(); bindMouseWheelEvent(); } @@ -1775,30 +1773,16 @@ private void unbindMoveEvent() { * */ private void bindResizeEvent() { - if (!MGWT.getFormFactor().isDesktop()) { - orientationChangeRegistration = MGWT.addOrientationChangeHandler(new OrientationChangeHandler() { - - @Override - public void onOrientationChanged(OrientationChangeEvent event) { - if (shouldHandleResize) { - resize(); - } - - } - }); - } else { - orientationChangeRegistration = Window.addResizeHandler(new ResizeHandler() { - - @Override - public void onResize(ResizeEvent event) { - if (shouldHandleResize) { - resize(); - } + orientationChangeRegistration = MGWT.addOrientationChangeHandler(new OrientationChangeHandler() { + @Override + public void onOrientationChanged(OrientationChangeEvent event) { + if (shouldHandleResize) { + resize(); } - }); - } - + } + + }); } private void unbindResizeEvent() { diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/scrollpanel.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/scrollpanel.css index 21e49a97f..f79996245 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/scrollpanel.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/panel/scroll/scrollpanel.css @@ -21,10 +21,19 @@ } } +@if user.agent ie10 { + .mgwt-ScrollPanel-container { + transition-property: transform; + transition-timing-function: cubic-bezier(0, 0, 0.25, 1); + } +} + @if user.agent gecko1_8 { .mgwt-ScrollPanel-container { -moz-transition-property: literal('-moz-transform'); -moz-transition-timing-function: literal('cubic-bezier(0, 0, 0.25, 1)'); + -ms-transition-property: literal('-ms-transform'); + -ms-transition-timing-function: literal('cubic-bezier(0, 0, 0.25, 1)'); vertical-align: top; } } @@ -44,11 +53,22 @@ } } +@if user.agent ie10 { + .mgwt-Scrollbar { + transition-duration: 300ms; + transition-delay: 0ms; + transition-property: opacity; + } +} + @if user.agent gecko1_8 { .mgwt-Scrollbar { -moz-transition-duration: 300ms; -moz-transition-delay: 0ms; -moz-transition-property: opacity; + -ms-transition-duration: 300ms; + -ms-transition-delay: 0ms; + -ms-transition-property: opacity; } } @@ -86,6 +106,18 @@ } } +@if user.agent ie10 { + .mgwt-Scrollbar-Bar { + background-clip:padding-box; + box-sizing:border-box; + border-radius:3px; + transition-property:transform; + transition-timing-function:cubic-bezier(0.33,0.66,0.66,1); + transform: translate3d('0,0, 0'); + transition-duration:0; + } +} + @if user.agent gecko1_8 { .mgwt-Scrollbar-Bar { -moz-background-clip:padding-box; @@ -94,5 +126,11 @@ -moz-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1); -moz-transform: translate('0,0'); -moz-transition-duration:0; + -ms-background-clip:padding-box; + -ms-box-sizing:border-box; + -ms-transition-property:literal('-webkit-transform'); + -ms-transition-timing-function:cubic-bezier(0.33,0.66,0.66,1); + -ms-transform: translate('0,0'); + -ms-transition-duration:0; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressbar.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressbar.css index 8eab117bd..5ef426bb1 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressbar.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressbar.css @@ -28,12 +28,31 @@ } } +@if user.agent ie10 { + .mgwt-ProgressBar { + animation-duration: 9s; + animation-name: anmiateProgressBar; + animation-iteration-count: infinite; + animation-timing-function: linear; + } + + @keyframes anmiateProgressBar { + 0% { background-position-x: 0%; } + 100% { background-position-x: 100%; } + } +} + @if user.agent gecko1_8 { .mgwt-ProgressBar { -moz-animation-duration: 9s; -moz-animation-name: anmiateProgressBar; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; + + animation-duration: 9s; + animation-name: anmiateProgressBar; + animation-iteration-count: infinite; + animation-timing-function: linear; } @-moz-keyframes anmiateProgressBar { @@ -57,6 +76,15 @@ } } +@if user.agent ie10 { + .mgwt-ProgressBar { + background-size: 25px 15px; + box-shadow: 0 3px 3px rgba(0, 0, 0, 0.5); + box-sizing: border-box; + background-image: linear-gradient(60deg, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0.7) 30%, rgba(255, 255, 255, 1) 30%, rgba(255, 255, 255, 1) 70%, rgba(255, 255, 255, 0.7) 70%, rgba(255, 255, 255, 0) 80%), linear-gradient(to bottom, rgba(0, 0, 0, .2) 5%, rgba(255, 255, 255, .8) 6%, rgba(255, 255, 255, .05) 40%, rgba(0, 0, 0, .05) 60%, rgba(0, 0, 0, .2) 90%, rgba(0, 0, 0, .5) 98%), linear-gradient(to bottom, transparent 20%, rgba(255, 255, 255, .5) 20%, rgba(255, 255, 255, .5) 50%, transparent 50%); + } +} + @if user.agent gecko1_8 { .mgwt-ProgressBar { background-size: 25px 15px; @@ -66,7 +94,7 @@ } } -@if user.agent ie9 ie10 { +@if user.agent ie9 { .mgwt-ProgressBar { -ms-background-size: 25px 15px; -ms-box-shadow: 0 3px 3px rgba(0, 0, 0, 0.5); diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressindicator.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressindicator.css index 4848ee5f5..70672fdc4 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressindicator.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressindicator.css @@ -21,6 +21,7 @@ -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -webkit-animation-name: progressIndicatorAnimation; + -webkit-transform: scale(0.25); } .mgwt-ProgressIndicator > span:nth-child\(2\) { @@ -48,19 +49,61 @@ } } +@if user.agent ie10 { + .mgwt-ProgressIndicator > span { + animation-duration: 1s; + animation-iteration-count: infinite; + animation-timing-function: linear; + animation-name: progressIndicatorAnimation; + transform: scale(0.25); + } + + .mgwt-ProgressIndicator > span:nth-child\(2\) { + animation-delay: 0.33s; + } + .mgwt-ProgressIndicator > span:nth-child\(3\) { + animation-delay: 0.66s; + } + + @keyframes progressIndicatorAnimation { + 0% { + transform: scale(0.25); + background-color: #1e7dc8; + } + 16% { + transform: scale(1.0); + background-color: #1e7dc8; + } + 33% { + transform: scale(0.25); + } + 100% { + transform: scale(0.25); + } + } +} + @if user.agent gecko1_8 { .mgwt-ProgressIndicator > span { -moz-animation-duration: 1s; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; -moz-animation-name: progressIndicatorAnimation; + -moz-transform: scale(0.25); + + -ms-animation-duration: 1s; + -ms-animation-iteration-count: infinite; + -ms-animation-timing-function: linear; + -ms-animation-name: progressIndicatorAnimation; } .mgwt-ProgressIndicator > span:nth-child\(2\) { -moz-animation-delay: 0.33s; + -ms-animation-delay: 0.33s; } .mgwt-ProgressIndicator > span:nth-child\(3\) { -moz-animation-delay: 0.66s; + -ms-animation-delay: 0.66s; } @-moz-keyframes progressIndicatorAnimation { @@ -79,4 +122,21 @@ -moz-transform: scale(0.25); } } + + @-ms-keyframes progressIndicatorAnimation { + 0% { + -ms-transform: scale(0.25); + background-color: #1e7dc8; + } + 16% { + -ms-transform: scale(1.0); + background-color: #1e7dc8; + } + 33% { + -ms-transform: scale(0.25); + } + 100% { + -ms-transform: scale(0.25); + } + } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressspinner.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressspinner.css index 7e3865f52..315c8d09c 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressspinner.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/progress/progressspinner.css @@ -22,50 +22,74 @@ .mgwt-ProgressSpinner > span:nth-child\(1\) { -webkit-transform: translate3d(0, -10px, 0); + -moz-transform: translate3d(0, -10px, 0); + -ms-transform: translate3d(0, -10px, 0); } .mgwt-ProgressSpinner > span:nth-child\(2\) { -webkit-transform: translate3d(5px, -8.66px, 0) rotate(30deg); + -moz-transform: translate3d(5px, -8.66px, 0) rotate(30deg); + -ms-transform: translate3d(5px, -8.66px, 0) rotate(30deg); } .mgwt-ProgressSpinner > span:nth-child\(3\) { -webkit-transform: translate3d(8.66px, -5px, 0) rotate(60deg); + -moz-transform: translate3d(8.66px, -5px, 0) rotate(60deg); + -ms-transform: translate3d(8.66px, -5px, 0) rotate(60deg); } .mgwt-ProgressSpinner > span:nth-child\(4\) { -webkit-transform: translate3d(10px, 0, 0) rotate(90deg); + -moz-transform: translate3d(10px, 0, 0) rotate(90deg); + -ms-transform: translate3d(10px, 0, 0) rotate(90deg); } .mgwt-ProgressSpinner > span:nth-child\(5\) { -webkit-transform: translate3d(8.66px, 5px, 0) rotate(120deg); + -moz-transform: translate3d(8.66px, 5px, 0) rotate(120deg); + -ms-transform: translate3d(8.66px, 5px, 0) rotate(120deg); } .mgwt-ProgressSpinner > span:nth-child\(6\) { -webkit-transform: translate3d(5px, 8.66px, 0) rotate(150deg); + -moz-transform: translate3d(5px, 8.66px, 0) rotate(150deg); + -ms-transform: translate3d(5px, 8.66px, 0) rotate(150deg); } .mgwt-ProgressSpinner > span:nth-child\(7\) { -webkit-transform: translate3d(0px, 10px, 0); + -moz-transform: translate3d(0px, 10px, 0); + -ms-transform: translate3d(0px, 10px, 0); } .mgwt-ProgressSpinner > span:nth-child\(8\) { -webkit-transform: translate3d(-5px, 8.66px, 0) rotate(210deg); + -moz-transform: translate3d(-5px, 8.66px, 0) rotate(210deg); + -ms-transform: translate3d(-5px, 8.66px, 0) rotate(210deg); } .mgwt-ProgressSpinner > span:nth-child\(9\) { -webkit-transform: translate3d(-8.66px, 5px, 0) rotate(240deg); + -moz-transform: translate3d(-8.66px, 5px, 0) rotate(240deg); + -ms-transform: translate3d(-8.66px, 5px, 0) rotate(240deg); } .mgwt-ProgressSpinner > span:nth-child\(10\) { -webkit-transform: translate3d(-10px, 0, 0) rotate(90deg);; + -moz-transform: translate3d(-10px, 0, 0) rotate(90deg);; + -ms-transform: translate3d(-10px, 0, 0) rotate(90deg);; } .mgwt-ProgressSpinner > span:nth-child\(11\) { -webkit-transform: translate3d(-8.66px, -5px, 0) rotate(300deg); + -moz-transform: translate3d(-8.66px, -5px, 0) rotate(300deg); + -ms-transform: translate3d(-8.66px, -5px, 0) rotate(300deg); } .mgwt-ProgressSpinner > span:nth-child\(12\) { -webkit-transform: translate3d(-5px, -8.66px, 0) rotate(330deg); + -moz-transform: translate3d(-5px, -8.66px, 0) rotate(330deg); + -ms-transform: translate3d(-5px, -8.66px, 0) rotate(330deg); } @@ -74,9 +98,74 @@ -webkit-animation-timing-function: linear; -webkit-animation-duration: ANIMATION_DURATION; -webkit-animation-name: animationProgressSpinner; + + -moz-animation-iteration-count: infinite; + -moz-animation-timing-function: linear; + -moz-animation-duration: ANIMATION_DURATION; + -moz-animation-name: animationProgressSpinner; + + -ms-animation-iteration-count: infinite; + -ms-animation-timing-function: linear; + -ms-animation-duration: ANIMATION_DURATION; + -ms-animation-name: animationProgressSpinner; } @if user.agent safari { + .mgwt-ProgressSpinner > span:nth-child\(1\) { + -webkit-transform: translate3d(0, -10px, 0); + } + + .mgwt-ProgressSpinner > span:nth-child\(2\) { + -webkit-transform: translate3d(5px, -8.66px, 0) rotate(30deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(3\) { + -webkit-transform: translate3d(8.66px, -5px, 0) rotate(60deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(4\) { + -webkit-transform: translate3d(10px, 0, 0) rotate(90deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(5\) { + -webkit-transform: translate3d(8.66px, 5px, 0) rotate(120deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(6\) { + -webkit-transform: translate3d(5px, 8.66px, 0) rotate(150deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(7\) { + -webkit-transform: translate3d(0px, 10px, 0); + } + + .mgwt-ProgressSpinner > span:nth-child\(8\) { + -webkit-transform: translate3d(-5px, 8.66px, 0) rotate(210deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(9\) { + -webkit-transform: translate3d(-8.66px, 5px, 0) rotate(240deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(10\) { + -webkit-transform: translate3d(-10px, 0, 0) rotate(90deg);; + } + + .mgwt-ProgressSpinner > span:nth-child\(11\) { + -webkit-transform: translate3d(-8.66px, -5px, 0) rotate(300deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(12\) { + -webkit-transform: translate3d(-5px, -8.66px, 0) rotate(330deg); + } + + .mgwt-ProgressSpinner > span { + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + -webkit-animation-duration: ANIMATION_DURATION; + -webkit-animation-name: animationProgressSpinner; + } + @-webkit-keyframes animationProgressSpinner { 0% { background: transparent;} 8% { background: #464F5D;} @@ -92,9 +181,7 @@ 92% { background: #DCDCE4;} 100% { background: transparent;} } -} -@if user.agent safari { .mgwt-ProgressSpinner > span:nth-child\(2\) { -webkit-animation-delay: 0.08s; } @@ -129,3 +216,110 @@ -webkit-animation-delay: 0.92s; } } + +@if user.agent ie10 { + .mgwt-ProgressSpinner > span:nth-child\(1\) { + transform: translate3d(0, -10px, 0); + } + + .mgwt-ProgressSpinner > span:nth-child\(2\) { + transform: translate3d(5px, -8.66px, 0) rotate(30deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(3\) { + transform: translate3d(8.66px, -5px, 0) rotate(60deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(4\) { + transform: translate3d(10px, 0, 0) rotate(90deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(5\) { + transform: translate3d(8.66px, 5px, 0) rotate(120deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(6\) { + transform: translate3d(5px, 8.66px, 0) rotate(150deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(7\) { + transform: translate3d(0px, 10px, 0); + } + + .mgwt-ProgressSpinner > span:nth-child\(8\) { + transform: translate3d(-5px, 8.66px, 0) rotate(210deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(9\) { + transform: translate3d(-8.66px, 5px, 0) rotate(240deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(10\) { + transform: translate3d(-10px, 0, 0) rotate(90deg);; + } + + .mgwt-ProgressSpinner > span:nth-child\(11\) { + transform: translate3d(-8.66px, -5px, 0) rotate(300deg); + } + + .mgwt-ProgressSpinner > span:nth-child\(12\) { + transform: translate3d(-5px, -8.66px, 0) rotate(330deg); + } + + .mgwt-ProgressSpinner > span { + animation-iteration-count: infinite; + animation-timing-function: linear; + animation-duration: ANIMATION_DURATION; + animation-name: animationProgressSpinner; + } + + @keyframes animationProgressSpinner { + 0% { background: transparent;} + 8% { background: #464F5D;} + 17% { background: #59606C;} + 25% { background: #656C78;} + 33% { background: #747B85;} + 41% { background: #828791;} + 50% { background: #8D929B;} + 58% { background: #A0A4AD;} + 67% { background: #ADB0BA;} + 75% { background: #BCBEC7;} + 83% { background: #CDCED5;} + 92% { background: #DCDCE4;} + 100% { background: transparent;} + } + + .mgwt-ProgressSpinner > span:nth-child\(2\) { + animation-delay: 0.08s; + } + .mgwt-ProgressSpinner > span:nth-child\(3\) { + animation-delay: 0.17s; + } + .mgwt-ProgressSpinner > span:nth-child\(4\) { + animation-delay: 0.25s; + } + .mgwt-ProgressSpinner > span:nth-child\(5\) { + animation-delay: 0.33s; + } + .mgwt-ProgressSpinner > span:nth-child\(6\) { + animation-delay: 0.41s; + } + .mgwt-ProgressSpinner > span:nth-child\(7\) { + animation-delay: 0.5s; + } + .mgwt-ProgressSpinner > span:nth-child\(8\) { + animation-delay: 0.58s; + } + .mgwt-ProgressSpinner > span:nth-child\(9\) { + animation-delay: 0.67s; + } + .mgwt-ProgressSpinner > span:nth-child\(10\) { + animation-delay: 0.75s; + } + .mgwt-ProgressSpinner > span:nth-child\(11\) { + animation-delay: 0.83s; + } + .mgwt-ProgressSpinner > span:nth-child\(12\) { + animation-delay: 0.92s; + } +} \ No newline at end of file diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar-button.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar-button.css index a0a5475c1..29ae02215 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar-button.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar-button.css @@ -12,22 +12,37 @@ @if user.agent safari { .mgwt-TabBar-Button { + display: -webkit-box; /* iOS < 7 && Android < 4.4*/ + display: -webkit-flex; + -webkit-box-orient: vertical; /* iOS < 7 && Android < 4.4*/ + -webkit-flex-direction: column; + -webkit-box-flex: 1; /* iOS < 7 && Android < 4.4*/ + -webkit-flex: 1; -webkit-appearance: none; - -webkit-box-flex: 1; + } +} + +@if user.agent ie10 { + .mgwt-TabBar-Button { + display: -ms-flexbox; + -ms-flex-direction: column; + -ms-flex: 1 1; } } @if user.agent gecko1_8 { .mgwt-TabBar-Button { - -moz-appearance: none; + display: -moz-box; + -moz-flex-direction: column; -moz-box-flex: 1; + -moz-appearance: none; } } .mgwt-TabBar-Button { display: flex; - flex: 1; flex-direction: column; + flex: 1; min-width: 60px; background-color: transparent; height: 39px; diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar.css b/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar.css index ad760ced3..887f45e56 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar.css +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/tabbar/tabbar.css @@ -5,14 +5,25 @@ @if user.agent safari { .mgwt-TabPanel { display: -webkit-box; + display: -webkit-flex; -webkit-box-flex: 1; + -webkit-flex: 1; -webkit-box-orient: vertical; + -webkit-flex-direction: column; + } +} + +@if user.agent ie10 { + .mgwt-TabPanel { + display: -ms-flexbox; + -ms-flex: 1 1; + -ms-flex-direction: column; } } @if user.agent gecko1_8 { .mgwt-TabPanel { - display: -webkit-box; + display: -moz-box; -moz-box-flex: 1; -moz-box-orient: vertical; } @@ -21,20 +32,31 @@ .mgwt-TabPanel { display: flex; flex: 1; - flex-flow: column; + flex-direction: column; } @if user.agent safari { .mgwt-TabPanel-container { display: -webkit-box; + display: -webkit-flex; -webkit-box-flex: 1; + -webkit-flex: 1; -webkit-box-orient: vertical; + -webkit-flex-direction: column; + } +} + +@if user.agent ie10 { + .mgwt-TabPanel-container { + display: -ms-flexbox; + -ms-flex: 1 1; + -ms-flex-direction: column; } } @if user.agent gecko1_8 { .mgwt-TabPanel-container { - display: -webkit-box; + display: -moz-box; -moz-box-flex: 1; -moz-box-orient: vertical; } @@ -44,17 +66,29 @@ overflow: hidden; display: flex; flex:1; + flex-direction: column; } @if user.agent safari { .mgwt-TabBar { display: -webkit-box; + display: -webkit-flex; -webkit-box-orient: horizontal; + -webkit-flex-direction: row; + } +} + +@if user.agent ie10 { + .mgwt-TabBar { + display: -ms-flexbox; + -ms-flex-direction: row; } } + @if user.agent gecko1_8 { .mgwt-TabBar { display: -moz-box; + display: -ms-flexbox; -moz-box-orient: horizontal; } } diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java index dcf1b9236..8d9523f61 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java @@ -23,8 +23,6 @@ import com.google.gwt.event.dom.client.TouchStartHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.FlowPanel; - -import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; import com.googlecode.mgwt.dom.client.event.tap.HasTapHandlers; import com.googlecode.mgwt.dom.client.event.tap.TapEvent; import com.googlecode.mgwt.dom.client.event.tap.TapHandler; @@ -83,13 +81,7 @@ public HandlerRegistration addTouchEndHandler(TouchEndHandler handler) { @Override public HandlerRegistration addTouchHandler(TouchHandler handler) { - HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); - - handlerRegistrationCollection.addHandlerRegistration(addTouchCancelHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchStartHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchEndHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchMoveHandler(handler)); - return handlerRegistrationCollection; + return impl.addTouchHandler(this, handler); } @Override diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidget.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidget.java index 14f576ecf..5f3cf4a02 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidget.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidget.java @@ -22,8 +22,6 @@ import com.google.gwt.event.dom.client.TouchStartHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.Widget; - -import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; import com.googlecode.mgwt.dom.client.event.tap.HasTapHandlers; import com.googlecode.mgwt.dom.client.event.tap.TapEvent; import com.googlecode.mgwt.dom.client.event.tap.TapHandler; @@ -83,13 +81,14 @@ public HandlerRegistration addTouchEndHandler(TouchEndHandler handler) { @Override public HandlerRegistration addTouchHandler(TouchHandler handler) { - HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); - - handlerRegistrationCollection.addHandlerRegistration(addTouchCancelHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchStartHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchEndHandler(handler)); - handlerRegistrationCollection.addHandlerRegistration(addTouchMoveHandler(handler)); - return handlerRegistrationCollection; + return impl.addTouchHandler(this, handler); +// HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); +// +// handlerRegistrationCollection.addHandlerRegistration(addTouchCancelHandler(handler)); +// handlerRegistrationCollection.addHandlerRegistration(addTouchStartHandler(handler)); +// handlerRegistrationCollection.addHandlerRegistration(addTouchEndHandler(handler)); +// handlerRegistrationCollection.addHandlerRegistration(addTouchMoveHandler(handler)); +// return handlerRegistrationCollection; } @Override diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetImpl.java index feb8b2ff4..0eabd2476 100644 --- a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetImpl.java +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetImpl.java @@ -15,26 +15,13 @@ */ package com.googlecode.mgwt.ui.client.widget.touch; -import com.google.gwt.event.dom.client.MouseDownEvent; -import com.google.gwt.event.dom.client.MouseMoveEvent; -import com.google.gwt.event.dom.client.MouseUpEvent; -import com.google.gwt.event.dom.client.TouchCancelEvent; import com.google.gwt.event.dom.client.TouchCancelHandler; -import com.google.gwt.event.dom.client.TouchEndEvent; import com.google.gwt.event.dom.client.TouchEndHandler; -import com.google.gwt.event.dom.client.TouchMoveEvent; import com.google.gwt.event.dom.client.TouchMoveHandler; -import com.google.gwt.event.dom.client.TouchStartEvent; import com.google.gwt.event.dom.client.TouchStartHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.Widget; - -import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; -import com.googlecode.mgwt.dom.client.event.mouse.TouchEndToMouseUpHandler; -import com.googlecode.mgwt.dom.client.event.mouse.TouchMoveToMouseMoveHandler; -import com.googlecode.mgwt.dom.client.event.mouse.TouchStartToMouseDownHandler; import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; -import com.googlecode.mgwt.ui.client.util.NoopHandlerRegistration; /** * The touch widget interface is used to abstract implementation details for @@ -42,109 +29,7 @@ * * @author Daniel Kurka */ -public abstract class TouchWidgetImpl { - - private static class TouchWidgetMobileImpl extends TouchWidgetImpl { - - @Override - public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) { - return w.addDomHandler(handler, TouchStartEvent.getType()); - } - - @Override - public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) { - return w.addDomHandler(handler, TouchMoveEvent.getType()); - } - - @Override - public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) { - return w.addDomHandler(handler, TouchCancelEvent.getType()); - } - - @Override - public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) { - return w.addDomHandler(handler, TouchEndEvent.getType()); - } - - @Override - public HandlerRegistration addTouchHandler(Widget w, TouchHandler handler) { - HandlerRegistrationCollection hrc = new HandlerRegistrationCollection(); - hrc.addHandlerRegistration(addTouchStartHandler(w, handler)); - hrc.addHandlerRegistration(addTouchMoveHandler(w, handler)); - hrc.addHandlerRegistration(addTouchEndHandler(w, handler)); - hrc.addHandlerRegistration(addTouchCancelHandler(w, handler)); - return hrc; - } - } - - // Used with deffered binding - @SuppressWarnings("unused") - private static class TouchWidgetRuntimeImpl extends TouchWidgetImpl { - private static boolean hasTouchSupport; - private static TouchWidgetImpl delegate; - - static { - hasTouchSupport = hasTouch(); - if (hasTouchSupport) { - delegate = new TouchWidgetMobileImpl(); - } - } - - private static native boolean hasTouch() /*-{ - return 'ontouchstart' in $doc.documentElement; - }-*/; - - - @Override - public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) { - if (hasTouchSupport) { - return delegate.addTouchStartHandler(w, handler); - } - return w.addDomHandler(new TouchStartToMouseDownHandler(handler), MouseDownEvent.getType()); - } - - @Override - public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) { - if (hasTouchSupport) { - return delegate.addTouchMoveHandler(w, handler); - } - TouchMoveToMouseMoveHandler touchMoveToMouseMoveHandler = new TouchMoveToMouseMoveHandler(handler); - HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); - handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseDownEvent.getType())); - handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseUpEvent.getType())); - handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseMoveEvent.getType())); - return handlerRegistrationCollection; - } - - @Override - public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) { - if (hasTouchSupport) { - return delegate.addTouchCancelHandler(w, handler); - } - return new NoopHandlerRegistration(); - } - - @Override - public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) { - if (hasTouchSupport) { - return delegate.addTouchEndHandler(w, handler); - } - return w.addDomHandler(new TouchEndToMouseUpHandler(handler), MouseUpEvent.getType()); - } - - @Override - public HandlerRegistration addTouchHandler(Widget w, TouchHandler handler) { - if (hasTouchSupport) { - return delegate.addTouchHandler(w, handler); - } - HandlerRegistrationCollection hrc = new HandlerRegistrationCollection(); - hrc.addHandlerRegistration(addTouchStartHandler(w, handler)); - hrc.addHandlerRegistration(addTouchMoveHandler(w, handler)); - hrc.addHandlerRegistration(addTouchEndHandler(w, handler)); - hrc.addHandlerRegistration(addTouchCancelHandler(w, handler)); - return hrc; - } - } +public interface TouchWidgetImpl { /** * Add a touch start handler to a widget diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetPointerImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetPointerImpl.java new file mode 100644 index 000000000..2f5ecb767 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetPointerImpl.java @@ -0,0 +1,57 @@ +package com.googlecode.mgwt.ui.client.widget.touch; + +import com.google.gwt.event.dom.client.TouchCancelHandler; +import com.google.gwt.event.dom.client.TouchEndHandler; +import com.google.gwt.event.dom.client.TouchMoveHandler; +import com.google.gwt.event.dom.client.TouchStartHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.ui.Widget; +import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; +import com.googlecode.mgwt.dom.client.event.pointer.MsPointerCancelEvent; +import com.googlecode.mgwt.dom.client.event.pointer.MsPointerDownEvent; +import com.googlecode.mgwt.dom.client.event.pointer.MsPointerMoveEvent; +import com.googlecode.mgwt.dom.client.event.pointer.MsPointerUpEvent; +import com.googlecode.mgwt.dom.client.event.pointer.TouchCancelToMsPointerCancelHandler; +import com.googlecode.mgwt.dom.client.event.pointer.TouchEndToMsPointerUpHandler; +import com.googlecode.mgwt.dom.client.event.pointer.TouchMoveToMsPointerMoveHandler; +import com.googlecode.mgwt.dom.client.event.pointer.TouchStartToMsPointerDownHandler; +import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; + +public class TouchWidgetPointerImpl implements TouchWidgetImpl +{ + @Override + public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) { + return w.addBitlessDomHandler(new TouchStartToMsPointerDownHandler(handler), MsPointerDownEvent.getType()); + } + + @Override + public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) { + TouchMoveToMsPointerMoveHandler touchMoveToMsPointerMoveHandler = new TouchMoveToMsPointerMoveHandler(handler); + HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); + handlerRegistrationCollection.addHandlerRegistration(w.addBitlessDomHandler(touchMoveToMsPointerMoveHandler, MsPointerDownEvent.getType())); + handlerRegistrationCollection.addHandlerRegistration(w.addBitlessDomHandler(touchMoveToMsPointerMoveHandler, MsPointerUpEvent.getType())); + handlerRegistrationCollection.addHandlerRegistration(w.addBitlessDomHandler(touchMoveToMsPointerMoveHandler, MsPointerMoveEvent.getType())); + return handlerRegistrationCollection; + } + + @Override + public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) { + return w.addBitlessDomHandler(new TouchCancelToMsPointerCancelHandler(handler), MsPointerCancelEvent.getType()); + } + + @Override + public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) { + return w.addBitlessDomHandler(new TouchEndToMsPointerUpHandler(handler), MsPointerUpEvent.getType()); + } + + @Override + public HandlerRegistration addTouchHandler(Widget w, TouchHandler handler) { + HandlerRegistrationCollection hrc = new HandlerRegistrationCollection(); + hrc.addHandlerRegistration(addTouchStartHandler(w, handler)); + hrc.addHandlerRegistration(addTouchMoveHandler(w, handler)); + hrc.addHandlerRegistration(addTouchEndHandler(w, handler)); + hrc.addHandlerRegistration(addTouchCancelHandler(w, handler)); + return hrc; + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetStandardImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetStandardImpl.java new file mode 100644 index 000000000..0a5988bc1 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetStandardImpl.java @@ -0,0 +1,86 @@ +package com.googlecode.mgwt.ui.client.widget.touch; + +import com.google.gwt.event.dom.client.MouseDownEvent; +import com.google.gwt.event.dom.client.MouseMoveEvent; +import com.google.gwt.event.dom.client.MouseUpEvent; +import com.google.gwt.event.dom.client.TouchCancelHandler; +import com.google.gwt.event.dom.client.TouchEndHandler; +import com.google.gwt.event.dom.client.TouchMoveHandler; +import com.google.gwt.event.dom.client.TouchStartHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.ui.Widget; +import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; +import com.googlecode.mgwt.dom.client.event.mouse.TouchEndToMouseUpHandler; +import com.googlecode.mgwt.dom.client.event.mouse.TouchMoveToMouseMoveHandler; +import com.googlecode.mgwt.dom.client.event.mouse.TouchStartToMouseDownHandler; +import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; +import com.googlecode.mgwt.ui.client.util.NoopHandlerRegistration; + +public class TouchWidgetStandardImpl implements TouchWidgetImpl +{ + private static boolean hasTouchSupport; + private static TouchWidgetImpl delegate; + + static { + hasTouchSupport = hasTouch(); + if (hasTouchSupport) { + delegate = new TouchWidgetTouchImpl(); + } + } + + private static native boolean hasTouch() /*-{ + return 'ontouchstart' in $doc.documentElement; + }-*/; + + + @Override + public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) { + if (hasTouchSupport) { + return delegate.addTouchStartHandler(w, handler); + } + return w.addDomHandler(new TouchStartToMouseDownHandler(handler), MouseDownEvent.getType()); + } + + @Override + public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) { + if (hasTouchSupport) { + return delegate.addTouchMoveHandler(w, handler); + } + TouchMoveToMouseMoveHandler touchMoveToMouseMoveHandler = new TouchMoveToMouseMoveHandler(handler); + HandlerRegistrationCollection handlerRegistrationCollection = new HandlerRegistrationCollection(); + handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseDownEvent.getType())); + handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseUpEvent.getType())); + handlerRegistrationCollection.addHandlerRegistration(w.addDomHandler(touchMoveToMouseMoveHandler, MouseMoveEvent.getType())); + return handlerRegistrationCollection; + } + + @Override + public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) { + if (hasTouchSupport) { + return delegate.addTouchCancelHandler(w, handler); + } + return new NoopHandlerRegistration(); + } + + @Override + public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) { + if (hasTouchSupport) { + return delegate.addTouchEndHandler(w, handler); + } + return w.addDomHandler(new TouchEndToMouseUpHandler(handler), MouseUpEvent.getType()); + } + + @Override + public HandlerRegistration addTouchHandler(Widget w, TouchHandler handler) { + if (hasTouchSupport) { + return delegate.addTouchHandler(w, handler); + } + HandlerRegistrationCollection hrc = new HandlerRegistrationCollection(); + hrc.addHandlerRegistration(addTouchStartHandler(w, handler)); + hrc.addHandlerRegistration(addTouchMoveHandler(w, handler)); + hrc.addHandlerRegistration(addTouchEndHandler(w, handler)); + hrc.addHandlerRegistration(addTouchCancelHandler(w, handler)); + return hrc; + } + +} diff --git a/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetTouchImpl.java b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetTouchImpl.java new file mode 100644 index 000000000..23b10a387 --- /dev/null +++ b/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchWidgetTouchImpl.java @@ -0,0 +1,47 @@ +package com.googlecode.mgwt.ui.client.widget.touch; + +import com.google.gwt.event.dom.client.TouchCancelEvent; +import com.google.gwt.event.dom.client.TouchCancelHandler; +import com.google.gwt.event.dom.client.TouchEndEvent; +import com.google.gwt.event.dom.client.TouchEndHandler; +import com.google.gwt.event.dom.client.TouchMoveEvent; +import com.google.gwt.event.dom.client.TouchMoveHandler; +import com.google.gwt.event.dom.client.TouchStartEvent; +import com.google.gwt.event.dom.client.TouchStartHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.ui.Widget; +import com.googlecode.mgwt.dom.client.event.mouse.HandlerRegistrationCollection; +import com.googlecode.mgwt.dom.client.event.touch.TouchHandler; + +public class TouchWidgetTouchImpl implements TouchWidgetImpl +{ + @Override + public HandlerRegistration addTouchStartHandler(Widget w, TouchStartHandler handler) { + return w.addDomHandler(handler, TouchStartEvent.getType()); + } + + @Override + public HandlerRegistration addTouchMoveHandler(Widget w, TouchMoveHandler handler) { + return w.addDomHandler(handler, TouchMoveEvent.getType()); + } + + @Override + public HandlerRegistration addTouchCancelHandler(Widget w, TouchCancelHandler handler) { + return w.addDomHandler(handler, TouchCancelEvent.getType()); + } + + @Override + public HandlerRegistration addTouchEndHandler(Widget w, TouchEndHandler handler) { + return w.addDomHandler(handler, TouchEndEvent.getType()); + } + + @Override + public HandlerRegistration addTouchHandler(Widget w, TouchHandler handler) { + HandlerRegistrationCollection hrc = new HandlerRegistrationCollection(); + hrc.addHandlerRegistration(addTouchStartHandler(w, handler)); + hrc.addHandlerRegistration(addTouchMoveHandler(w, handler)); + hrc.addHandlerRegistration(addTouchEndHandler(w, handler)); + hrc.addHandlerRegistration(addTouchCancelHandler(w, handler)); + return hrc; + } +} diff --git a/src/main/java/com/googlecode/mgwt/ui/generator/DeviceDensityGenerator.java b/src/main/java/com/googlecode/mgwt/ui/generator/DeviceDensityGenerator.java index d6083d7e1..5d2064059 100644 --- a/src/main/java/com/googlecode/mgwt/ui/generator/DeviceDensityGenerator.java +++ b/src/main/java/com/googlecode/mgwt/ui/generator/DeviceDensityGenerator.java @@ -31,7 +31,7 @@ */ public class DeviceDensityGenerator extends RebindingGenerator { - protected void writeImplementatioon(TreeLogger logger, SelectionProperty property, SourceWriter writer) { + protected void writeImplementation(TreeLogger logger, SelectionProperty property, SourceWriter writer) { writer.println("public boolean isMidDPI() {"); writer.println("return " + property.getCurrentValue().equals("mid") + ";"); writer.println("}"); diff --git a/src/main/java/com/googlecode/mgwt/ui/generator/FormFactorGenerator.java b/src/main/java/com/googlecode/mgwt/ui/generator/FormFactorGenerator.java index fb339bf02..fe2244ed4 100644 --- a/src/main/java/com/googlecode/mgwt/ui/generator/FormFactorGenerator.java +++ b/src/main/java/com/googlecode/mgwt/ui/generator/FormFactorGenerator.java @@ -32,7 +32,7 @@ public class FormFactorGenerator extends RebindingGenerator { @Override - protected void writeImplementatioon(TreeLogger logger, SelectionProperty property, + protected void writeImplementation(TreeLogger logger, SelectionProperty property, SourceWriter writer) { writer.println("public boolean isPhone() {"); writer.println("return " + property.getCurrentValue().equals("phone") + ";"); diff --git a/src/main/java/com/googlecode/mgwt/ui/generator/OsDetectionGenerator.java b/src/main/java/com/googlecode/mgwt/ui/generator/OsDetectionGenerator.java index ea51be5d7..9eacff4b5 100644 --- a/src/main/java/com/googlecode/mgwt/ui/generator/OsDetectionGenerator.java +++ b/src/main/java/com/googlecode/mgwt/ui/generator/OsDetectionGenerator.java @@ -30,7 +30,7 @@ public class OsDetectionGenerator extends RebindingGenerator { @Override - protected void writeImplementatioon(TreeLogger logger, SelectionProperty property, + protected void writeImplementation(TreeLogger logger, SelectionProperty property, SourceWriter writer) { writer.println("public boolean isAndroid() {"); writer.println("return isAndroidTablet() || isAndroidPhone();"); diff --git a/src/main/java/com/googlecode/mgwt/ui/generator/RebindingGenerator.java b/src/main/java/com/googlecode/mgwt/ui/generator/RebindingGenerator.java index 1ba9636d1..6891b54eb 100644 --- a/src/main/java/com/googlecode/mgwt/ui/generator/RebindingGenerator.java +++ b/src/main/java/com/googlecode/mgwt/ui/generator/RebindingGenerator.java @@ -71,13 +71,13 @@ public String generate(TreeLogger logger, GeneratorContext context, String typeN // start writing the implementation SourceWriter writer = writeHolder.composer.createSourceWriter(context, writeHolder.printWriter); - writeImplementatioon(logger, property, writer); + writeImplementation(logger, property, writer); return writeHolder.fullName; } protected abstract String getSelectionPropertyName(); - protected abstract void writeImplementatioon(TreeLogger logger, SelectionProperty property, SourceWriter writer); + protected abstract void writeImplementation(TreeLogger logger, SelectionProperty property, SourceWriter writer); private JClassType getClassType(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { diff --git a/src/test/java/com/googlecode/mgwt/image/client/ImageConverterGwtTestCase.java b/src/test/java/com/googlecode/mgwt/image/client/ImageConverterGwtTestCase.java index 2c7759636..66f2f7819 100644 --- a/src/test/java/com/googlecode/mgwt/image/client/ImageConverterGwtTestCase.java +++ b/src/test/java/com/googlecode/mgwt/image/client/ImageConverterGwtTestCase.java @@ -40,9 +40,29 @@ public String getModuleName() { @DoNotRunWith(Platform.HtmlUnitUnknown) public void testConvert_withKnownImage() { ImageConverter imageConverter = new ImageConverter(); - ImageResource convertedResource = imageConverter.convert( - ImageConverterTestBundle.INSTANCE.knownImage(), "#0000F1"); + ImageResource convertedResource = null; + + ImageConverterCallback callback = new ImageConverterCallback() + { + public ImageResource convertedResource = null; + + @Override + public void onFailure(Throwable caught) + { + } + @Override + public void onSuccess(ImageResource convertedResource) + { + this.convertedResource = convertedResource; + } + + }; + + imageConverter.convert(ImageConverterTestBundle.INSTANCE.knownImage(), "#0000F1", callback); + + delayTestFinish(200); + /* * Dirty hack to test, should be improved. */ diff --git a/src/test/java/com/googlecode/mgwt/ui/client/widget/input/search/MSearchBoxGwtTest.java b/src/test/java/com/googlecode/mgwt/ui/client/widget/input/search/MSearchBoxGwtTest.java index 68f8cd1a6..8fd0e3fe7 100644 --- a/src/test/java/com/googlecode/mgwt/ui/client/widget/input/search/MSearchBoxGwtTest.java +++ b/src/test/java/com/googlecode/mgwt/ui/client/widget/input/search/MSearchBoxGwtTest.java @@ -93,7 +93,7 @@ public void execute() { assertEquals(4, valueChangeEventCount); assertEquals(0, clearCount); - mSearchBox.clearButton.fireEvent(new TapEvent(this, null, 0, 0)); + mSearchBox.clearButton.fireEvent(new TapEvent(this, null, null)); assertEquals("", mSearchBox.getValue()); assertEquals(2, submitCount);