-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
1,798 additions
and
1,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
whirl-app/whirl-app-client/src/main/java/org/whirlplatform/app/client/AppEntryPoint.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../whirl-app-client/src/main/java/org/whirlplatform/component/client/base/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.base; | ||
|
||
import jsinterop.annotations.JsPackage; |
4 changes: 4 additions & 0 deletions
4
...whirl-app-client/src/main/java/org/whirlplatform/component/client/check/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.check; | ||
|
||
import jsinterop.annotations.JsPackage; |
4 changes: 4 additions & 0 deletions
4
...whirl-app-client/src/main/java/org/whirlplatform/component/client/combo/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.combo; | ||
|
||
import jsinterop.annotations.JsPackage; |
4 changes: 4 additions & 0 deletions
4
.../whirl-app-client/src/main/java/org/whirlplatform/component/client/date/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.date; | ||
|
||
import jsinterop.annotations.JsPackage; |
116 changes: 48 additions & 68 deletions
116
...-app-client/src/main/java/org/whirlplatform/component/client/event/JavaScriptContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,60 @@ | ||
package org.whirlplatform.component.client.event; | ||
|
||
import com.google.gwt.core.client.JavaScriptObject; | ||
import org.timepedia.exporter.client.ExporterUtil; | ||
import jsinterop.annotations.JsIgnore; | ||
import jsinterop.annotations.JsType; | ||
import org.whirlplatform.component.client.ComponentBuilder; | ||
import org.whirlplatform.meta.shared.JavaScriptEventResult; | ||
import org.whirlplatform.meta.shared.data.DataValue; | ||
|
||
import java.util.List; | ||
|
||
@JsType(name = "Context") | ||
public class JavaScriptContext { | ||
private ComponentBuilder source; | ||
private List<DataValue> parameters; | ||
|
||
public JavaScriptContext() { | ||
} | ||
private ComponentBuilder source; | ||
private List<DataValue> parameters; | ||
|
||
@JsIgnore | ||
public JavaScriptContext() { | ||
} | ||
|
||
@JsIgnore | ||
public JavaScriptContext(ComponentBuilder source, List<DataValue> parameters) { | ||
this.source = source; | ||
this.parameters = parameters; | ||
} | ||
|
||
@JsIgnore | ||
public ComponentBuilder getSource() { | ||
return source; | ||
} | ||
|
||
@JsIgnore | ||
public DataValue[] getParameters() { | ||
return parameters.toArray(new DataValue[0]); | ||
} | ||
|
||
@JsIgnore | ||
public DataValue getParameter(int index) { | ||
return parameters.get(index); | ||
} | ||
|
||
@JsIgnore | ||
public DataValue getParameter(String code) { | ||
if (code == null) { | ||
return null; | ||
} | ||
for (DataValue v : parameters) { | ||
if (code.equals(v.getCode())) { | ||
return v; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@JsIgnore | ||
public JavaScriptEventResult newResult() { | ||
return new JavaScriptEventResult(); | ||
} | ||
|
||
public JavaScriptContext(ComponentBuilder source, List<DataValue> parameters) { | ||
this.source = source; | ||
this.parameters = parameters; | ||
} | ||
|
||
public ComponentBuilder getSource() { | ||
return source; | ||
} | ||
|
||
public DataValue[] getParameters() { | ||
return parameters.toArray(new DataValue[0]); | ||
} | ||
|
||
public DataValue getParameter(int index) { | ||
return parameters.get(index); | ||
} | ||
|
||
public DataValue getParameter(String code) { | ||
if (code == null) { | ||
return null; | ||
} | ||
for (DataValue v : parameters) { | ||
if (code.equals(v.getCode())) { | ||
return v; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public JavaScriptEventResult newResult() { | ||
return new JavaScriptEventResult(); | ||
} | ||
|
||
// @SuppressWarnings("unchecked") | ||
// public static JavaScriptContext init(String context) { | ||
// Map<String, Object> root = XJSONConverter.decodeSimple(context); | ||
// | ||
// JavaScriptContext result = new JavaScriptContext(); | ||
// String componentId = (String) root.get("source"); | ||
// result.source = BuilderManager.findBuilder(componentId, false); | ||
// result.parameters = new ArrayList<DataValue>(); | ||
// | ||
// for (Map<String, String> item : (List<Map<String, String>>) root | ||
// .get("parameters")) { | ||
// DataType type = DataType.valueOf(item.get("type")); | ||
// DataValue value = new DataValue(type); | ||
// value.setCode(item.get("code")); | ||
// value.setValue(DataValue.convertValueFromString(item.get("value"), | ||
// item.get("listTitle"), type)); | ||
// result.parameters.add(value); | ||
// } | ||
// | ||
// return result; | ||
// } | ||
|
||
public static Object init(Object context) { | ||
return context; | ||
} | ||
|
||
public JavaScriptObject asObject() { | ||
return ExporterUtil.wrap(this); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
...whirl-app-client/src/main/java/org/whirlplatform/component/client/event/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.event; | ||
|
||
import jsinterop.annotations.JsPackage; |
4 changes: 4 additions & 0 deletions
4
.../whirl-app-client/src/main/java/org/whirlplatform/component/client/grid/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.grid; | ||
|
||
import jsinterop.annotations.JsPackage; |
46 changes: 46 additions & 0 deletions
46
...app/whirl-app-client/src/main/java/org/whirlplatform/component/client/js/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.whirlplatform.component.client.js; | ||
|
||
import com.google.gwt.http.client.UrlBuilder; | ||
import com.google.gwt.user.client.Window; | ||
import com.google.gwt.user.client.Window.Location; | ||
import jsinterop.annotations.JsType; | ||
import org.whirlplatform.app.client.ClientLoginUtils; | ||
import org.whirlplatform.app.client.LocationManager; | ||
import org.whirlplatform.meta.shared.AppConstant; | ||
|
||
/** | ||
* Application level helper methods. | ||
*/ | ||
@JsType | ||
public class Application { | ||
|
||
/** | ||
* Changes opened application in the current window. | ||
* | ||
* @param appCode application code | ||
*/ | ||
public static void setCurrentApplication(String appCode) { | ||
LocationManager.get().setRole(appCode); | ||
LocationManager.get().reload(); | ||
} | ||
|
||
/** | ||
* Opens application in new browser window with the new session of current user. | ||
* | ||
* @param appCode application code | ||
*/ | ||
public static void openApplication(String appCode) { | ||
UrlBuilder url = Location.createUrlBuilder(); | ||
url.setParameter(AppConstant.NEW_SESSION, String.valueOf(true)); | ||
url.setParameter(AppConstant.APPLICATION_URL, appCode); | ||
Window.open(url.buildString(), "_blank", ""); | ||
} | ||
|
||
/** | ||
* Logout. | ||
*/ | ||
public static void logout() { | ||
ClientLoginUtils.logout(); | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
...-app/whirl-app-client/src/main/java/org/whirlplatform/component/client/js/Components.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.whirlplatform.component.client.js; | ||
|
||
import jsinterop.annotations.JsType; | ||
import org.whirlplatform.component.client.BuilderManager; | ||
import org.whirlplatform.component.client.ComponentBuilder; | ||
import org.whirlplatform.component.client.Containable; | ||
|
||
/** | ||
* This helper class contains static methods to work with application components. | ||
*/ | ||
@JsType | ||
public class Components { | ||
|
||
/** | ||
* Finds component by code. | ||
* | ||
* @param code component code | ||
* @return component | ||
*/ | ||
public static ComponentBuilder findByCode(String code) { | ||
return BuilderManager.findBuilder(code, true); | ||
} | ||
|
||
/** | ||
* Finds component by code in the particular container. | ||
* | ||
* @param container | ||
* @param code component code | ||
* @return component | ||
*/ | ||
public static ComponentBuilder findByCodeInContainer( | ||
ComponentBuilder container, String code) { | ||
if (container instanceof Containable) { | ||
return BuilderManager | ||
.findBuilder((Containable) container, code, true); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* Returns all application components currently available in application. | ||
* | ||
* @return components array | ||
*/ | ||
public static ComponentBuilder[] getAll() { | ||
return BuilderManager.getAllBuilders().toArray(new ComponentBuilder[0]); | ||
} | ||
|
||
} |
4 changes: 4 additions & 0 deletions
4
...pp/whirl-app-client/src/main/java/org/whirlplatform/component/client/js/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client.js; | ||
|
||
import jsinterop.annotations.JsPackage; |
4 changes: 4 additions & 0 deletions
4
...l-app/whirl-app-client/src/main/java/org/whirlplatform/component/client/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@JsPackage(namespace = "Whirl") | ||
package org.whirlplatform.component.client; | ||
|
||
import jsinterop.annotations.JsPackage; |
Oops, something went wrong.