Merge branch 'master' into translation

This commit is contained in:
Axel Uhl committed 2017-10-25 23:51:10 +02:00
commit 5d0befd2b1
40 files changed
+62 -1501

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: gwt-dev
Bundle-SymbolicName: com.google.gwt.dev
Bundle-Version: 2.8.1
Bundle-Version: 2.8.2
Bundle-Vendor: GOOGLE
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: lib/gwt-dev.jar,
Binary file not shown.
+1 -1
View File
@@ -8,6 +8,6 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.google.gwt.dev</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Dev
Bundle-SymbolicName: com.google.gwt.servlet
Bundle-Version: 2.8.1
Bundle-Version: 2.8.2
Bundle-Vendor: GOOGLE
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: lib/gwt-servlet.jar,
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -8,6 +8,6 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.google.gwt.servlet</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: gwt-user
Bundle-SymbolicName: com.google.gwt.user
Bundle-Version: 2.8.1
Bundle-Version: 2.8.2
Bundle-Vendor: GOOGLE
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: lib/gwt-user.jar,
@@ -187,4 +187,4 @@ Export-Package: com.google.gwt.activity.shared,
jsinterop.annotations
Require-Bundle: javax.servlet;bundle-version="3.1.0",
org.junit;bundle-version="4.8.2";resolution:=optional,
com.google.gwt.dev;bundle-version="2.8.1"
com.google.gwt.dev;bundle-version="2.8.2"
Binary file not shown.
+1 -1
View File
@@ -8,6 +8,6 @@
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.google.gwt.user</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -8,9 +8,9 @@ Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.sap.sailing.domain,
com.sap.sailing.server,
com.google.gwt.dev;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
com.google.gwt.dev;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sse.common,
com.sap.sailing.domain.common,
com.sap.sailing.domain.shared.android,
@@ -6,12 +6,20 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.sap.sailing.domain.common.tracking.DoubleVectorFix;
/**
* Metadata that defines the column structure of BravoExtended fixes when imported as {@link com.sap.sailing.domain.common.tracking.DoubleVectorFix}.
* Metadata that defines the column structure of BravoExtended fixes when imported as
* {@link com.sap.sailing.domain.common.tracking.DoubleVectorFix}.
* <p>
*
* The current implementation only stores a subset of the information available during the import.
* <p>
*
* The first columns need to be consistent with {@link BravoSensorDataMetadata}.
* The first columns need to be consistent with {@link BravoSensorDataMetadata}. Furthermore,
* once data has been stored in a sensor store, the order of literals must remain constant,
* and no literals must be deleted anymore because the ordinal is used to determine the index
* into the {@link DoubleVectorFix}.
*/
public enum BravoExtendedSensorDataMetadata implements ColumnMetadata {
RIDE_HEIGHT_PORT_HULL("RideHeightPort"), //
@@ -7,7 +7,9 @@ import java.util.Map;
import java.util.Objects;
/**
* Metadata that defines the column structure of Bravo fixes when imported as {@link com.sap.sailing.domain.common.tracking.DoubleVectorFix}.
* Metadata that defines the column structure of Bravo fixes when imported as
* {@link com.sap.sailing.domain.common.tracking.DoubleVectorFix}.
* <p>
*
* The current implementation only stores a subset of the information available during the import.
*/
@@ -5,7 +5,9 @@ import com.sap.sailing.domain.common.tracking.SensorFix;
/**
* Definition of column metadata used by {@link SensorFix} implementations to resolve columns in underlying
* {@link DoubleVectorFix DoubleVectorFixes}.
* {@link DoubleVectorFix DoubleVectorFixes}. Once data has been stored in a sensor store according to such a
* specification, the order of literals in implementing {@code enum} types must remain constant, and no literals must be
* deleted anymore because the ordinal is used to determine the index into the {@link DoubleVectorFix}.
*/
public interface ColumnMetadata {
int getColumnIndex();
@@ -16,7 +16,8 @@ import com.sap.sailing.domain.common.tracking.DoubleVectorFix;
* The first columns need to be consistent with {@link BravoSensorDataMetadata}.
*/
public enum ExpeditionExtendedSensorDataMetadata {
HEEL("Heel", BravoExtendedSensorDataMetadata.HEEL);
HEEL("Heel", BravoExtendedSensorDataMetadata.HEEL),
TRIM("TRIM", BravoExtendedSensorDataMetadata.PITCH);
private String columnName;
@@ -46,7 +46,4 @@ public interface BravoFix extends SensorFix {
@Statistic(messageKey = "heel", resultDecimals = 1)
Bearing getHeel();
}
@@ -15,7 +15,7 @@ Require-Bundle: com.sap.sailing.server,
com.sap.sailing.domain.racelogtrackingadapter.testsupport,
com.rabbitmq.client;bundle-version="2.8.4",
com.sap.sse.filestorage,
com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
org.moxieapps.gwt.highcharts;bundle-version="1.5.0"
Bundle-ClassPath: .
Import-Package: com.sap.sailing.domain.racelogtracking.impl,
@@ -24,8 +24,8 @@ Require-Bundle: com.sap.sailing.domain,
com.sap.sailing.freg.resultimport,
com.sap.sailing.domain.swisstimingreplayadapter,
com.sap.sailing.simulator,
com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sailing.domain.igtimiadapter,
com.sap.sailing.xrr.resultimport,
com.sap.sailing.datamining.shared,
@@ -127,7 +127,7 @@ public class WindStreamletsCanvasOverlay extends FullCanvasOverlay implements Ti
macroWeather = false;
SimulatorJSBundle bundle = GWT.create(SimulatorJSBundle.class);
String jsonStr = bundle.windStreamletsDataJS().getText();
RectField f = RectField.read(jsonStr.substring(19, jsonStr.length() - 1), false, streamletPars, coordinateSystem);
RectField f = RectField.read(jsonStr, false, streamletPars, coordinateSystem);
map.setZoom(5);
map.panTo(f.getCenter());
this.swarm = new Swarm(this, map, timer, f, streamletPars);
@@ -64,7 +64,7 @@ public class RectField implements VectorField {
}
public static RectField read(String jsonData, boolean correctForSphere, StreamletParameters parameters, CoordinateSystem coordinateSystem) {
JSONObject data = JSONParser.parseLenient(jsonData).isObject();
JSONObject data = JSONParser.parseStrict(jsonData).isObject();
int w = (int) data.get("gridWidth").isNumber().doubleValue();
int h = (int) data.get("gridHeight").isNumber().doubleValue();
Vector[][] field = new Vector[w][h];
@@ -1,12 +1,12 @@
var swarmDataExt = {
timestamp: "1:55 pm on March 22, 2014",
x0: -130.103438,
y0: 20.191999,
x1: -60.885558,
y1: 52.807669,
gridWidth: 501.0,
gridHeight: 237.0,
field: [
{
"timestamp": "1:55 pm on March 22, 2014",
"x0": -130.103438,
"y0": 20.191999,
"x1": -60.885558,
"y1": 52.807669,
"gridWidth": 501.0,
"gridHeight": 237.0,
"field": [
0,0,
0,0,
0,0,
@@ -118745,4 +118745,4 @@ field: [
0,0,
0,0
]
};
}
@@ -9,8 +9,8 @@ Export-Package: .,
com.sap.sailing.xrr.structureimport.buildstructure;uses:="com.sap.sailing.xrr.resultimport.schema",
com.sapsailing.xrr.structureimport.eventimport
Bundle-ActivationPolicy: lazy
Require-Bundle: com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
Require-Bundle: com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sailing.domain.common;bundle-version="1.0.0",
com.sap.sailing.domain,
com.sap.sailing.xrr.schema;bundle-version="1.0.0",
+1 -1
View File
@@ -253,7 +253,7 @@
id="com.google.gwt.servlet"
download-size="0"
install-size="0"
version="2.8.1"
version="2.8.2"
unpack="false"/>
<plugin
@@ -5,8 +5,8 @@ Bundle-SymbolicName: com.sap.sse.gwt.adminconsole
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
Require-Bundle: com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sse.gwt,
com.sap.sse.security.ui,
com.sap.sse.security,
@@ -8,5 +8,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Fragment-Host: com.sap.sse.gwt
Require-Bundle: com.sap.sse.common;bundle-version="1.0.0",
org.junit;bundle-version="4.8.2",
com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1"
com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2"
+3 -3
View File
@@ -5,9 +5,9 @@ Bundle-SymbolicName: com.sap.sse.gwt
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.dev;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
Require-Bundle: com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.dev;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sse.common,
com.sap.sse.filestorage
Bundle-ActivationPolicy: lazy
@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module>
<inherits name="com.google.gwt.dom.DOM"/>
<define-property values="true,false" name="patchedDOM"/>
<set-property name="patchedDOM" value="true"/>
<replace-with class="com.google.gwt.dom.client.DOMImplWebkitPatched">
<when-type-is class="com.google.gwt.dom.client.DOMImpl"/>
<all>
<when-property-is name="patchedDOM" value="true"/>
<when-property-is name="user.agent" value="safari"/>
</all>
</replace-with>
<replace-with class="com.google.gwt.dom.client.DOMImplIE9Patched">
<when-type-is class="com.google.gwt.dom.client.DOMImpl"/>
<all>
<when-property-is name="patchedDOM" value="true"/>
<any>
<when-property-is name="user.agent" value="ie9"/>
<when-property-is name="user.agent" value="ie10"/>
</any>
</all>
</replace-with>
<replace-with class="com.google.gwt.dom.client.DOMImplIE8Patched">
<when-type-is class="com.google.gwt.dom.client.DOMImpl"/>
<all>
<when-property-is name="patchedDOM" value="true"/>
<when-property-is name="user.agent" value="ie8"/>
</all>
</replace-with>
<replace-with class="com.google.gwt.dom.client.DOMImplMozillaPatched">
<when-type-is class="com.google.gwt.dom.client.DOMImpl"/>
<all>
<when-property-is name="patchedDOM" value="true"/>
<when-property-is name="user.agent" value="gecko1_8"/>
</all>
</replace-with>
</module>
@@ -1,101 +0,0 @@
/*
* Copyright 2009 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.dom.client;
class DOMImplIE8Patched extends DOMImplTridentPatched {
private static boolean isIE8;
private static boolean isIE8Detected;
/**
* Check if the browser is IE8 or IE9.
*
* @return <code>true</code> if the browser is IE8, <code>false</code> if IE9
* or any other browser
*/
static boolean isIE8() {
if (!isIE8Detected) {
isIE8 = isIE8Impl();
isIE8Detected = true;
}
return isIE8;
}
// Stolen and modified from UserAgentPropertyGenerator
private static native boolean isIE8Impl() /*-{
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf("msie") != -1 && $doc.documentMode == 8) {
return true;
}
return false;
}-*/;
@Override
public void cssClearOpacity(Style style) {
if (isIE8()) {
cssClearOpacityImpl(style);
} else {
super.cssClearOpacity(style);
}
}
@Override
public void cssSetOpacity(Style style, double value) {
if (isIE8()) {
cssSetOpacityImpl(style, value);
} else {
super.cssSetOpacity(style, value);
}
}
@Override
public int getAbsoluteLeft(Element elem) {
Document doc = elem.getOwnerDocument();
return getBoundingClientRectLeft(elem) + doc.getScrollLeft();
}
@Override
public int getAbsoluteTop(Element elem) {
Document doc = elem.getOwnerDocument();
return getBoundingClientRectTop(elem) + doc.getScrollTop();
}
@Override
public int getScrollLeft(Element elem) {
if (isRTL(elem)) {
// IE8 returns increasingly *positive* values as you scroll left in RTL.
return -super.getScrollLeft(elem);
}
return super.getScrollLeft(elem);
}
@Override
public void setScrollLeft(Element elem, int left) {
if (isRTL(elem)) {
// IE8 returns increasingly *positive* values as you scroll left in RTL.
left = -left;
}
super.setScrollLeft(elem, left);
}
private native void cssClearOpacityImpl(Style style) /*-{
style.filter = '';
}-*/;
private native void cssSetOpacityImpl(Style style, double value) /*-{
style.filter = 'alpha(opacity=' + (value * 100) + ')';
}-*/;
}
@@ -1,139 +0,0 @@
/*
* Copyright 2011 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.dom.client;
/**
* IE9 based implementation of {@link com.google.gwt.dom.client.DOMImplStandardBase}.
*/
class DOMImplIE9Patched extends DOMImplStandardBasePatched {
@Override
public int getAbsoluteLeft(Element elem) {
double left = getBoundingClientRectLeft(elem) + getDocumentScrollLeftImpl();
if (isRTL(elem)) { // in RTL, account for the scroll bar shift if present
left += getParentOffsetDelta(elem);
}
return toInt32(left);
}
@Override
public int getAbsoluteTop(Element elem) {
return toInt32(getBoundingClientRectTop(elem) + getDocumentScrollTopImpl());
}
/**
* Coerce numeric values a string. In IE, some values can be stored as numeric
* types.
*/
@Override
public native String getNumericStyleProperty(Style style, String name) /*-{
return typeof(style[name]) == "number" ? "" + style[name] : style[name];
}-*/;
@Override
public int getScrollLeft(Document doc) {
return toInt32(getDocumentScrollLeftImpl());
}
@Override
public int getScrollLeft(Element elem) {
int left = toInt32(getScrollLeftImpl(elem));
if (isRTL(elem)) {
left = -left;
}
return left;
}
@Override
public int getScrollTop(Document doc) {
return toInt32(getDocumentScrollTopImpl());
}
@Override
public native int getTabIndex(Element elem) /*-{
return elem.tabIndex < 65535 ? elem.tabIndex : -(elem.tabIndex % 65535) - 1;
}-*/;
@Override
public boolean isOrHasChild(Node parent, Node child) {
// IE9 still behaves like IE8 for this method
return DOMImplTridentPatched.isOrHasChildImpl(parent, child);
}
@Override
public native void selectRemoveOption(SelectElement select, int index) /*-{
try {
// IE9 throws if elem at index is an optgroup
select.remove(index);
} catch(e) {
select.removeChild(select.childNodes[index]);
}
}-*/;
@Override
public void setScrollLeft(Element elem, int left) {
if (isRTL(elem)) {
left = -left;
}
setScrollLeftImpl(elem, left);
}
private native double getBoundingClientRectLeft(Element elem) /*-{
// getBoundingClientRect() throws a JS exception if the elem is not attached
// to the document, so we wrap it in a try/catch block
try {
return elem.getBoundingClientRect().left;
} catch (e) {
// if not attached return 0
return 0;
}
}-*/;
private native double getBoundingClientRectTop(Element elem) /*-{
// getBoundingClientRect() throws a JS exception if the elem is not attached
// to the document, so we wrap it in a try/catch block
try {
return elem.getBoundingClientRect().top;
} catch (e) {
// if not attached return 0
return 0;
}
}-*/;
private native double getDocumentScrollLeftImpl() /*-{
return $wnd.pageXOffset;
}-*/;
private native double getDocumentScrollTopImpl() /*-{
return $wnd.pageYOffset;
}-*/;
private native double getParentOffsetDelta(Element elem) /*-{
var offsetParent = elem.offsetParent;
if (offsetParent) {
return offsetParent.offsetWidth - offsetParent.clientWidth;
}
return 0;
}-*/;
private native double getScrollLeftImpl(Element elem) /*-{
return elem.scrollLeft || 0;
}-*/;
private native void setScrollLeftImpl(Element elem, int left) /*-{
elem.scrollLeft = left;
}-*/;
}
@@ -1,288 +0,0 @@
/*
* Copyright 2008 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.dom.client;
/**
* Mozilla implementation of StandardBrowser.
*/
class DOMImplMozillaPatched extends DOMImplStandardPatched {
private static native int getGeckoVersion() /*-{
var result = /rv:([0-9]+)\.([0-9]+)(\.([0-9]+))?.*?/.exec(navigator.userAgent.toLowerCase());
if (result && result.length >= 3) {
var version = (parseInt(result[1]) * 1000000) + (parseInt(result[2]) * 1000) +
parseInt(result.length >= 5 && !isNaN(result[4]) ? result[4] : 0);
return version;
}
return -1; // not gecko
}-*/;
/**
* Return true if using Gecko 1.9 (Firefox 3) or later.
*
* @return true if using Gecko 1.9 (Firefox 3) or later
*/
private static boolean isGecko19() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion >= 1009000);
}
/**
* Return true if using Gecko 1.9.0 (Firefox 3) or earlier.
*
* @return true if using Gecko 1.9.0 (Firefox 3) or earlier
*/
private static boolean isGecko190OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009000);
}
/**
* Return true if using Gecko 1.9.1 (Firefox 3.5) or earlier.
*
* @return true if using Gecko 1.9.1 (Firefox 3.5) or earlier
*/
private static boolean isGecko191OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009001);
}
/**
* Return true if using Gecko 1.9.2 (Firefox 3.6) or earlier.
*
* @return true if using Gecko 1.9.2 (Firefox 3.6) or earlier
*/
private static boolean isGecko192OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion <= 1009002);
}
/**
* Return true if using Gecko 2.0.0 (Firefox 4.0) or earlier.
*
* @return true if using Gecko 2.0.0 (Firefox 4.0) or earlier
*/
private static boolean isGecko2OrBefore() {
int geckoVersion = getGeckoVersion();
return (geckoVersion != -1) && (geckoVersion < 2000000);
}
@Override
public native void buttonClick(ButtonElement button) /*-{
var doc = button.ownerDocument;
if (doc != null) {
var evt = doc.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, null, 0, 0,
0, 0, 0, false, false, false, false, 0, null);
button.dispatchEvent(evt);
}
}-*/;
@Override
public NativeEvent createKeyCodeEvent(Document doc, String type,
boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
int keyCode) {
return createKeyEventImpl(doc, type, true, true, ctrlKey, altKey, shiftKey,
metaKey, keyCode, 0);
}
@Override
@Deprecated
public NativeEvent createKeyEvent(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int keyCode, int charCode) {
return createKeyEventImpl(doc, type, canBubble, cancelable, ctrlKey,
altKey, shiftKey, metaKey, keyCode, charCode);
}
@Override
public NativeEvent createKeyPressEvent(Document doc, boolean ctrlKey,
boolean altKey, boolean shiftKey, boolean metaKey, int charCode) {
return createKeyEventImpl(doc, "keypress", true, true, ctrlKey, altKey,
shiftKey, metaKey, 0, charCode);
}
@Override
public native int eventGetMouseWheelVelocityY(NativeEvent evt) /*-{
return evt.detail || 0;
}-*/;
@Override
public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{
// Hack around Mozilla bug 497780 (relatedTarget sometimes returns XUL
// elements). Trying to access relatedTarget.nodeName will throw an
// exception if it's a XUL element.
var relatedTarget = evt.relatedTarget;
if (!relatedTarget) {
return null;
}
try {
var nodeName = relatedTarget.nodeName;
return relatedTarget;
} catch (e) {
return null;
}
}-*/;
@Override
public int getAbsoluteLeft(Element elem) {
return getAbsoluteLeftImpl(elem.getOwnerDocument().getViewportElement(),
elem);
}
@Override
public int getAbsoluteTop(Element elem) {
return getAbsoluteTopImpl(elem.getOwnerDocument().getViewportElement(),
elem);
}
@Override
public native int getBodyOffsetLeft(Document doc) /*-{
var style = $wnd.getComputedStyle(doc.documentElement, null);
if (style == null) {
// Works around https://bugzilla.mozilla.org/show_bug.cgi?id=548397
return 0;
}
return parseInt(style.marginLeft, 10) + parseInt(style.borderLeftWidth, 10);
}-*/;
@Override
public native int getBodyOffsetTop(Document doc) /*-{
var style = $wnd.getComputedStyle(doc.documentElement, null);
if (style == null) {
// Works around https://bugzilla.mozilla.org/show_bug.cgi?id=548397
return 0;
}
return parseInt(style.marginTop, 10) + parseInt(style.borderTopWidth, 10);
}-*/;
@Override
public native int getNodeType(Node node) /*-{
try {
return node.nodeType;
} catch (e) {
// Give up on 'Permission denied to get property HTMLDivElement.nodeType'
// '0' is not a valid node type, which is appropriate in this case, since
// the node in question is completely inaccessible.
//
// See https://bugzilla.mozilla.org/show_bug.cgi?id=208427
// and http://code.google.com/p/google-web-toolkit/issues/detail?id=1909
return 0;
}
}-*/;
@Override
public int getScrollLeft(Element elem) {
if (!isGecko19() && isRTL(elem)) {
return super.getScrollLeft(elem)
- (elem.getScrollWidth() - elem.getClientWidth());
}
return super.getScrollLeft(elem);
}
@Override
public native boolean isOrHasChild(Node parent, Node child) /*-{
// For more information about compareDocumentPosition, see:
// http://www.quirksmode.org/blog/archives/2006/01/contains_for_mo.html
return (parent === child) || !!(parent.compareDocumentPosition(child) & 16);
}-*/;
@Override
public void setScrollLeft(Element elem, int left) {
if (!isGecko19() && isRTL(elem)) {
left += elem.getScrollWidth() - elem.getClientWidth();
}
super.setScrollLeft(elem, left);
}
@Override
public native String toString(Element elem) /*-{
// Basic idea is to use the innerHTML property by copying the node into a
// div and getting the innerHTML
var doc = elem.ownerDocument;
var temp = elem.cloneNode(true);
var tempDiv = doc.createElement("DIV");
tempDiv.appendChild(temp);
outer = tempDiv.innerHTML;
temp.innerHTML = "";
return outer;
}-*/;
private native NativeEvent createKeyEventImpl(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int keyCode, int charCode) /*-{
var evt = doc.createEvent('KeyboardEvent');
if (evt.initKeyEvent) {
// Gecko
evt.initKeyEvent(type, canBubble, cancelable, null, ctrlKey, altKey,
shiftKey, metaKey, keyCode, charCode);
} else {
// This happens to be IE11+ as of today
if ($wnd.console) {
$wnd.console.error("Synthetic keyboard events are not supported in this browser");
}
}
return evt;
}-*/;
private native int getAbsoluteLeftImpl(Element viewport, Element elem) /*-{
// Firefox 3 is actively throwing errors when getBoxObjectFor() is called,
// so we use getBoundingClientRect() whenever possible (but it's not
// supported on older versions). If changing this code, make sure to check
// the museum entry for issue 1932.
// (x) | 0 is used to coerce the value to an integer
if (Element.prototype.getBoundingClientRect) {
return (elem.getBoundingClientRect().left + viewport.scrollLeft) | 0;
} else {
// We cannot use DOMImpl here because offsetLeft/Top return erroneous
// values when overflow is not visible. We have to difference screenX
// here due to a change in getBoxObjectFor which causes inconsistencies
// on whether the calculations are inside or outside of the element's
// border.
// If the element is in a scrollable div, getBoxObjectFor(elem) can return
// a value that varies by 1 pixel.
var doc = elem.ownerDocument;
return doc.getBoxObjectFor(elem).screenX -
doc.getBoxObjectFor(doc.documentElement).screenX;
}
}-*/;
private native int getAbsoluteTopImpl(Element viewport, Element elem) /*-{
// Firefox 3 is actively throwing errors when getBoxObjectFor() is called,
// so we use getBoundingClientRect() whenever possible (but it's not
// supported on older versions). If changing this code, make sure to check
// the museum entry for issue 1932.
// (x) | 0 is used to coerce the value to an integer
if (Element.prototype.getBoundingClientRect) {
return (elem.getBoundingClientRect().top + viewport.scrollTop) | 0;
} else {
// We cannot use DOMImpl here because offsetLeft/Top return erroneous
// values when overflow is not visible. We have to difference screenX
// here due to a change in getBoxObjectFor which causes inconsistencies
// on whether the calculations are inside or outside of the element's
// border.
var doc = elem.ownerDocument;
return doc.getBoxObjectFor(elem).screenY -
doc.getBoxObjectFor(doc.documentElement).screenY;
}
}-*/;
private native boolean isRTL(Element elem) /*-{
var style = elem.ownerDocument.defaultView.getComputedStyle(elem, null);
return style.direction == 'rtl';
}-*/;
}
@@ -1,31 +0,0 @@
package com.google.gwt.dom.client;
abstract class DOMImplPatched extends DOMImpl {
public int getScrollLeft(Document doc) {
return ensureDocumentScrollingElement(doc).getScrollLeft();
}
public int getScrollTop(Document doc) {
return ensureDocumentScrollingElement(doc).getScrollTop();
}
public void setScrollLeft(Document doc, int left) {
ensureDocumentScrollingElement(doc).setScrollLeft(left);
}
public void setScrollTop(Document doc, int top) {
ensureDocumentScrollingElement(doc).setScrollTop(top);
}
private Element ensureDocumentScrollingElement(Document document) {
// In some case (e.g SVG document and old Webkit browsers), getDocumentScrollingElement can
// return null. In this case, default to documentElement.
Element scrollingElement = getDocumentScrollingElement(document);
return scrollingElement != null ? scrollingElement : document.getDocumentElement();
}
Element getDocumentScrollingElement(Document doc) {
return doc.getViewportElement();
}
}
@@ -1,270 +0,0 @@
/*
* Copyright 2011 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.dom.client;
import com.google.gwt.core.client.JavaScriptObject;
/**
* StandardBase implementation of {@link com.google.gwt.user.client.impl.DOMImpl}.
*/
class DOMImplStandardBasePatched extends DOMImplStandardPatched {
private static class ClientRect extends JavaScriptObject {
protected ClientRect() {
}
public final int getLeft() {
return toInt32(getSubPixelLeft());
}
public final int getTop() {
return toInt32(getSubPixelTop());
}
private final native double getSubPixelLeft() /*-{
return this.left;
}-*/;
private final native double getSubPixelTop() /*-{
return this.top;
}-*/;
}
private static native double getAbsoluteLeftUsingOffsets(Element elem) /*-{
// Unattached elements and elements (or their ancestors) with style
// 'display: none' have no offsetLeft.
if (elem.offsetLeft == null) {
return 0;
}
var left = 0;
var doc = elem.ownerDocument;
var curr = elem.parentNode;
if (curr) {
// This intentionally excludes body which has a null offsetParent.
while (curr.offsetParent) {
left -= curr.scrollLeft;
// In RTL mode, offsetLeft is relative to the left edge of the
// scrollable area when scrolled all the way to the right, so we need
// to add back that difference.
if (doc.defaultView.getComputedStyle(curr, '').getPropertyValue('direction') == 'rtl') {
left += (curr.scrollWidth - curr.clientWidth);
}
curr = curr.parentNode;
}
}
while (elem) {
left += elem.offsetLeft;
if (doc.defaultView.getComputedStyle(elem, '')['position'] == 'fixed') {
left += doc.body.scrollLeft;
return left;
}
// Safari 3 does not include borders with offsetLeft, so we need to add
// the borders of the parent manually.
var parent = elem.offsetParent;
if (parent && $wnd.devicePixelRatio) {
left += parseInt(doc.defaultView.getComputedStyle(parent, '').getPropertyValue('border-left-width'));
}
// Safari bug: a top-level absolutely positioned element includes the
// body's offset position already.
if (parent && (parent.tagName == 'BODY') &&
(elem.style.position == 'absolute')) {
break;
}
elem = parent;
}
return left;
}-*/;
private static native double getAbsoluteTopUsingOffsets(Element elem) /*-{
// Unattached elements and elements (or their ancestors) with style
// 'display: none' have no offsetTop.
if (elem.offsetTop == null) {
return 0;
}
var top = 0;
var doc = elem.ownerDocument;
var curr = elem.parentNode;
if (curr) {
// This intentionally excludes body which has a null offsetParent.
while (curr.offsetParent) {
top -= curr.scrollTop;
curr = curr.parentNode;
}
}
while (elem) {
top += elem.offsetTop;
if (doc.defaultView.getComputedStyle(elem, '')['position'] == 'fixed') {
top += doc.body.scrollTop;
return top;
}
// Safari 3 does not include borders with offsetTop, so we need to add the
// borders of the parent manually.
var parent = elem.offsetParent;
if (parent && $wnd.devicePixelRatio) {
top += parseInt(doc.defaultView.getComputedStyle(parent, '').getPropertyValue('border-top-width'));
}
// Safari bug: a top-level absolutely positioned element includes the
// body's offset position already.
if (parent && (parent.tagName == 'BODY') &&
(elem.style.position == 'absolute')) {
break;
}
elem = parent;
}
return top;
}-*/;
private static native ClientRect getBoundingClientRect(Element element) /*-{
return element.getBoundingClientRect && element.getBoundingClientRect();
}-*/;
/**
* The type property on a button element is read-only in safari, so we need to
* set it using setAttribute.
*/
@Override
public native ButtonElement createButtonElement(Document doc, String type) /*-{
var e = doc.createElement("BUTTON");
e.setAttribute('type', type);
return e;
}-*/;
@Override
public native NativeEvent createKeyCodeEvent(Document doc, String type,
boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
int keyCode) /*-{
var evt = this.@com.google.gwt.dom.client.DOMImplStandardBase::createKeyEvent(Lcom/google/gwt/dom/client/Document;Ljava/lang/String;ZZZZZZ)(doc, type, true, true, ctrlKey, altKey, shiftKey, metaKey)
evt.keyCode = keyCode;
return evt;
}-*/;
@Override
@Deprecated
public native NativeEvent createKeyEvent(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int keyCode, int charCode) /*-{
var evt = this.@com.google.gwt.dom.client.DOMImplStandardBase::createKeyEvent(Lcom/google/gwt/dom/client/Document;Ljava/lang/String;ZZZZZZ)(doc, type, canBubble, cancelable, ctrlKey, altKey, shiftKey, metaKey)
evt.keyCode = keyCode;
evt.charCode = charCode;
return evt;
}-*/;
@Override
public native NativeEvent createKeyPressEvent(Document doc,
boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
int charCode) /*-{
var evt = this.@com.google.gwt.dom.client.DOMImplStandardBase::createKeyEvent(Lcom/google/gwt/dom/client/Document;Ljava/lang/String;ZZZZZZ)(doc, 'keypress', true, true, ctrlKey, altKey, shiftKey, metaKey)
evt.charCode = charCode;
return evt;
}-*/;
/**
* Safari 2 does not support {@link ScriptElement#setText(String)}.
*/
@Override
public ScriptElement createScriptElement(Document doc, String source) {
ScriptElement elem = (ScriptElement) createElement(doc, "script");
elem.setInnerText(source);
return elem;
}
@Override
public native EventTarget eventGetCurrentTarget(NativeEvent event) /*-{
return event.currentTarget || $wnd;
}-*/;
@Override
public native int eventGetMouseWheelVelocityY(NativeEvent evt) /*-{
return Math.round(-evt.wheelDelta / 40) || 0;
}-*/;
@Override
public int getAbsoluteLeft(Element elem) {
ClientRect rect = getBoundingClientRect(elem);
double left = rect != null ? rect.getSubPixelLeft()
+ getScrollLeft(elem.getOwnerDocument())
: getAbsoluteLeftUsingOffsets(elem);
return toInt32(left);
}
@Override
public int getAbsoluteTop(Element elem) {
ClientRect rect = getBoundingClientRect(elem);
double top = rect != null ? rect.getSubPixelTop()
+ getScrollTop(elem.getOwnerDocument())
: getAbsoluteTopUsingOffsets(elem);
return toInt32(top);
}
@Override
public int getScrollLeft(Element elem) {
if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
return super.getScrollLeft(elem)
- (elem.getScrollWidth() - elem.getClientWidth());
}
return super.getScrollLeft(elem);
}
@Override
public native int getTabIndex(Element elem) /*-{
// tabIndex is undefined for divs and other non-focusable elements prior to
// Safari 4.
return typeof elem.tabIndex != 'undefined' ? elem.tabIndex : -1;
}-*/;
@Override
public void setScrollLeft(Element elem, int left) {
if (!elem.hasTagName(BodyElement.TAG) && isRTL(elem)) {
left += elem.getScrollWidth() - elem.getClientWidth();
}
super.setScrollLeft(elem, left);
}
protected native boolean isRTL(Element elem) /*-{
return elem.ownerDocument.defaultView.getComputedStyle(elem, '').direction == 'rtl';
}-*/;
private native NativeEvent createKeyEvent(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey) /*-{
// WebKit's KeyboardEvent cannot set or even initialize charCode, keyCode, etc.
// And UIEvent's charCode and keyCode are read-only.
// So we "fake" an event using a raw Event and expandos
var evt = doc.createEvent('Event');
evt.initEvent(type, canBubble, cancelable);
evt.ctrlKey = ctrlKey;
evt.altKey = altKey;
evt.shiftKey = shiftKey;
evt.metaKey = metaKey;
return evt;
}-*/;
}
@@ -1,154 +0,0 @@
/*
* Copyright 2007 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.dom.client;
/**
* Base implementation of {@link com.google.gwt.user.client.impl.DOMImpl} shared
* by those browsers that come a bit closer to supporting a common standard (ie,
* not IE).
*/
abstract class DOMImplStandardPatched extends DOMImplPatched {
@Override
public native NativeEvent createHtmlEvent(Document doc, String type,
boolean canBubble, boolean cancelable) /*-{
var evt = doc.createEvent('HTMLEvents');
evt.initEvent(type, canBubble, cancelable);
return evt;
}-*/;
@Override
public native InputElement createInputRadioElement(Document doc, String name) /*-{
var elem = doc.createElement("INPUT");
elem.type = 'radio';
elem.name = name;
elem.value = 'on';
return elem;
}-*/;
@Override
public native NativeEvent createMouseEvent(Document doc, String type,
boolean canBubble, boolean cancelable, int detail, int screenX,
int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int button, Element relatedTarget) /*-{
// Because Event.getButton() returns bitfield values [1, 4, 2] for [left,
// middle, right], we need to translate them to the standard [0, 1, 2]
// button constants.
if (button == 1) {
button = 0;
} else if (button == 4) {
button = 1;
} else {
button = 2;
}
var evt = doc.createEvent('MouseEvents');
evt.initMouseEvent(type, canBubble, cancelable, null, detail, screenX,
screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button,
relatedTarget);
return evt;
}-*/;
@Override
public native void dispatchEvent(Element target, NativeEvent evt) /*-{
target.dispatchEvent(evt);
}-*/;
@Override
public native int eventGetButton(NativeEvent evt) /*-{
// All modern browsers return 0, 1, and 2 for left, middle, and right,
// respectively. Because eventGetButton() is expected to return the IE
// bitfield norms of 1, 4, and 2, we translate them here.
var button = evt.button;
if (button == 1) {
return 4;
} else if (button == 2) {
return 2;
}
return 1;
}-*/;
@Override
public native int eventGetCharCode(NativeEvent evt) /*-{
return evt.charCode || 0;
}-*/;
@Override
public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{
return evt.relatedTarget;
}-*/;
@Override
public native EventTarget eventGetTarget(NativeEvent evt) /*-{
return evt.target;
}-*/;
@Override
public native void eventPreventDefault(NativeEvent evt) /*-{
evt.preventDefault();
}-*/;
@Override
public native String eventToString(NativeEvent evt) /*-{
return evt.toString();
}-*/;
/*
* textContent is used over innerText for two reasons:
* 1 - It is consistent across browsers. textContent
* does not convert <br>'s to new lines.
* 2 - textContent is faster on retreival because WebKit
* does not recalculate styles as it does for innerText.
*/
@Override
public native String getInnerText(Element elem) /*-{
return elem.textContent;
}-*/;
@Override
public native boolean isOrHasChild(Node parent, Node child) /*-{
return parent.contains(child);
}-*/;
/*
* See getInnerText for why textContent is used instead of innerText.
*/
@Override
public native void setInnerText(Element elem, String text) /*-{
elem.textContent = text || '';
}-*/;
@Override
Element getDocumentScrollingElement(Document doc) {
// Uses http://dev.w3.org/csswg/cssom-view/#dom-document-scrolling element to
// avoid trying to guess about browser behavior.
if (getNativeDocumentScrollingElement(doc) != null) {
return getNativeDocumentScrollingElement(doc);
}
return getLegacyDocumentScrollingElement(doc);
}
Element getLegacyDocumentScrollingElement(Document doc) {
return doc.getViewportElement();
}
final native Element getNativeDocumentScrollingElement(Document doc) /*-{
return doc.scrollingElement;
}-*/;
}
@@ -1,350 +0,0 @@
/*
* Copyright 2009 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.dom.client;
import com.google.gwt.safehtml.shared.annotations.SuppressIsSafeHtmlCastCheck;
abstract class DOMImplTridentPatched extends DOMImplPatched {
/**
* This field *must* be filled in from JSNI code before dispatching an event
* on IE. It should be set to the 'this' context of the handler that receives
* the event, then restored to its initial value when the dispatcher is done.
* See
* {@link com.google.gwt.user.client.impl.DOMImplTrident#initEventSystem()}
* for an example of how this should be done.
*/
private static EventTarget currentEventTarget;
static native boolean isOrHasChildImpl(Node parent, Node child) /*-{
// Element.contains() doesn't work with non-Element nodes on IE, so we have
// to deal explicitly with non-Element nodes here.
// Only Element (1) and Document (9) can contain other nodes.
if ((parent.nodeType != 1) && (parent.nodeType != 9)) {
return parent == child;
}
// If the child is not an Element, check its parent instead.
if (child.nodeType != 1) {
child = child.parentNode;
if (!child) {
return false;
}
}
if (parent.nodeType == 9) {
// In IE8 and IE9 (at least), document.contains does not exist, so use body.contains instead
return (parent === child) || (parent.body && parent.body.contains(child));
} else {
// An extra equality check is required due to the fact that
// elem.contains(elem) is false if elem is not attached to the DOM.
return (parent === child) || parent.contains(child);
}
}-*/;
@Override
public native ButtonElement createButtonElement(Document doc, String type) /*-{
return doc.createElement("<BUTTON type='" + type + "'></BUTTON>");
}-*/;
@Override
@SuppressIsSafeHtmlCastCheck
public Element createElement(Document doc, String tagName) {
if (tagName.contains(":")) {
// Special implementation for tag names with namespace-prefixes. The only
// way to get IE to reliably create namespace-prefixed elements is
// through innerHTML.
Element container = ensureContainer(doc);
container.setInnerHTML("<" + tagName + "/>");
// Remove the element before returning it, so that there's no chance of
// it getting clobbered later.
Element elem = container.getFirstChildElement();
container.removeChild(elem);
return elem;
}
// No prefix. Just use the default implementation (don't use super impl
// here in case it changes at some point in the future).
return createElementInternal(doc, tagName);
}
@Override
public native NativeEvent createHtmlEvent(Document doc, String type,
boolean canBubble, boolean cancelable) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createHtmlEvent()).
var evt = doc.createEventObject();
evt.type = type;
return evt;
}-*/;
@Override
public native InputElement createInputRadioElement(Document doc, String name) /*-{
return doc.createElement("<INPUT type='RADIO' name='" + name + "'>");
}-*/;
@Override
public native NativeEvent createKeyCodeEvent(Document doc, String type,
boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
int keyCode) /*-{
var evt = doc.createEventObject();
evt.type = type;
evt.ctrlKey = ctrlKey;
evt.altKey = altKey;
evt.shiftKey = shiftKey;
evt.metaKey = metaKey;
evt.keyCode = keyCode;
return evt;
}-*/;
@Override
@Deprecated
public native NativeEvent createKeyEvent(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int keyCode, int charCode) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createKeyEvent()).
var evt = this.@com.google.gwt.dom.client.DOMImplTrident::createKeyCodeEvent(Lcom/google/gwt/dom/client/Document;Ljava/lang/String;ZZZZI)(doc, type, ctrlKey, altKey, shiftKey, metaKey, charCode);
evt.charCode = charCode;
return evt;
}-*/;
@Override
public NativeEvent createKeyPressEvent(Document doc, boolean ctrlKey,
boolean altKey, boolean shiftKey, boolean metaKey, int charCode) {
// NOTE: in IE, keyCode is used in both keydown/keyup and keypress, so we
// delegate to createKeyCodeEvent instead of duplicating code.
return createKeyCodeEvent(doc, "keypress", ctrlKey, altKey, shiftKey,
metaKey, charCode);
}
@Override
public native NativeEvent createMouseEvent(Document doc, String type,
boolean canBubble, boolean cancelable, int detail, int screenX,
int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int button, Element relatedTarget) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createMouseEvent()).
var evt = doc.createEventObject();
evt.type = type;
evt.detail = detail;
evt.screenX = screenX;
evt.screenY = screenY;
evt.clientX = clientX;
evt.clientY = clientY;
evt.ctrlKey = ctrlKey;
evt.altKey = altKey;
evt.shiftKey = shiftKey;
evt.metaKey = metaKey;
evt.button = button;
// It would make sense to set evt.[fromElement | toElement] here, because
// that's what IE uses. However, setting these properties has no effect for
// some reason. So instead we set releatedTarget, and explicitly check for
// its existence in eventGetFromElement() and eventGetToElement().
evt.relatedTarget = relatedTarget;
return evt;
}-*/;
@Override
public String cssFloatPropertyName() {
return "styleFloat";
}
@Override
public native void dispatchEvent(Element target, NativeEvent evt) /*-{
target.fireEvent("on" + evt.type, evt);
}-*/;
@Override
public native int eventGetCharCode(NativeEvent evt) /*-{
return evt.keyCode || 0;
}-*/;
@Override
public EventTarget eventGetCurrentTarget(NativeEvent event) {
return currentEventTarget;
}
@Override
public native int eventGetMouseWheelVelocityY(NativeEvent evt) /*-{
return Math.round(-evt.wheelDelta / 40) || 0;
}-*/;
@Override
public native EventTarget eventGetRelatedTarget(NativeEvent evt) /*-{
// Prefer 'relatedTarget' if it's set (see createMouseEvent(), which
// explicitly sets relatedTarget when synthesizing mouse events).
return evt.relatedTarget ||
(evt.type == "mouseout" ? evt.toElement:evt.fromElement);
}-*/;
@Override
public native EventTarget eventGetTarget(NativeEvent evt) /*-{
return evt.srcElement;
}-*/;
@Override
public native void eventPreventDefault(NativeEvent evt) /*-{
evt.returnValue = false;
}-*/;
@Override
public native void eventStopPropagation(NativeEvent evt) /*-{
evt.cancelBubble = true;
}-*/;
@Override
public native String eventToString(NativeEvent evt) /*-{
if (evt.toString) return evt.toString();
return "[event" + evt.type + "]";
}-*/;
/**
* IE returns a numeric type for some attributes that are really properties,
* such as offsetWidth. We need to coerce these to strings to prevent a
* runtime JS exception.
*/
@Override
public native String getAttribute(Element elem, String name) /*-{
var attr = elem.getAttribute(name);
return attr == null ? '' : attr + '';
}-*/;
@Override
public int getBodyOffsetLeft(Document doc) {
return getClientLeft(doc.getViewportElement());
}
@Override
public int getBodyOffsetTop(Document doc) {
return getClientTop(doc.getViewportElement());
}
@Override
public native String getInnerText(Element elem) /*-{
return elem.innerText;
}-*/;
/**
* Coerce numeric values a string. In IE, some values can be stored as numeric
* types.
*/
@Override
public native String getNumericStyleProperty(Style style, String name) /*-{
return typeof(style[name]) == "number" ? "" + style[name] : style[name];
}-*/;
@Override
public String getTagName(Element elem) {
String tagName = getTagNameInternal(elem);
String scopeName = getScopeNameInternal(elem);
if ((scopeName == null) || "html".equalsIgnoreCase(scopeName)) {
return tagName;
}
return scopeName + ":" + tagName;
}
@Override
public native boolean hasAttribute(Element elem, String name) /*-{
var node = elem.getAttributeNode(name);
return !!(node && node.specified);
}-*/;
@Override
public boolean isOrHasChild(Node parent, Node child) {
return isOrHasChildImpl(parent, child);
}
@Override
public native void selectAdd(SelectElement select, OptionElement option,
OptionElement before) /*-{
// IE only accepts indices for the second argument.
if (before) {
select.add(option, before.index);
} else {
select.add(option);
}
}-*/;
@Override
public native void setInnerText(Element elem, String text) /*-{
elem.innerText = text || '';
}-*/;
protected native int getBoundingClientRectLeft(Element elem) /*-{
// getBoundingClientRect() throws a JS exception if the elem is not attached
// to the document, so we wrap it in a try/catch block
try {
return elem.getBoundingClientRect().left;
} catch (e) {
return 0;
}
}-*/;
protected native int getBoundingClientRectTop(Element elem) /*-{
// getBoundingClientRect() throws a JS exception if the elem is not attached
// to the document, so we wrap it in a try/catch block
try {
return elem.getBoundingClientRect().top;
} catch (e) {
return 0;
}
}-*/;
protected native boolean isRTL(Element elem) /*-{
return elem.currentStyle.direction == 'rtl';
}-*/;
private native Element createElementInternal(Document doc, String tagName) /*-{
return doc.createElement(tagName);
}-*/;
// IE needs a container div *for each document* for use by createElement().
private native Element ensureContainer(Document doc) /*-{
if (!doc.__gwt_container) {
doc.__gwt_container = doc.createElement('div');
}
return doc.__gwt_container;
}-*/;
/**
* clientLeft is non-standard and not implemented on all browsers.
*/
private native int getClientLeft(Element elem) /*-{
return elem.clientLeft;
}-*/;
/**
* clientTop is non-standard and not implemented on all browsers.
*/
private native int getClientTop(Element elem) /*-{
return elem.clientTop;
}-*/;
private native String getScopeNameInternal(Element elem) /*-{
return elem.scopeName;
}-*/;
private native String getTagNameInternal(Element elem) /*-{
return elem.tagName;
}-*/;
}
@@ -1,72 +0,0 @@
/*
* Copyright 2011 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.dom.client;
/**
* WebKit based implementation of {@link com.google.gwt.dom.client.DOMImplStandardBase}.
*/
class DOMImplWebkitPatched extends DOMImplStandardBasePatched {
/**
* Return true if using Webkit 525.x (Safari 3) or earlier.
*
* @return true if using Webkit 525.x (Safari 3) or earlier.
*/
private static native boolean isWebkit525OrBefore() /*-{
var result = /safari\/([\d.]+)/.exec(navigator.userAgent.toLowerCase());
if (result) {
var version = (parseFloat(result[1]));
if (version < 526) {
return true;
}
}
return false;
}-*/;
/**
* Webkit events sometimes target the text node inside of the element instead
* of the element itself, so we need to get the parent of the text node.
*/
@Override
public native EventTarget eventGetTarget(NativeEvent evt) /*-{
var target = evt.target;
if (target && target.nodeType == 3) {
target = target.parentNode;
}
return target;
}-*/;
/**
* Webkit based browsers require that we set the webkit-user-drag style
* attribute to make an element draggable.
*/
@Override
public void setDraggable(Element elem, String draggable) {
super.setDraggable(elem, draggable);
if ("true".equals(draggable)) {
elem.getStyle().setProperty("webkitUserDrag", "element");
} else {
elem.getStyle().clearProperty("webkitUserDrag");
}
}
@Override
Element getLegacyDocumentScrollingElement(Document doc) {
// Old WebKit needs body.scrollLeft in both quirks mode and strict mode.
return doc.getBody();
}
}
@@ -3,7 +3,6 @@
<module>
<inherits name="com.google.gwt.activity.Activity" />
<inherits name="com.sap.sse.common.SSECommonSerializers" />
<inherits name="com.google.gwt.dom.DOMPatch" />
<source path='client'/>
<source path='shared'/>
</module>
@@ -12,8 +12,8 @@ Bundle-ActivationPolicy: lazy
Bundle-ClassPath: WEB-INF/classes/
Require-Bundle: javax.servlet;bundle-version="3.1.0",
com.sap.sse.gwt,
com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1",
com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2",
com.sap.sse.security,
org.json.simple,
com.sap.sailing.domain.common,
@@ -19,6 +19,6 @@ Export-Package: org.moxieapps.gwt.highcharts.client.plotOptions;uses:="o
ieapps.gwt.highcharts.client,com.google.gwt.json.client";version="1.5.0
"
Bundle-ActivationPolicy: lazy
Require-Bundle: com.google.gwt.user;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.dev;bundle-version="2.8.1";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.1"
Require-Bundle: com.google.gwt.user;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.dev;bundle-version="2.8.2";resolution:=optional,
com.google.gwt.servlet;bundle-version="2.8.2"
+3 -3
View File
@@ -32,9 +32,9 @@
(see Bugzilla: https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=3859). -->
<!-- Most likely, serialization/replication will fail with tycho versions based on Eclipse Neon R (4.6.0). -->
<tycho-version>1.0.0</tycho-version>
<gwt.version>2.8.1</gwt.version>
<!-- gwt-maven-plugin is typically in sync with the GWT version. But for GWT 2.8.1, there isn't a version yet. -->
<gwt.plugin.version>2.8.0</gwt.plugin.version>
<gwt.version>2.8.2</gwt.version>
<!-- gwt-maven-plugin is typically in sync with the GWT version. But sometimes versions need extra time after a new GWT release. -->
<gwt.plugin.version>2.8.2</gwt.plugin.version>
<gwt.minVersion>2.8.0</gwt.minVersion>
<gwt.workers>2</gwt.workers>
<p2-target>race-analysis-p2-remote</p2-target><!--can be overidden through p2-target.local profile -->
+1 -1
View File
@@ -18,7 +18,7 @@ First of all, make sure you've looked at http://www.amazon.de/Patterns-Elements-
6. JDK 1.7 (Java SE 7), http://jdk7.java.net
7. JDK 1.8 (Java SE 8), http://jdk8.java.net
8. Maven 3.1.1 (or higher), http://maven.apache.org
9. GWT SDK 2.8.1 (http://www.gwtproject.org/download.html)
9. GWT SDK 2.8.2 (http://www.gwtproject.org/download.html)
10. Android Studio (https://developer.android.com/tools/studio/index.html) or IntelliJ IDEA (https://www.jetbrains.com/idea/download/)
#### Automatic Eclipse plugin installation