├── .gitignore
├── .idea
└── compiler.xml
├── README.md
├── gen
└── com
│ └── google
│ └── gwt
│ ├── lang
│ └── com_00046workingflows_00046js_00046jscore_00046JSCore__EntryMethodHolder.java
│ ├── user
│ └── client
│ │ └── DocumentModeAsserter_DocumentModeProperty.java
│ └── useragent
│ └── client
│ └── UserAgentImplSafari.java
├── gwt-compile.sh
├── gwt-runcodeserver.sh
├── jscore.iml
├── pom.xml
└── src
└── main
└── java
└── com
└── workingflows
└── js
└── jscore
├── JSCore.gwt.xml
└── client
├── JSCoreEntryPoint.java
├── JSNI.java
└── api
├── Array.java
├── Changed.java
├── Console.java
├── Document.java
├── Function.java
├── JSON.java
├── JsObject.java
├── MemoryInfo.java
├── Window.java
├── core
├── DOMError.java
├── DOMTokenList.java
├── Element.java
├── Event.java
├── EventListener.java
├── EventTarget.java
├── Node.java
├── NodeList.java
└── package-info.java
├── db
├── IDBDatabase.java
├── IDBEnvironment.java
├── IDBFactory.java
├── IDBObjectStore.java
├── IDBOpenDBRequest.java
├── IDBRequest.java
├── IDBRequestReadyState.java
├── IDBTransaction.java
├── IDBTransactionMode.java
├── IDBVersionChangeEvent.java
└── package-info.java
├── html
├── CSSRule.java
├── CSSRuleList.java
├── CSSStyleSheet.java
├── HTMLBodyElement.java
├── HTMLElement.java
├── StyleSheet.java
└── StyleSheetList.java
├── package-info.java
├── polymer
└── Polymer.java
└── promise
├── Promise.java
├── PromiseFn.java
├── PromiseThen.java
├── RejectedFn.java
├── ResolveFn.java
└── package-info.java
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | nbactions.xml
3 | nb-configuration.xml
4 | .idea/
5 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | The repository has moved to https://github.com/logikas/gwt-jscore
2 |
3 | gwt-jscore
4 | ==========
5 |
6 | This project is an abstraction of the key elements of HTML and JS functionality.
7 | This can be replaced in the future by Elemental 2.0.
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gen/com/google/gwt/lang/com_00046workingflows_00046js_00046jscore_00046JSCore__EntryMethodHolder.java:
--------------------------------------------------------------------------------
1 | package com.google.gwt.lang;
2 | public class com_00046workingflows_00046js_00046jscore_00046JSCore__EntryMethodHolder {
3 | public static final void init() {
4 | // to be synthesized later
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/gen/com/google/gwt/user/client/DocumentModeAsserter_DocumentModeProperty.java:
--------------------------------------------------------------------------------
1 | package com.google.gwt.user.client;
2 |
3 | import com.google.gwt.user.client.DocumentModeAsserter.Severity;
4 |
5 | public class DocumentModeAsserter_DocumentModeProperty implements com.google.gwt.user.client.DocumentModeAsserter.DocumentModeProperty {
6 |
7 | public String[] getAllowedDocumentModes() {
8 | return new String[] {
9 | "CSS1Compat",
10 | };
11 | }
12 |
13 | public Severity getDocumentModeSeverity() {
14 | return Severity.WARN;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/gen/com/google/gwt/useragent/client/UserAgentImplSafari.java:
--------------------------------------------------------------------------------
1 | package com.google.gwt.useragent.client;
2 |
3 | public class UserAgentImplSafari implements com.google.gwt.useragent.client.UserAgent {
4 |
5 | public native String getRuntimeValue() /*-{
6 | var ua = navigator.userAgent.toLowerCase();
7 | var docMode = $doc.documentMode;
8 | if ((function() {
9 | return (ua.indexOf('webkit') != -1);
10 | })()) return 'safari';
11 | if ((function() {
12 | return (ua.indexOf('msie') != -1 && (docMode >= 10 && docMode < 11));
13 | })()) return 'ie10';
14 | if ((function() {
15 | return (ua.indexOf('msie') != -1 && (docMode >= 9 && docMode < 11));
16 | })()) return 'ie9';
17 | if ((function() {
18 | return (ua.indexOf('msie') != -1 && (docMode >= 8 && docMode < 11));
19 | })()) return 'ie8';
20 | if ((function() {
21 | return (ua.indexOf('gecko') != -1 || docMode >= 11);
22 | })()) return 'gecko1_8';
23 | return 'unknown';
24 | }-*/;
25 |
26 |
27 | public String getCompileTimeValue() {
28 | return "safari";
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/gwt-compile.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | java -cp ./target/classes:./src/main/java:./src/main/resources:$HOME/.m2/repository/com/google/gwt/gwt-user/2.7.0-SNAPSHOT/gwt-user-2.7.0-SNAPSHOT.jar:$HOME/.m2/repository/com/google/gwt/gwt-dev/2.7.0-SNAPSHOT/gwt-dev-2.7.0-SNAPSHOT.jar\
5 | com.google.gwt.dev.Compiler \
6 | -XnoclassMetadata -incrementalCompileWarnings -XnocheckCasts -XjsInteropMode JS -XclosureCompiler -draftCompile -style PRETTY -gen source \
7 | com.workingflows.jquery.JQuery
--------------------------------------------------------------------------------
/gwt-runcodeserver.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | java -cp ./target/classes:./target/gwt-sample-1.0-SNAPSHOT/WEB-INF/classes:./src/main/java:./src/main/resources:$HOME/.m2/repository/com/google/gwt/gwt-user/2.7.0-SNAPSHOT/gwt-user-2.7.0-SNAPSHOT.jar:$HOME/.m2/repository/com/google/gwt/gwt-dev/2.7.0-SNAPSHOT/gwt-dev-2.7.0-SNAPSHOT.jar:$HOME/.m2/repository/com/google/gwt/gwt-codeserver/2.7.0-SNAPSHOT/gwt-codeserver-2.7.0-SNAPSHOT.jar:$HOME/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:$HOME/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar \
5 | com.google.gwt.dev.codeserver.CodeServer -src ./src \
6 | -logLevel INFO -nocompileTest \
7 | com.logikas.gwt.sample.gwt_sample
8 |
--------------------------------------------------------------------------------
/jscore.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 | 4.0.0
5 |
6 | com.workingflows.js
7 | jscore
8 | jar
9 | 1.0
10 | jscore
11 |
12 |
13 | 2.8.0-beta1
14 | 2.8.0-beta1
15 | UTF-8
16 | 1.8
17 | 1.8
18 |
19 |
20 |
21 |
22 |
23 | com.google.gwt
24 | gwt
25 | pom
26 | import
27 | ${gwt.version}
28 |
29 |
30 |
31 |
32 |
33 |
34 | com.google.gwt
35 | gwt-user
36 | provided
37 |
38 |
39 |
40 |
41 |
42 |
43 | src/main/java
44 |
45 | **/*.java
46 | **/*.gwt.xml
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | org.apache.maven.plugins
56 | maven-compiler-plugin
57 | 2.5.1
58 | true
59 |
63 |
64 |
65 |
66 | org.codehaus.mojo
67 | gwt-maven-plugin
68 | ${gwt.plugin.version}
69 |
70 | ${basedir}/gen
71 |
72 | true
73 | true
74 |
75 |
76 |
77 |
78 | compile
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | sonatype-google-releases
89 | Sonatype Google Snapshots
90 | https://oss.sonatype.org/content/repositories/google-releases
91 |
92 | true
93 | always
94 |
95 |
96 | true
97 | always
98 |
99 |
100 |
101 |
102 | sonatype-google-snapshots
103 | Sonatype Google Snapshots
104 | https://oss.sonatype.org/content/repositories/google-snapshots
105 |
106 | true
107 | always
108 |
109 |
110 | true
111 | always
112 |
113 |
114 |
115 |
116 |
117 |
118 | sonatype-google-snapshots
119 | Sonatype Google Snapshots
120 | https://oss.sonatype.org/content/repositories/google-snapshots
121 |
122 | false
123 |
124 |
125 | true
126 | always
127 |
128 |
129 |
130 | Codehouse
131 | Codehouse snapshots
132 | https://oss.sonatype.org/content/repositories/snapshots
133 |
134 | true
135 |
136 |
137 | true
138 | always
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/JSCore.gwt.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/JSCoreEntryPoint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client;
17 |
18 | import com.google.gwt.core.client.EntryPoint;
19 |
20 | /**
21 | * Load the JS library if it's not loaded
22 | *
23 | *
24 | * @author Cristian Rinaldi csrinaldi@gmail.com
26 | * @author Andres Testi andres.a.testi@gmail.com
28 | */
29 | public class JSCoreEntryPoint implements EntryPoint {
30 |
31 | @Override
32 | public void onModuleLoad() {
33 | //TODO load polyfills
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/JSNI.java:
--------------------------------------------------------------------------------
1 | package com.workingflows.js.jscore.client;
2 |
3 | /*
4 | * To change this license header, choose License Headers in Project Properties.
5 | * To change this template file, choose Tools | Templates
6 | * and open the template in the editor.
7 | */
8 |
9 |
10 | import com.workingflows.js.jscore.client.api.Console;
11 | import com.workingflows.js.jscore.client.api.JSON;
12 | import com.workingflows.js.jscore.client.api.Window;
13 |
14 | /**
15 | *
16 | * @author Cristian Rinaldi
17 | */
18 | public class JSNI {
19 |
20 | public final static native Console createConsole() /*-{
21 | return $wnd.console;
22 | }-*/;
23 |
24 | public final static native Window createWindow() /*-{
25 | return $wnd;
26 | }-*/;
27 |
28 | public final static native JSON createJSON() /*-{
29 | return $wnd.JSON;
30 | }-*/;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Array.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import jsinterop.annotations.JsType;
19 |
20 |
21 | /**
22 | * Native JS Array
23 | *
24 | * @author Cristian Rinaldi
25 | * csrinaldi@gmail.com
26 | */
27 | @JsType(isNative = true)
28 | public class Array extends JsObject{
29 |
30 | //Class Method
31 | public static native boolean isArray(Object obj);
32 | public static native Array of(Object[] objs);
33 |
34 | public native int push(int element);
35 | public native int push(int element, int element2);
36 | public native int push(String element);
37 | public native int pop();
38 | public native Array filter(Function fn);
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Changed.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 | /**
12 | * obj The object to be observed. callback The function called each time changes
13 | * are made, with the following argument: changes An array of objects each
14 | * representing a change. The properties of these change objects are: name: The
15 | * name of the property which was changed. object: The changed object after the
16 | * change was made. type: A string indicating the type of change taking place.
17 | * One of "add", "update", or "delete". oldValue: Only for "update" and "delete"
18 | * types. The value before the change. acceptList The list of types of changes
19 | * to be observed on the given object for the given callback. If omitted, the
20 | * array ["add", "update", "delete", "reconfigure", "setPrototype",
21 | * "preventExtensions"] will be used.
22 | *
23 | * @author Cristian Rinaldi
24 | * @param
25 | */
26 | @JsType
27 | public class Changed{
28 |
29 | @JsProperty
30 | public native String getName();
31 |
32 | @JsProperty
33 | public native T getObject();
34 |
35 | @JsProperty
36 | public native String getType();
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Console.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import jsinterop.annotations.JsProperty;
19 | import jsinterop.annotations.JsType;
20 |
21 | /**
22 | * Native JS Console
23 | *
24 | * @author Cristian Rinaldi
25 | * csrinaldi@gmail.com
26 | */
27 | @JsType(isNative = true)
28 | public class Console {
29 |
30 | @JsProperty
31 | public native MemoryInfo getMemory();
32 |
33 | public native void log(Object... obj);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Document.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import com.workingflows.js.jscore.client.api.html.StyleSheetList;
19 | import com.workingflows.js.jscore.client.api.core.Element;
20 | import com.workingflows.js.jscore.client.api.core.NodeList;
21 | import com.workingflows.js.jscore.client.api.html.HTMLBodyElement;
22 | import com.workingflows.js.jscore.client.api.html.HTMLElement;
23 | import jsinterop.annotations.JsProperty;
24 | import jsinterop.annotations.JsType;
25 |
26 | /**
27 | * Represent a Document
28 | *
29 | * @author Cristian Rinaldi csrinaldi@gmail.com
31 | * @author Andres Testi andres.a.testi@gmail.com
33 | */
34 | @JsType(isNative = true)
35 | public class Document {
36 |
37 | public native HTMLElement createElement(String element);
38 |
39 | public native HTMLElement getElementsByTagName(String body);
40 |
41 | @JsProperty
42 | public native HTMLBodyElement getBody();
43 |
44 | public native Element querySelector(String selector);
45 |
46 | public native NodeList querySelectorAll(String selector);
47 |
48 | @JsProperty
49 | public native StyleSheetList getStyleSheets();
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Function.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import jsinterop.annotations.JsFunction;
19 |
20 |
21 |
22 | /**
23 | * Represent a Function in JS Enviroment.
24 | *
25 | *
26 | * @author Cristian Rinaldi csrinaldi@gmail.com
28 | * @author Andres Testi andres.a.testi@gmail.com
30 | * @param
31 | * @param
32 | */
33 | @JsFunction
34 | public interface Function {
35 | E call(T changed);
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/JSON.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import jsinterop.annotations.JsType;
19 |
20 | /**
21 | * Native JSON Object
22 | *
23 | * @author Cristian Rinaldi csrinaldi@gmail.com
25 | * @author Andres Testi andres.a.testi@gmail.com
27 | */
28 | @JsType(isNative = true)
29 | public class JSON {
30 |
31 | public static native String stringify(JsObject obj);
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/JsObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 |
19 |
20 | /**
21 | * Native JS Object
22 | *
23 | * @author Cristian Rinaldi csrinaldi@gmail.com
24 | */
25 | import jsinterop.annotations.JsMethod;
26 | import jsinterop.annotations.JsPackage;
27 | import jsinterop.annotations.JsType;
28 |
29 | @JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL)
30 | public class JsObject {
31 |
32 | @JsMethod
33 | public static native void observe(T model, Function[], Void> fn);
34 |
35 | public static native String[] getOwnPropertyNames(Object object);
36 |
37 | public native boolean hasOwnProperty(String name);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/MemoryInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import jsinterop.annotations.JsType;
19 |
20 |
21 |
22 | /**
23 | * Native JS MemoryInfo
24 | *
25 | * @author Cristian Rinaldi csrinaldi@gmail.com
27 | * @author Andres Testi andres.a.testi@gmail.com
29 | */
30 | @JsType(isNative = true)
31 | public class MemoryInfo {
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/Window.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api;
17 |
18 | import com.workingflows.js.jscore.client.api.db.IDBEnvironment;
19 | import jsinterop.annotations.JsProperty;
20 | import jsinterop.annotations.JsType;
21 |
22 | /**
23 | * Native JS window
24 | *
25 | * @author Cristian Rinaldi csrinaldi@gmail.com
27 | * @author Andres Testi andres.a.testi@gmail.com
29 | */
30 | @JsType(isNative = true)
31 | public class Window extends IDBEnvironment{
32 |
33 | @JsProperty
34 | public native Console getConsole();
35 |
36 | @JsProperty
37 | public native Document getDocument();
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/DOMError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.core;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 | /**
12 | *
13 | * @author Cristian Rinaldi
14 | */
15 | @JsType(isNative = true)
16 | public class DOMError {
17 |
18 | @JsProperty
19 | public native String getName();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/DOMTokenList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.core;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 | /**
12 | * Documentación de {@link DOMTokenList}.
13 | *
14 | * //TODO Documentar la interface
15 | *
16 | * @author Cristian Rinaldi
17 | */
18 | @JsType(isNative = true)
19 | public class DOMTokenList {
20 |
21 | /**
22 | * This interface doesn't inherit any property.
23 | *
24 | * DOMTokenList.length Read only Is an integer representing the number of
25 | * objects stored in the object.
26 | * @return
27 | */
28 | @JsProperty
29 | public native int getLenth();
30 |
31 | /**
32 | * Returns an item in the list by its index (or undefined if the number is
33 | * greater than or equal to the length of the list, prior to Gecko 7.0
34 | * returned null)
35 | *
36 | * @param index
37 | * @return
38 | */
39 | public native String item(int index);
40 |
41 | /**
42 | * Returns true if the underlying string contains token, otherwise false
43 | *
44 | * @param obj
45 | * @return
46 | */
47 | public native Boolean contains(String obj);
48 |
49 | /**
50 | * Adds token to the underlying string
51 | *
52 | * @param obj
53 | */
54 | public native void add(String obj);
55 |
56 | /**
57 | * Removes token from the underlying string
58 | *
59 | * @param obj
60 | */
61 | public native void remove(String obj);
62 |
63 | /**
64 | * Removes token from string and returns false. If token doesn't exist it's
65 | * added and the function returns true
66 | *
67 | * @param obj
68 | * @return
69 | */
70 | public native Boolean toggle(String obj);
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/Element.java:
--------------------------------------------------------------------------------
1 | /** To change this license header, choose License Headers in Project Properties.
2 | * To change this template file, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package com.workingflows.js.jscore.client.api.core;
6 |
7 | import com.workingflows.js.jscore.client.api.Function;
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 | /**
12 | *
13 | * @author Cristian Rinaldi
14 | */
15 | @JsType(isNative = true)
16 | public class Element extends Node {
17 |
18 | @JsProperty
19 | public native DOMTokenList getClassList();
20 |
21 | public native void addEventListener(String event, Function fn);
22 |
23 | public native Object querySelector(String selector);
24 |
25 | @JsProperty
26 | public native void setInnerHTML(String html);
27 |
28 | @JsProperty
29 | public native String getInnerHTML();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/Event.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.core;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 |
12 |
13 | /**
14 | *
15 | * @author Cristian Rinaldi
16 | */
17 | @JsType(isNative = true)
18 | public class Event {
19 |
20 | @JsProperty
21 | public native T getTarget();
22 |
23 | @JsProperty
24 | public native T getCurrentTarget();
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/EventListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.core;
7 |
8 | import com.workingflows.js.jscore.client.api.JsObject;
9 | import jsinterop.annotations.JsFunction;
10 |
11 | /**
12 | *
13 | *
14 | *
15 | * @author Cristian Rinaldi
16 | * @param
17 | */
18 | @FunctionalInterface
19 | @JsFunction
20 | public interface EventListener {
21 | public void onEvent(E event);
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/EventTarget.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.core;
17 |
18 | import com.workingflows.js.jscore.client.api.JsObject;
19 | import jsinterop.annotations.JsType;
20 |
21 | /**
22 | * Represent a EventTarget Element
23 | *
24 | * @author Cristian Rinaldi
25 | */
26 | @JsType(isNative = true)
27 | public class EventTarget extends JsObject {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/Node.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.core;
17 |
18 | import com.workingflows.js.jscore.client.api.JsObject;
19 | import jsinterop.annotations.JsType;
20 |
21 | /**
22 | * Represent a EventTarget Element
23 | *
24 | * @author Cristian Rinaldi
25 | */
26 | @JsType(isNative = true)
27 | public class Node extends EventTarget {
28 |
29 | public native void bind(String property, JsObject objects);
30 |
31 | public native Element parentElement();
32 |
33 | public native Node parentNode();
34 |
35 | public native Node firstChild();
36 |
37 | public native Node removeChild(Node child);
38 |
39 | public native void appendChild(Object child);
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/NodeList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.core;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 | /**
12 | *
13 | * @author iron
14 | */
15 | @JsType(isNative = true)
16 | public class NodeList {
17 |
18 | /**
19 | * This attribute specifies the length or size of the list.
20 | */
21 | @JsProperty
22 | public native int getLength();
23 |
24 | /**
25 | * This method retrieves a node specified by ordinal index. Nodes are
26 | * numbered in tree order (depth-first traversal order).
27 | *
28 | * @param index The index of the node to be fetched. The index origin is 0.
29 | * @return The Node
at the corresponding position upon success.
30 | * A value of null
is returned if the index is out of range.
31 | */
32 | public native Node item(int index);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/core/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | @jsinterop.annotations.JsPackage(namespace = jsinterop.annotations.JsPackage.GLOBAL)
7 | package com.workingflows.js.jscore.client.api.core;
8 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBDatabase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import com.workingflows.js.jscore.client.api.Function;
9 | import com.workingflows.js.jscore.client.api.JsObject;
10 | import jsinterop.annotations.JsProperty;
11 | import jsinterop.annotations.JsType;
12 |
13 |
14 | /**
15 | *
16 | * @author Cristian Rinaldi
17 | *
18 | */
19 | @JsType(isNative = true)
20 | public class IDBDatabase extends JsObject{
21 |
22 | @JsProperty
23 | public native String getName();
24 |
25 | @JsProperty
26 | public native Long getVersion();
27 |
28 | @JsProperty
29 | public native String[] getObjectStoreNames();
30 |
31 | @JsProperty
32 | public native void setOnabort(Function f);
33 |
34 | @JsProperty
35 | public native void setOnerror(Function f);
36 |
37 | @JsProperty
38 | public native void setOnversionchange(Function f);
39 |
40 | public native void close();
41 |
42 | public native IDBObjectStore createObjectStore(String objStore, Object parametes);
43 |
44 | public native void deleteObjectStore(String objStore);
45 |
46 | public native IDBTransaction transaction(String[] objStores, String mode);
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBEnvironment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import jsinterop.annotations.JsProperty;
9 | import jsinterop.annotations.JsType;
10 |
11 |
12 | /**
13 | *
14 | * @author Cristian Rinaldi
15 | */
16 | @JsType(isNative = true)
17 | public class IDBEnvironment {
18 |
19 | @JsProperty
20 | public native IDBFactory getIndexedDB();
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBFactory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import com.workingflows.js.jscore.client.api.JsObject;
9 | import jsinterop.annotations.JsType;
10 |
11 |
12 |
13 | /**
14 | *
15 | * @author Cristian Rinaldi
16 | */
17 | @JsType(isNative = true)
18 | public class IDBFactory extends JsObject{
19 |
20 | public native IDBOpenDBRequest open(String name, int version);
21 |
22 | public native IDBOpenDBRequest deleteDatabase(String name);
23 |
24 | public native int cmp(Object first, Object second);
25 | };
26 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBObjectStore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import com.workingflows.js.jscore.client.api.JsObject;
9 | import jsinterop.annotations.JsProperty;
10 | import jsinterop.annotations.JsType;
11 |
12 | /**
13 | *
14 | * @author Cristian Rinaldi
15 | */
16 | @JsType(isNative = true)
17 | public class IDBObjectStore {
18 |
19 | public native Object createIndex(String name, String path, JsObject options);
20 |
21 | public native IDBRequest add(JsObject obj, String id);
22 |
23 | public native IDBRequest put(JsObject obj, String id);
24 |
25 | public native IDBRequest get(String id);
26 |
27 | @JsProperty
28 | public native String getKeyPath();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBOpenDBRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 |
9 | import com.workingflows.js.jscore.client.api.Function;
10 | import jsinterop.annotations.JsProperty;
11 | import jsinterop.annotations.JsType;
12 |
13 | /**
14 | *
15 | * @author Cristian Rinaldi
16 | * @param
17 | */
18 | @JsType(isNative = true)
19 | public class IDBOpenDBRequest extends IDBRequest{
20 |
21 | @JsProperty
22 | public native void setOnupgradeneeded(Function, Void> fn);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 |
9 | import com.workingflows.js.jscore.client.api.Function;
10 | import com.workingflows.js.jscore.client.api.JsObject;
11 | import com.workingflows.js.jscore.client.api.core.DOMError;
12 | import jsinterop.annotations.JsProperty;
13 | import jsinterop.annotations.JsType;
14 |
15 | /**
16 | *
17 | * @author Cristian Rinaldi
18 | */
19 | @JsType(isNative = true)
20 | public class IDBRequest {
21 |
22 | @JsProperty
23 | public native void setOnsuccess(Function fn);
24 |
25 | @JsProperty
26 | public native Function getOnsuccess();
27 |
28 | @JsProperty
29 | public native void setSource(JsObject object);
30 |
31 | @JsProperty
32 | public native JsObject getSource();
33 |
34 | @JsProperty
35 | public native DOMError getError();
36 |
37 | @JsProperty
38 | public native void setError(DOMError dom);
39 |
40 | @JsProperty
41 | public native void setOnerror(Function fn);
42 |
43 | @JsProperty
44 | public native Function getOnerror();
45 |
46 | @JsProperty
47 | public native String getReadyState();
48 |
49 | @JsProperty
50 | public native T getResult();
51 |
52 | @JsProperty
53 | public native IDBTransaction getTransaction();
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBRequestReadyState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | /**
9 | *
10 | * @author Cristian Rinaldi
11 | */
12 | public class IDBRequestReadyState {
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBTransaction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import com.workingflows.js.jscore.client.api.Function;
9 | import com.workingflows.js.jscore.client.api.core.DOMError;
10 | import com.workingflows.js.jscore.client.api.core.EventTarget;
11 | import jsinterop.annotations.JsProperty;
12 | import jsinterop.annotations.JsType;
13 |
14 | /**
15 | *
16 | * @author Cristian Rinaldi
17 | */
18 | @JsType(isNative = true)
19 | public class IDBTransaction extends EventTarget{
20 |
21 | @JsProperty
22 | public native IDBDatabase getBb();
23 |
24 | @JsProperty
25 | public native DOMError getError();
26 |
27 | @JsProperty
28 | public native IDBTransactionMode getMode();
29 |
30 | @JsProperty
31 | public native void setMode(IDBTransactionMode mode);
32 |
33 | @JsProperty
34 | public native void setOnabort(Function fn);
35 |
36 | @JsProperty
37 | public native void setOncomplete(Function fn);
38 |
39 | @JsProperty
40 | public native String[] getObjectStoreNames();
41 |
42 | @JsProperty
43 | public native void setOnerror(Function fn);
44 |
45 | public native void abort();
46 |
47 | public native IDBObjectStore objectStore(String name);
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBTransactionMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import jsinterop.annotations.JsType;
9 |
10 | /**
11 | *
12 | * @author Cristian Rinaldi
13 | */
14 |
15 | @JsType(isNative = true)
16 | public class IDBTransactionMode {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/IDBVersionChangeEvent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.db;
7 |
8 | import com.workingflows.js.jscore.client.api.core.Event;
9 | import jsinterop.annotations.JsProperty;
10 | import jsinterop.annotations.JsType;
11 |
12 | /**
13 | *
14 | * @author Cristian Rinaldi
15 | * @param
16 | */
17 |
18 | @JsType(isNative = true)
19 | public class IDBVersionChangeEvent extends Event{
20 |
21 | @JsProperty
22 | public native long getOldVersion();
23 |
24 | @JsProperty
25 | public native long getNewVersion();
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/db/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | @jsinterop.annotations.JsPackage(namespace = jsinterop.annotations.JsPackage.GLOBAL)
7 | package com.workingflows.js.jscore.client.api.db;
8 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/CSSRule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.html;
7 |
8 | import jsinterop.annotations.JsProperty;
9 |
10 | /**
11 | * Native CSSRule
12 | * https://developer.mozilla.org/en-US/docs/Web/API/CSSRule
13 | *
14 | * @author Cristian Rinaldi
15 | */
16 | public class CSSRule {
17 |
18 | final short STYLE_RULE = 1;
19 | final short CHARSET_RULE = 2; // Obsolete
20 | final short IMPORT_RULE = 3;
21 | final short MEDIA_RULE = 4;
22 | final short FONT_FACE_RULE = 5;
23 | final short PAGE_RULE = 6;
24 | final short KEYFRAMES_RULE = 7;
25 | final short KEYFRAME_RULE = 8;
26 | final short NAMESPACE_RULE = 10;
27 | final short COUNTER_STYLE_RULE = 11;
28 | final short SUPPORTS_RULE = 12;
29 | final short DOCUMENT_RULE = 13;
30 | final short FONT_FEATURE_VALUES_RULE = 14;
31 | final short VIEWPORT_RULE = 15;
32 | final short REGION_STYLE_RULE = 16;
33 |
34 | @JsProperty
35 | public native short getType();
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/CSSRuleList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.html;
17 |
18 | import jsinterop.annotations.JsType;
19 |
20 |
21 | /**
22 | * Native CSSRuleList
23 | * https://developer.mozilla.org/en-US/docs/Web/API/CSSRuleList
24 | *
25 | * @author Cristian Rinaldi
26 | */
27 | @JsType(isNative = true)
28 | public class CSSRuleList{
29 |
30 | public native CSSRule item(int idx);
31 |
32 | public native int length();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/CSSStyleSheet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.html;
17 |
18 | import jsinterop.annotations.JsProperty;
19 | import jsinterop.annotations.JsType;
20 |
21 |
22 | /**
23 | * Native CSSStyleSheet
24 | * https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet
25 | *
26 | * @author Cristian Rinaldi
27 | */
28 | @JsType(isNative = true)
29 | public class CSSStyleSheet extends StyleSheet{
30 |
31 | @JsProperty
32 | public native CSSRuleList getCssRules();
33 |
34 | public native void insertRule(String rulem,int index);
35 |
36 | public native void deleteRule(int index);
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/HTMLBodyElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.html;
7 |
8 | import jsinterop.annotations.JsType;
9 |
10 |
11 |
12 | /**
13 | *
14 | * @author iron
15 | */
16 | @JsType(isNative = true)
17 | public class HTMLBodyElement extends HTMLElement {
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/HTMLElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.html;
17 |
18 | import com.workingflows.js.jscore.client.api.core.Element;
19 | import com.workingflows.js.jscore.client.api.core.EventListener;
20 | import com.workingflows.js.jscore.client.api.JsObject;
21 | import jsinterop.annotations.JsMethod;
22 | import jsinterop.annotations.JsProperty;
23 | import jsinterop.annotations.JsType;
24 |
25 | /**
26 | * Native HTMLElement
27 | *
28 | * @author Cristian Rinaldi
29 | */
30 | @JsType(isNative = true)
31 | public class HTMLElement extends Element {
32 |
33 | @JsMethod
34 | public static native void setAttribute(String align, String center);
35 |
36 | @JsMethod
37 | public static native void appendChild(HTMLElement element);
38 |
39 | @JsMethod
40 | public static native void addEventListener(String event, EventListener extends JsObject> handler);
41 |
42 | @JsProperty
43 | public static native void setInnerText(String text);
44 |
45 | @JsProperty
46 | public static native String getInnerText();
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/StyleSheet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 Cristian Rinaldi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.html;
17 |
18 | import com.workingflows.js.jscore.client.api.core.Node;
19 | import jsinterop.annotations.JsProperty;
20 | import jsinterop.annotations.JsType;
21 |
22 | /**
23 | * Native StyleSheet
24 | * https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet
25 | *
26 | * @author Cristian Rinaldi
27 | */
28 | @JsType(isNative = true)
29 | public class StyleSheet {
30 |
31 | @JsProperty
32 | public native boolean getDisabled();
33 |
34 | @JsProperty
35 | public native void setDisabled(boolean disabled);
36 |
37 | @JsProperty
38 | public native Node getOwnerNode();
39 |
40 | @JsProperty
41 | public native StyleSheet getParentStyleSheet();
42 |
43 | @JsProperty
44 | public native String getTitle();
45 |
46 | @JsProperty
47 | public native String getType();
48 |
49 | @JsProperty
50 | public native String getHref();
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/html/StyleSheetList.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | package com.workingflows.js.jscore.client.api.html;
7 |
8 | import jsinterop.annotations.JsType;
9 |
10 | /**
11 | * Native StyleSheetList
12 | * https://developer.mozilla.org/en-US/docs/Web/API/StyleSheetList
13 | *
14 | * @author Cristian Rinaldi
15 | */
16 | @JsType(isNative = true)
17 | public class StyleSheetList {
18 |
19 | public native StyleSheet item(int idx);
20 |
21 | public native int length();
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 | @jsinterop.annotations.JsPackage(namespace = jsinterop.annotations.JsPackage.GLOBAL)
7 | package com.workingflows.js.jscore.client.api;
8 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/polymer/Polymer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this license header, choose License Headers in Project Properties.
3 | * To change this template file, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | package com.workingflows.js.jscore.client.api.polymer;
8 |
9 | import com.workingflows.js.jscore.client.api.core.Element;
10 | import jsinterop.annotations.JsType;
11 |
12 | /**
13 | * Documentación de {@link $name}
14 | *
15 | * //TODO
16 | *
17 | * @author Cristian Rinaldi - csrinaldi@gmail.com
18 | */
19 | @JsType(isNative = true)
20 | public class Polymer {
21 |
22 | public native Element dom(Element e);
23 |
24 | public static class Static {
25 | public static native Polymer get() /*-{
26 | return $wnd.Polymer
27 | }-*/;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/Promise.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.promise;
17 |
18 | import jsinterop.annotations.JsMethod;
19 | import jsinterop.annotations.JsType;
20 |
21 |
22 |
23 | /**
24 | * Represent a Native Promise Object.
25 | *
26 | *
27 | * @author Cristian Rinaldi
28 | * csrinaldi@gmail.com
29 | */
30 | @JsType(isNative = true)
31 | public class Promise {
32 |
33 | public Promise(PromiseFn fn) {}
34 |
35 | public Promise() {}
36 |
37 | public native Promise then(PromiseThen f);
38 |
39 | public native Promise then(PromiseThen f, PromiseThen error);
40 |
41 | @JsMethod(name = "catch")
42 | public native Promise catchException(PromiseThen error);
43 |
44 | public static native Promise resolve(Object obj);
45 |
46 | public static native Promise reject(Object obj);
47 |
48 | public static native Promise all(Object... objs);
49 |
50 | public static native Promise race(Object... iterable);
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/PromiseFn.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.promise;
17 |
18 | import jsinterop.annotations.JsFunction;
19 |
20 | /**
21 | *
22 | *
23 | * @author Cristian Rinaldi
24 | * csrinaldi@gmail.com
25 | */
26 | @FunctionalInterface
27 | @JsFunction
28 | public interface PromiseFn {
29 |
30 | void call(ResolveFn resolve, RejectedFn rejected);
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/PromiseThen.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.workingflows.js.jscore.client.api.promise;
17 |
18 | import jsinterop.annotations.JsFunction;
19 |
20 | /**
21 | *
22 | *
23 | * @author Cristian Rinaldi
24 | * csrinaldi@gmail.com
25 | */
26 | @FunctionalInterface
27 | @JsFunction
28 | public interface PromiseThen {
29 | Promise call(Object obj);
30 | }
31 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/RejectedFn.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.workingflows.js.jscore.client.api.promise;
18 |
19 | import jsinterop.annotations.JsFunction;
20 |
21 | /**
22 | *
23 | *
24 | * @author Cristian Rinaldi
25 | * csrinaldi@gmail.com
26 | */
27 | @FunctionalInterface
28 | @JsFunction
29 | public interface RejectedFn {
30 | void rejected(Object objs);
31 | }
32 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/ResolveFn.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Cristian Rinaldi & Andres Testi.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | package com.workingflows.js.jscore.client.api.promise;
19 |
20 | import jsinterop.annotations.JsFunction;
21 |
22 | /**
23 | *
24 | *
25 | * @author Cristian Rinaldi
26 | * csrinaldi@gmail.com
27 | */
28 | @FunctionalInterface
29 | @JsFunction
30 | public interface ResolveFn {
31 | void resolve(Object objs);
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/workingflows/js/jscore/client/api/promise/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | *
4 | * @author Cristian Rinaldi
5 | * csrinaldi@gmail.com
6 | */
7 | @jsinterop.annotations.JsPackage(namespace = jsinterop.annotations.JsPackage.GLOBAL)
8 | package com.workingflows.js.jscore.client.api.promise;
9 |
--------------------------------------------------------------------------------