[jbpm-commits] JBoss JBPM SVN: r4606 - in projects/gwt-console/trunk: plugin-api and 23 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Apr 22 10:00:16 EDT 2009
Author: heiko.braun at jboss.com
Date: 2009-04-22 10:00:15 -0400 (Wed, 22 Apr 2009)
New Revision: 4606
Added:
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java
projects/gwt-console/trunk/war/src/main/resources/mvc4g-conf.xml
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js
Removed:
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequest.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequestHandler.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/report/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/js/ext/
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/AbstractConsoleTC.java
projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
Modified:
projects/gwt-console/trunk/gwt-parent.iml
projects/gwt-console/trunk/plugin-api/plugin.iml
projects/gwt-console/trunk/plugin-api/pom.xml
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Editor.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Menu.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/plugin-example/plugin-example.iml
projects/gwt-console/trunk/plugin-example/pom.xml
projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/rpc/gwt-rpc.iml
projects/gwt-console/trunk/server/gwt-server.iml
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
projects/gwt-console/trunk/war/gwt-war.iml
projects/gwt-console/trunk/war/pom.xml
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html
projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/console.css
Log:
svn merge -r4358:HEAD https://svn.jboss.org/repos/jbpm/projects/gwt-console/branches/hbraun
Modified: projects/gwt-console/trunk/gwt-parent.iml
===================================================================
--- projects/gwt-console/trunk/gwt-parent.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/gwt-parent.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -20,9 +20,9 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="plugin" />
- <orderEntry type="module" module-name="gwt-server-integration" />
- <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="plugin" exported="" />
+ <orderEntry type="module" module-name="gwt-server-integration" exported="" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
@@ -51,15 +51,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
@@ -134,15 +125,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-mac.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
@@ -237,15 +219,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
@@ -292,6 +265,69 @@
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/plugin-api/plugin.iml
===================================================================
--- projects/gwt-console/trunk/plugin-api/plugin.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/plugin.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -20,15 +20,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
@@ -75,6 +66,51 @@
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/plugin-api/pom.xml
===================================================================
--- projects/gwt-console/trunk/plugin-api/pom.xml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/pom.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -38,17 +38,47 @@
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>com.google.code.gwt-log</groupId>
+ <artifactId>gwt-log</artifactId>
+ </dependency>
<dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ </dependency>
<dependency>
- <groupId>com.google.code.gwt-log</groupId>
- <artifactId>gwt-log</artifactId>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
</dependency>
+ <!-- 3rd party -->
+
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ </dependency>
+
+
</dependencies>
<build>
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,10 +21,11 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Viewport;
+import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.Viewport;
/**
- * Provides context information to console compoments and plugins.
+ * Provides context information to console components and plugins.
*
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
@@ -39,5 +40,9 @@
Authentication getAuthentication();
ConsoleConfig getConfig();
-
+
+ Controller getController();
+
+ Viewport getViewport();
+
}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,83 +21,74 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Panel;
+import com.mvc4g.client.Controller;
+import com.google.gwt.user.client.Window;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.jboss.bpm.console.client.LazyPanel;
-import java.util.List;
-import java.util.ArrayList;
/**
- * An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}
+ * <h2>Composition</h2>
+ * An editor can be plugged into a {@link org.jboss.bpm.console.client.Workspace}.
+ * Editors do aggregate {@link com.mvc4g.client.ViewInterface}'s and {@link com.mvc4g.client.ActionInterface}'s,
+ * which are maintained through a {@link com.mvc4g.client.Controller}.
+
+ * <h2>Event handling</h2>
+ * Views and actions communicate though a hirarchical controller chain by issuing events:<p>
+ * <code>
+ * Controller.handleEvent( new Event(...));
+ * </code>
+ * <p/>
+ * By default every editor get's it's own controller that delegates to the main {@link org.jboss.bpm.console.client.ApplicationContext}
+ * controller as it's parent.
*
+ * <h2>Layout</h2>
+ * Each Editor uses a {@link org.gwt.mosaic.ui.client.layout.BorderLayout} by default.
+ *
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public abstract class Editor extends Panel
+public abstract class Editor extends LayoutPanel implements LazyPanel
{
protected ApplicationContext appContext;
- protected List<String> managedTabs;
- public Editor(ApplicationContext applicationContext)
- {
- super();
- this.appContext = applicationContext;
- this.managedTabs = new ArrayList<String>();
- this.setPaddings(10);
- }
+ protected Controller controller;
- public abstract String getEditorId();
+ protected boolean isInitialized;
- public abstract String getTitle();
-
- public abstract String getIconCSS();
-
- public abstract MenuSection provideMenuSection();
-
- public boolean hasView(String viewId)
+ public Editor(ApplicationContext appContext)
{
- final String tabId = viewId + ".tab";
- return appContext.getWorkpace().hasItem(tabId);
+ super(new BorderLayout());
+ this.appContext = appContext;
+
+ // hmvc controller chain.
+ this.controller = new Controller();
+ this.controller.setParent(appContext.getController());
}
- public void showView(String viewId)
+ public boolean isInitialized()
{
- final String tabId = viewId + ".tab";
- appContext.getWorkpace().setActiveTab(tabId);
+ return this.isInitialized;
}
- public void addView(View view, boolean closable)
- {
- String tabId = view.getViewId() + ".tab";
+ public abstract void initialize();
+
+ public abstract String getEditorId();
- view.setId(tabId); // tabId != viewId
- view.setClosable(closable);
- view.setIconCls(view.getIconCSS());
- view.setAutoScroll(true);
+ public abstract String getTitle();
- appContext.getWorkpace().add(view);
- appContext.getWorkpace().setActiveTab(view.getId());
+ public abstract String getIconCSS();
+
+ public abstract MenuSection provideMenuSection();
- managedTabs.add(tabId);
-
- }
-
- public void closeViews()
+ /**
+ * hack in order to correctly display widgets that have
+ * been rendered hidden
+ */
+ protected void refreshView()
{
- for(String tabId : managedTabs)
- {
- Panel tab = appContext.getWorkpace().getItem(tabId);
- if(tab!=null)
- {
- tab.collapse();
- }
- }
+ final int width = Window.getClientWidth();
+ final int height = Window.getClientHeight();
+ appContext.getViewport().onWindowResized(width, height);
}
-
- class WrapperPanel extends Panel
- {
- public WrapperPanel(String id)
- {
- super();
- setId(id);
- }
- }
}
Copied: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java (from rev 4605, projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java)
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java (rev 0)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/LazyPanel.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public interface LazyPanel
+{
+ boolean isInitialized();
+
+ /**
+ * Expected to be an idempotent implementation
+ */
+ void initialize();
+}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Menu.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Menu.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Menu.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,11 +21,13 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.AccordionLayout;
-import java.util.ArrayList;
-import java.util.List;
+import org.gwt.mosaic.ui.client.StackLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
/**
* The main menu on the left hand.
@@ -33,29 +35,29 @@
*
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class Menu extends Panel
-{
- private final ApplicationContext mainView;
- private List<Panel> sections = new ArrayList<Panel>();
+public class Menu extends LayoutPanel implements ViewInterface
+{
+ private StackLayoutPanel stack;
+ private Controller controller;
- public Menu(final ApplicationContext view)
+ public Menu()
{
- super();
- this.mainView = view;
+ super(new BoxLayout(BoxLayout.Orientation.VERTICAL));
- final AccordionLayout accordion = new AccordionLayout(true);
+ this.setWidgetSpacing(5);
- this.setTitle("");
- this.setCollapsible(true);
- this.setWidth(200);
- this.setLayout(accordion);
+ this.stack = new StackLayoutPanel();
+ //stack.showStack(0); // todo: loading event
+ this.add(stack, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH, true));
+ }
+ public void addSection(MenuSection menuSection)
+ {
+ this.stack.add(menuSection, menuSection.getMenuTitle());
}
- public void addSection(MenuSection menuSection)
+ public void setController(Controller controller)
{
- this.sections.add(menuSection);
- this.add(menuSection);
+ this.controller = controller;
}
-
}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/MenuSection.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,27 +21,34 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Component;
+import com.google.gwt.user.client.ui.Tree;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+
/**
* One section in the lefthand main menu.
*
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class MenuSection extends Panel
+public class MenuSection extends LayoutPanel
{
- public MenuSection(String title, String iconClass, Component tree)
+ private String menuTitle;
+ private String iconClass;
+
+ public MenuSection(String title, String iconClass, Tree tree)
{
- super();
+ super();
- setTitle(title);
- setBorder(false);
- setHideBorders(true);
- setIconCls(iconClass);
+ this.menuTitle = title;
+ this.iconClass = iconClass;
if (tree != null)
add(tree);
}
+
+ public String getMenuTitle()
+ {
+ return menuTitle;
+ }
}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/URLBuilder.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -86,7 +86,7 @@
public String getStateChangeURL(String instanceId, ProcessInstanceRef.STATE state)
{
- return getConsoleServerUrl() + "/rs/process/instances/" + adoptExecutionId(instanceId) + "/state/" + state;
+ return getConsoleServerUrl() + "/rs/process/instances/" + instanceId + "/state/" + state;
}
public String getStartNewInstanceURL(String processId)
@@ -132,21 +132,15 @@
public String getExecutionSignalUrl(TokenReference tok)
{
- return getConsoleServerUrl() + "/rs/process/tokens/" + adoptExecutionId(tok.getId()) + "/transition/default";
+ return getConsoleServerUrl() + "/rs/process/tokens/" + tok.getId() + "/transition/default";
}
public String getExecutionSignalUrl(TokenReference tok, String signal)
{
String encodedSignal = URL.encode(signal);
- return getConsoleServerUrl() + "/rs/process/tokens/" + adoptExecutionId(tok.getId()) + "/transition?signal=" + encodedSignal;
+ return getConsoleServerUrl() + "/rs/process/tokens/" + tok.getId() + "/transition?signal=" + encodedSignal;
}
- private String adoptExecutionId(String actual)
- {
- // TDOD: https://jira.jboss.org/jira/browse/JBPM-2054
- return actual.replace("/", "_");
- }
-
public String getAvailableActorsUrl(String actorId)
{
return getConsoleServerUrl() + "/rs/identity/user/" + actorId + "/actors";
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.gwtext.client.widgets.Panel;
-
-/**
- * View's are {@link org.jboss.bpm.console.client.Editor} components
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public abstract class View extends Panel
-{
-
- protected ApplicationContext mainMenu;
-
- protected View(ApplicationContext main)
- {
- super();
- this.mainMenu = main;
- this.setPaddings(10);
- }
-
- public abstract String getViewId();
-
- public abstract String getIconCSS();
-}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,90 +21,86 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.TabPanel;
+import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
/**
- * Maintains {@link org.jboss.bpm.console.client.Workspace}'s
+ * Maintains {@link Editor}'s
*
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class Workspace extends TabPanel
+public class Workspace extends DeckLayoutPanel
{
- protected ApplicationContext view;
+ protected ApplicationContext appContext;
private Menu menu;
-
+
public Workspace(Menu menu)
{
super();
this.menu = menu;
+ this.setPadding(5);
- this.setResizeTabs(true);
- this.setMinTabWidth(115);
- this.setTabWidth(135);
- this.setEnableTabScroll(true);
- this.setAutoScroll(true);
- this.setActiveTab(0);
}
- private Panel createTab(Editor editor, boolean closeable)
- {
- Panel tab = new WrapperPanel(editor.getId() + ".tab");
- tab.setTitle(editor.getTitle());
- tab.setIconCls(editor.getIconCSS());
- tab.setClosable(closeable);
- tab.setAutoScroll(true);
- tab.setBorder(false);
- tab.setFrame(false);
- tab.setHideBorders(true);
- return tab;
- }
-
public void addEditor(Editor editor, boolean closeable)
{
// Menu
menu.addSection(editor.provideMenuSection());
- // Editor pane
- Panel tab = createTab(editor, closeable);
- tab.add(editor);
- this.add(tab);
- this.setActiveTab(tab.getId());
- this.doLayout();
+ // Editor deck
+ EditorDeck deck = createDeck(editor);
+ deck.index = this.getWidgetCount();
+ this.add(deck);
}
public boolean hasEditor(String id)
{
- boolean b = false;
- final String tabId = id + ".tab";
+ return findEditor(id)!=null;
+ }
- Component[] tabs = this.getItems();
- for (int i = 0; i < tabs.length; i++)
+ public void showEditor(String id)
+ {
+ EditorDeck deck = findEditor(id);
+ if(null==deck)
+ throw new IllegalArgumentException("No such editor: " +id);
+ this.showWidget(deck.index);
+
+ deck.editor.initialize();
+ }
+
+ private EditorDeck createDeck(Editor editor)
+ {
+ EditorDeck deck = new EditorDeck(editor);
+ deck.add(editor);
+ return deck;
+ }
+
+ private EditorDeck findEditor(String id)
+ {
+ EditorDeck match = null;
+ for(int i=0; i<this.getWidgetCount(); i++)
{
- Component tab = tabs[i];
- if (tab.getId().equals(tabId))
+ EditorDeck deck = (EditorDeck) this.getWidget(i);
+ if(id.equals( deck.editor.getEditorId()))
{
- b = true;
+ match = deck;
break;
}
}
- return b;
+ return match;
}
- public void showEditor(String id)
+ private class EditorDeck extends LayoutPanel
{
- final String tabId = id + ".tab";
- this.setActiveTab(tabId);
- }
+ Editor editor;
+ int index;
- class WrapperPanel extends Panel
- {
- public WrapperPanel(String id)
+ public EditorDeck(Editor editor)
{
super();
- setId(id);
+ this.editor = editor;
}
+
}
}
Modified: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -22,14 +22,13 @@
package org.jboss.bpm.console.client.model;
import com.google.gwt.json.client.*;
+import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
import org.jboss.bpm.console.client.util.ConsoleLog;
-import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
import org.jboss.bpm.console.client.util.JSONWalk;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.Map;
/**
* TODO: run integrated (gwt-console-server) test
@@ -38,9 +37,20 @@
*/
public class DTOParser
{
- public static ProcessDefinitionRef parseProcessDefinition(String json)
+ public static List<ProcessDefinitionRef> parseProcessDefinitions(JSONValue jso)
{
- JSONValue root = JSONParser.parse(json);
+ List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
+
+ JSONArray arr = JSONWalk.on(jso).next("definitions").asArray();
+ for(int i=0; i<arr.size(); i++)
+ {
+ results.add(parseProcessDefinition(arr.get(i)));
+ }
+ return results;
+ }
+
+ public static ProcessDefinitionRef parseProcessDefinition(JSONValue root)
+ {
String id = JSONWalk.on(root).next("id").asString();
Long version = JSONWalk.on(root).next("version").asLong();
String name = JSONWalk.on(root).next("name").asString();
@@ -48,6 +58,12 @@
return new ProcessDefinitionRef(id, name, version);
}
+ public static ProcessDefinitionRef parseProcessDefinition(String json)
+ {
+ JSONValue root = JSONParser.parse(json);
+ return parseProcessDefinition(root);
+ }
+
public static List<String> parseRolesAssigned(String json)
{
// parse roles
@@ -161,8 +177,20 @@
return p;
}
- public static ProcessInstanceRef parseProcessInstance(JSONObject root)
+ public static List<ProcessInstanceRef> parseProcessInstances(JSONValue jso)
{
+ List<ProcessInstanceRef> results = new ArrayList<ProcessInstanceRef>();
+
+ JSONArray arr = JSONWalk.on(jso).next("instances").asArray();
+ for(int i=0; i<arr.size(); i++)
+ {
+ results.add(parseProcessInstance(arr.get(i)));
+ }
+ return results;
+ }
+
+ public static ProcessInstanceRef parseProcessInstance(JSONValue root)
+ {
ConsoleLog.debug("parse " + root);
// {"id":"StateSequence/8", "definitionId":"StateSequence:1",
@@ -251,4 +279,5 @@
return result;
}
+
}
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.widgets.grid.Renderer;
-import com.gwtext.client.widgets.grid.CellMetadata;
-import com.gwtext.client.data.Store;
-import com.gwtext.client.data.Record;
-
-import java.util.Date;
-
-import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
-
-/**
- * Renders a Date according to {@link org.jboss.bpm.console.client.model.util.SimpleDateFormat#DEFAULT_FORMAT}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class DateRenderer implements Renderer
-{
- private String fieldName;
-
- public DateRenderer(String fieldName)
- {
- this.fieldName = fieldName;
- }
-
- /**
- * Returns an empty string (field is null) or a formatted date (field is set).
- */
- public String render(Object value, CellMetadata cellMetadata, Record record,
- int rowIndex, int colNum, Store store)
- {
- String s = "";
- SimpleDateFormat df = new SimpleDateFormat();
- Date d = record.getAsDate(fieldName);
- if (d != null)
- s = df.format(d);
-
- return s;
- }
-}
\ No newline at end of file
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequest.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequest.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequest.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-/**
- * Request helper, to bypass SOP restrictions.<br>
- * Can only be used to retrieve Json data, wrapped in a script tag.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class JSONRequest
-{
- public static void get(String url, JSONRequestHandler handler)
- {
- String callbackName = "JSONCallback" + handler.hashCode();
- get(url + "?callback=" + callbackName, callbackName, handler);
- }
-
- public static void get(String url, String callbackName, JSONRequestHandler handler)
- {
- createCallbackFunction(handler, callbackName);
- addScript(url);
- }
-
- public static native void addScript(String url) /*-{
- var scr = document.createElement("script");
- scr.setAttribute("language", "JavaScript");
- scr.setAttribute("src", url);
- document.getElementsByTagName("body")[0].appendChild(scr);
- }-*/;
-
- private native static void createCallbackFunction(JSONRequestHandler obj, String callbackName)/*-{
- tmpcallback = function(j) {
- obj. at org.jboss.bpm.console.client.util.JSONRequestHandler::onRequestComplete(Lcom/google/gwt/core/client/JavaScriptObject;)(j);
- };
- eval( "window." + callbackName + "=tmpcallback" );
- }-*/;
-}
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequestHandler.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequestHandler.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/JSONRequestHandler.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.google.gwt.core.client.JavaScriptObject;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface JSONRequestHandler
-{
- void onRequestComplete(JavaScriptObject json);
-}
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.data.Record;
-
-/**
- * Get's notified when model change events are fire on {@link ModelListenerRegistry}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface ModelChangeListener
-{
- void onModelChange(ModelListenerRegistry parent, Object changeEvent);
-
- void onRecordChange(ModelListenerRegistry parent, Record record);
-
- void onReset();
-}
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.data.Record;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Utility to propagate model change events to {@link ModelChangeListener}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ModelListenerRegistry
-{
- private List<ModelChangeListener> listeners = new ArrayList<ModelChangeListener>();
-
- public void addListener(ModelChangeListener listener)
- {
- this.listeners.add(listener);
- }
-
- public void fireRecordChangeEvent(Record record)
- {
- for (ModelChangeListener l : listeners)
- {
- l.onRecordChange(this, record);
- }
- }
-
- public void fireModelChangeEvent(Object event)
- {
- for (ModelChangeListener l : listeners)
- {
- l.onModelChange(this, event);
- }
- }
-
- public void fireResetEvent()
- {
- for (ModelChangeListener l : listeners)
- {
- l.onReset();
- }
- }
-}
Deleted: projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java
===================================================================
--- projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface ModelModificationCallback
-{
- void onStaleModel();
-}
Modified: projects/gwt-console/trunk/plugin-example/plugin-example.iml
===================================================================
--- projects/gwt-console/trunk/plugin-example/plugin-example.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-example/plugin-example.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -9,73 +9,109 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="plugin" />
- <orderEntry type="module" module-name="gwt-rpc" />
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
+ <orderEntry type="module" module-name="toplevel" />
+ <orderEntry type="module" module-name="plugin-api" />
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:provided">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.code.gson:gson:jar:1.2.2:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gson/gson/1.2.2/gson-1.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
<library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1:compile">
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/plugin-example/pom.xml
===================================================================
--- projects/gwt-console/trunk/plugin-example/pom.xml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-example/pom.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -17,7 +17,7 @@
<properties>
<gwt-console.version>1.0.0-SNAPSHOT</gwt-console.version>
- <gwt-ext.version>2.0.5</gwt-ext.version>
+ <gwt-mosaic.version>0.1.9</gwt-mosaic.version>
</properties>
<!-- Dependencies -->
@@ -32,16 +32,30 @@
<dependency>
<groupId>com.google.gwt</groupId>
- <artifactId>gwt-user</artifactId>
+ <artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- <version>${gwt-ext.version}</version>
- <scope>provided</scope>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ <version>${gwt-mosaic.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.bpm</groupId>
Modified: projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
===================================================================
--- projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,11 +21,13 @@
*/
package org.jboss.bpm.console.client.mapsplugin;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.DOM;
+import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.View;
-import com.google.gwt.user.client.ui.Frame;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
/**
* An example editor that embeds google maps into the console
@@ -33,39 +35,30 @@
*/
public class MapsEditor extends Editor
{
- public final static String ID = "org.jboss.bpm.console.plugin.MapsEditor";
+ public final static String ID = MapsEditor.class.getName();
public MapsEditor(ApplicationContext appContext)
{
super(appContext);
+ }
- // an example view component added to the editor
- final View defaultView = new View(appContext) {
- public String getViewId()
- {
- return ID+".defaultView";
- }
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ // keep it simple, just use an iframe
+ Frame frame = new Frame();
+ frame.setWidth("660");
+ frame.setHeight("448");
+ frame.setUrl("http://maps.google.com");
- public String getIconCSS()
- {
- return "";
- }
- };
-
- // keep it simple, just use an iframe
- Frame frame = new Frame();
- frame.setWidth("660");
- frame.setHeight("448");
- frame.setUrl("http://maps.google.com");
-
- // assemble the view
- defaultView.add(frame);
- defaultView.setPaddings(10,0,0,0);
- defaultView.setTitle("Maps");
-
- // add it to the editor
- addView(defaultView, false);
+ //DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ this.add(frame);
+
+ isInitialized = true;
+ }
}
public String getEditorId()
Modified: projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java
===================================================================
--- projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsNavigationTree.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,45 +21,48 @@
*/
package org.jboss.bpm.console.client.mapsplugin;
-import com.gwtext.client.widgets.tree.TreePanel;
-import com.gwtext.client.widgets.tree.TreeNode;
-import com.gwtext.client.widgets.tree.event.TreeNodeListenerAdapter;
-import com.gwtext.client.data.Node;
-import com.gwtext.client.core.EventObject;
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
-class MapsNavigationTree extends TreePanel
+class MapsNavigationTree extends Tree
{
+
+ public MapsNavigationTree()
+ {
+ super();
+ }
+
public MapsNavigationTree(final ApplicationContext appContext)
{
- TreeNode root = new TreeNode("Google Maps");
+ TreeItem root = new TreeItem("Maps plugin menu");
- TreeNode navEntry = new TreeNode("Open maps");
- navEntry.setExpanded(true);
- navEntry.addListener(
- new TreeNodeListenerAdapter()
+ TreeItem navEntry = new TreeItem("Open maps");
+ root.addItem(navEntry);
+
+ addTreeListener(
+ new TreeListener()
{
- public void onClick(Node node, EventObject eventObject)
+ public void onTreeItemSelected(TreeItem treeItem)
{
- if (appContext.getWorkpace().hasEditor(MapsEditor.ID))
+ if("Open maps".equals(treeItem.getText()))
{
- appContext.getWorkpace().showEditor(MapsEditor.ID);
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(MapsEditor.ID);
}
- else
- {
- appContext.getWorkpace().addEditor(new MapsEditor(appContext), false);
- }
+ }
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
}
}
);
- root.appendChild(navEntry);
-
- setRootVisible(true);
- setRootNode(root);
- root.setExpanded(true);
+ addItem(root);
}
}
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/pom.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -19,9 +19,12 @@
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.3.2</commons.io.version>
<commons.logging.version>1.1.1</commons.logging.version>
+ <commons-lang.version>2.4</commons-lang.version>
+ <commons-config.version>1.6</commons-config.version>
<gson.version>1.2.2</gson.version>
- <gwt.version>1.5.2</gwt.version>
- <gwtext.version>2.0.5</gwtext.version>
+ <gwt.version>1.5.3</gwt.version>
+
+ <gwt-mosaic.version>0.1.9</gwt-mosaic.version>
<gwt-log.version>2.5.2</gwt-log.version>
<jaf.version>1.1</jaf.version>
<javax.ejb.version>3.0</javax.ejb.version>
@@ -29,6 +32,7 @@
<jboss.common.version>2.2.7.GA</jboss.common.version>
<jbpm.version>3.3.1.GA</jbpm.version>
<junit.version>3.8.1</junit.version>
+ <mvc4g.version>1.0.0-jboss</mvc4g.version>
<resteasy.version>1.0.2.GA</resteasy.version>
<stax-api.version>1.0-2</stax-api.version>
</properties>
@@ -45,8 +49,20 @@
<dependencyManagement>
<dependencies>
- <!-- GET related -->
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>${commons-lang.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>${commons-config.version}</version>
+ </dependency>
+
+ <!-- GWT related -->
+ <dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwt.version}</version>
@@ -58,11 +74,6 @@
</dependency>
<dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- <version>${gwtext.version}</version>
- </dependency>
- <dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gchart</artifactId>
<version>${gchart.version}</version>
@@ -78,6 +89,33 @@
<version>${gwt-log.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ <version>${gwt-mosaic.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
+ <version>${mvc4g.version}</version>
+ </dependency>
+
<!-- Other -->
<dependency>
<groupId>commons-logging</groupId>
Modified: projects/gwt-console/trunk/rpc/gwt-rpc.iml
===================================================================
--- projects/gwt-console/trunk/rpc/gwt-rpc.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/rpc/gwt-rpc.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -27,15 +27,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
@@ -55,6 +46,15 @@
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/server/gwt-server.iml
===================================================================
--- projects/gwt-console/trunk/server/gwt-server.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/server/gwt-server.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -10,8 +10,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="gwt-rpc" exported="" />
- <orderEntry type="module" module-name="gwt-server-integration" exported="" />
+ <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="gwt-server-integration" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: org.slf4j:slf4j-simple:jar:1.5.2:compile">
<CLASSES>
@@ -22,15 +22,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss:jboss-common-core:jar:2.2.7.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/jboss-common-core/2.2.7.GA/jboss-common-core-2.2.7.GA.jar!/" />
@@ -49,15 +40,6 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library" exported="">
<library name="M2 Dep: org.jboss.logging:jboss-logging-spi:jar:2.0.5.GA:provided">
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/org/jboss/logging/jboss-logging-spi/2.0.5.GA/jboss-logging-spi-2.0.5.GA.jar!/" />
@@ -243,6 +225,24 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/ProcessMgmtFacade.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -134,11 +134,9 @@
@PathParam("next")
String next)
{
- String actualExecutionId = adoptExecutionId(executionId);
- log.debug("Change instance (ID "+actualExecutionId+") to state " +next);
-
- //ProcessInstanceRef.STATE state = ProcessInstanceRef.STATE.valueOf(next);
- getProcessManagement().setProcessState(actualExecutionId, ProcessInstanceRef.STATE.ENDED);
+ ProcessInstanceRef.STATE state = ProcessInstanceRef.STATE.valueOf(next);
+ log.debug("Change instance (ID "+executionId+") to state " +state);
+ getProcessManagement().setProcessState(executionId, state);
return Response.ok().type("application/json").build();
}
@@ -156,7 +154,7 @@
if ("default transition".equals(signalName))
signalName = null;
- getProcessManagement().signalExecution(adoptExecutionId(id), signalName);
+ getProcessManagement().signalExecution(id, signalName);
return Response.ok().type("application/json").build();
}
@@ -169,16 +167,10 @@
{
log.debug("Signal token " + id);
- getProcessManagement().signalExecution(adoptExecutionId(id), null);
+ getProcessManagement().signalExecution(id, null);
return Response.ok().type("application/json").build();
}
- private String adoptExecutionId(String modified)
- {
- // TODO: https://jira.jboss.org/jira/browse/JBPM-2054
- return modified.replace("_", "/");
- }
-
@POST
@Path("definitions/new")
@Produces("application/json")
Modified: projects/gwt-console/trunk/war/gwt-war.iml
===================================================================
--- projects/gwt-console/trunk/war/gwt-war.iml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/gwt-war.iml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -11,8 +11,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="plugin" exported="" />
- <orderEntry type="module" module-name="gwt-rpc" exported="" />
+ <orderEntry type="module" module-name="gwt-rpc" />
+ <orderEntry type="module" module-name="plugin" />
<orderEntry type="module-library" exported="">
<library name="M2 Dep: javax.xml.bind:jaxb-api:jar:2.1:compile">
<CLASSES>
@@ -41,70 +41,106 @@
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.2:provided">
+ <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.2/gwt-dev-1.5.2-mac.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.2:provided">
+ <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.2/gwt-user-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
+ <SOURCES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
+ </SOURCES>
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ </CLASSES>
+ <JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.2:runtime">
+ <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.2/gwt-servlet-1.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.xml.stream:stax-api:jar:1.0-2:provided">
+ <library name="M2 Dep: com.google.gwt:gwt-dev:jar:mac:1.5.3:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-dev/1.5.3/gwt-dev-1.5.3-mac.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: javax.activation:activation:jar:1.1:provided">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-dnd:jar:0.1.9:compile">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-dnd/0.1.9/gwt-mosaic-dnd-0.1.9.jar!/" />
</CLASSES>
<JAVADOC />
- <SOURCES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/javax/activation/activation/1.1/activation-1.1-sources.jar!/" />
- </SOURCES>
+ <SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.google.code.gwt-log:gwt-log:jar:2.5.2:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-servlet:jar:1.5.3:runtime">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/code/gwt-log/gwt-log/2.5.2/gwt-log-2.5.2.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-servlet/1.5.3/gwt-servlet-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
- <library name="M2 Dep: com.gwtext:gwtext:jar:2.0.5:compile">
+ <library name="M2 Dep: com.google.gwt:gwt-user:jar:1.5.3:provided">
<CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar!/" />
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/google/gwt/gwt-user/1.5.3/gwt-user-1.5.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-incubator:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-incubator/0.1.9/gwt-mosaic-incubator-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic/0.1.9/gwt-mosaic-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library" exported="">
+ <library name="M2 Dep: com.googlecode.gwtmosaic:gwt-mosaic-gwtx:jar:0.1.9:compile">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../.m2/repository/com/googlecode/gwtmosaic/gwt-mosaic-gwtx/0.1.9/gwt-mosaic-gwtx-0.1.9.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/war/pom.xml
===================================================================
--- projects/gwt-console/trunk/war/pom.xml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/pom.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -72,17 +72,46 @@
<!-- GWT extensions -->
<dependency>
- <groupId>com.gwtext</groupId>
- <artifactId>gwtext</artifactId>
- </dependency>
- <dependency>
<groupId>com.google.code.gwt-log</groupId>
<artifactId>gwt-log</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-dnd</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-incubator</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.googlecode.gwtmosaic</groupId>
+ <artifactId>gwt-mosaic-gwtx</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.googlecode.mvc4g</groupId>
+ <artifactId>mvc4g</artifactId>
+
+ </dependency>
+
<!-- 3rd party -->
<dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
<scope>provided</scope>
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Application.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,168 +0,0 @@
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.Response;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.layout.VerticalLayout;
-import com.gwtext.client.widgets.layout.BorderLayout;
-import com.gwtext.client.widgets.layout.BorderLayoutData;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.core.RegionPosition;
-import org.jboss.bpm.console.client.util.ConsoleLog;
-
-/**
- * Entry point classes define <code>onModuleLoad()</code>.
- * Does the authentication and reads the comfiguration before launching
- * the {@link org.jboss.bpm.console.client.MainView}
- */
-public class Application implements EntryPoint
-{
- private ApplicationContext mainView;
- private Authentication auth;
- private ConsoleConfig config;
- private URLBuilder urlBuilder;
-
- public final static String[] KNOWN_ROLES = {"admin", "manager", "user"};
-
- /**
- * Note, we defer all application initialization code to
- * {@link #onModuleLoad2()} so that the UncaughtExceptionHandler
- * can catch any unexpected exceptions.
- */
- public void onModuleLoad()
- {
-
- ConsoleLog.setEnabled(true);
-
- /* Install an UncaughtExceptionHandler which will
- * produce <code>FATAL</code> log messages
- */
- ConsoleLog.setUncaughtExceptionHandler();
-
- /* Use a deferred command so that the UncaughtExceptionHandler
- * catches any exceptions in onModuleLoad2()
- */
- DeferredCommand.addCommand(new Command()
- {
- public void execute()
- {
- onModuleLoad2();
- }
- });
- }
-
- /**
- * This is the entry point method.
- */
- public void onModuleLoad2()
- {
- config = new ConsoleConfig();
-
- // setup
-
- if (!GWT.isScript())
- {
- String proxyUrl = GWT.getModuleBaseURL() + "xhp";
- config.setConsoleServerUrl(proxyUrl);
- }
-
- ConsoleLog.debug("Console server: " + config.getConsoleServerUrl());
- ConsoleLog.debug("Report server: " + config.getReportServerUrl());
-
- urlBuilder = new URLBuilder(config);
-
- // authentiction
- forceLogin();
- }
-
- public ApplicationContext getConsoleView()
- {
- return mainView;
- }
-
- private void forceLogin()
- {
- Panel panel = new Panel();
- panel.setPaddings(20);
- panel.setStyleName("login-panel-content");
- panel.setLayout(new VerticalLayout(10));
- panel.add(new HTML("Welcome, please login."));
-
- final Window window = new Window();
- window.setTitle("GWT-Console");
- window.setClosable(false);
- window.setResizable(false);
- window.setWidth(300);
- window.setHeight(180);
- window.setLayout(new BorderLayout());
- window.setCloseAction(Window.CLOSE);
-
- final FormPanel loginForm = new FormPanel();
- loginForm.setBorder(false);
- loginForm.add(new TextField("Username", "user"));
- TextField passwordField = new TextField("Password", "pass");
- passwordField.setPassword(true);
- loginForm.add(passwordField);
-
- final Button submitBtn = new Button("Login",
- new ButtonListenerAdapter()
- {
- public void onClick(Button button, EventObject e)
- {
- String user = loginForm.getForm().findField("user").getValueAsString();
- String pass = loginForm.getForm().findField("pass").getValueAsString();
-
- String url = urlBuilder.getUserInRoleURL(KNOWN_ROLES);
- auth = new Authentication(url);
- auth.setCallback(
- new Authentication.AuthCallback()
- {
-
- public void onLoginSuccess(Request request, Response response)
- {
- // clear the form
- loginForm.getForm().reset();
-
- // display main console
- window.close();
-
- // assemble main view
- mainView = new MainView(auth, urlBuilder, config);
- }
-
- public void onLoginFailed(Request request, Throwable t)
- {
- // auth failed
- ConsoleLog.error("Authentication failed.", t);
- }
- }
- );
-
- auth.doLogin(user, pass);
-
- }
- });
-
- loginForm.addButton(submitBtn);
- panel.add(loginForm);
-
- BorderLayoutData centerData = new BorderLayoutData(RegionPosition.CENTER);
- centerData.setMargins(3, 0, 3, 3);
-
- window.add(panel, centerData);
- // ------------------------------------------
-
- window.show();
- }
-
-}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/Header.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -21,70 +21,93 @@
*/
package org.jboss.bpm.console.client;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.layout.*;
-import com.gwtext.client.core.EventObject;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.Timer;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
import java.util.List;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class Header extends Panel
+public class Header extends HorizontalPanel implements ViewInterface
{
- private ApplicationContext view;
+ public final static String ID = Header.class.getName();
- public final static String ID = "org.jboss.bpm.headerPanel";
+ private ApplicationContext appContext;
+ private Controller controller;
+ private Image loadingImage;
- public Header(ApplicationContext view)
+ // avoid flickering image
+ final Timer turnOffLoading = new Timer() {
+ public void run() {
+ loadingImage.setVisible(false);
+ }
+ };
+
+ public Header(ApplicationContext appContext, String username, List<String> roles)
{
super();
- this.view = view;
- this.setId(ID);
+ this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
+ this.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
+ this.setStyleName("bpm-header");
- this.setFrame(false);
- this.setBorder(false);
- this.setHeader(false);
+ this.appContext = appContext;
- //HorizontalLayout layout = new HorizontalLayout(20);
- //this.setLayout(layout);
-
- this.setHeight(50);
- this.setBaseCls("bpm-header");
+ createInfoPanel();
}
- public void setUserInfo(String username, List<String> roles)
+ private void createInfoPanel()
{
- Panel userInfo = new Panel();
- userInfo.setBorder(false);
- userInfo.setHeader(false);
- userInfo.setFrame(false);
- userInfo.setStyleName("bpm-header-userinfo");
- HorizontalLayout layout = new HorizontalLayout(10);
- userInfo.setLayout(layout);
+ HorizontalPanel p = new HorizontalPanel();
+ p.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
+ p.setStyleName("bpm-header-userinfo");
- userInfo.add(new Image("images/icons/05.png"));
- userInfo.add(new HTML(view.getAuthentication().getUsername()));
- userInfo.add(
- new Button("Logout",
- new ButtonListenerAdapter()
- {
+ // load status image
+ LayoutPanel loadingImageContainer = new LayoutPanel();
+ loadingImageContainer.setStyleName("bpm-loading-image");
+ loadingImage = new Image("images/loading.gif");
+ loadingImageContainer.add(loadingImage);
+
+ setLoading(false);
- public void onClick(Button button, EventObject eventObject)
- {
- view.getAuthentication().doLogout();
- }
- }
- )
+ // account info
+ Image img = new Image("images/icons/05.png");
+ HTML html = new HTML(appContext.getAuthentication().getUsername());
+
+ Button btn = new Button("Logout", new ClickListener()
+ {
+
+ public void onClick(Widget widget)
+ {
+ appContext.getAuthentication().doLogout();
+ }
+ }
);
- //this.clear();
- this.add(userInfo);
- //this.doLayout();
+ p.add(loadingImageContainer);
+ p.add(img);
+ p.add(html);
+ p.add(btn);
+ this.add(p);
+
}
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void setLoading(boolean doDisplay)
+ {
+ if(doDisplay)
+ loadingImage.setVisible(doDisplay);
+ else
+ turnOffLoading.schedule(1000);
+ }
}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoadingStatusAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadingStatusAction implements ActionInterface
+{
+
+ public final static String ID = LoadingStatusAction.class.getName();
+
+ public final static Event ON = new Event(LoadingStatusAction.ID, true);
+ public final static Event OFF = new Event(LoadingStatusAction.ID, false);
+
+ /**
+ * @param controller
+ * @param object Boolean
+ */
+ public void execute(Controller controller, Object object)
+ {
+ Boolean b = (Boolean)object;
+ Header header = (Header)controller.getView(Header.ID);
+ header.setLoading(b);
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoginAction implements ActionInterface
+{
+
+ public void execute(Controller controller, Object object)
+ {
+ LoginView loginView = (LoginView)controller.getView(LoginView.NAME);
+ loginView.display();
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginView.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/LoginView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,197 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.core.client.GWT;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.forms.client.builder.DefaultFormBuilder;
+import org.gwt.mosaic.forms.client.layout.FormLayout;
+import org.gwt.mosaic.ui.client.WindowPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.Authentication;
+import org.jboss.bpm.console.client.ConsoleConfig;
+import org.jboss.bpm.console.client.URLBuilder;
+import org.jboss.bpm.console.client.MainLayout;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoginView implements ViewInterface
+{
+ public final static String NAME = "loginView";
+
+ private ConsoleConfig config;
+ private URLBuilder urlBuilder;
+ private Authentication auth;
+
+ private WindowPanel window = null;
+ private TextBox usernameInput;
+ private TextBox passwordInput;
+
+ public final static String[] KNOWN_ROLES = {"admin", "manager", "user"};
+
+ private Controller controller;
+
+ public LoginView()
+ {
+ config = new ConsoleConfig();
+
+ // setup
+
+ if (!GWT.isScript())
+ {
+ String proxyUrl = GWT.getModuleBaseURL() + "xhp";
+ config.setConsoleServerUrl(proxyUrl);
+ }
+
+ ConsoleLog.debug("Console server: " + config.getConsoleServerUrl());
+ ConsoleLog.debug("Report server: " + config.getReportServerUrl());
+
+ urlBuilder = new URLBuilder(config);
+
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void display()
+ {
+ createLayoutWindowPanel();
+
+ // remove later on
+ usernameInput.setText("alex");
+ passwordInput.setText("password");
+
+ window.center();
+ }
+
+ /**
+ * The 'layout' window panel.
+ */
+ private void createLayoutWindowPanel() {
+ window = new WindowPanel("jBPM Management Console");
+ window.setAnimationEnabled(false);
+ window.setSize("320px", "180px");
+
+ LayoutPanel panel = new LayoutPanel();
+ window.setWidget(panel);
+ createLayoutContent(panel);
+
+ window.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ window = null;
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
+ }
+
+ /**
+ * Create content for layout.
+ */
+ private void createLayoutContent(LayoutPanel layoutPanel) {
+
+ layoutPanel.setLayout(new BorderLayout());
+ layoutPanel.setPadding(5);
+
+ final Button submit = new Button("Submit");
+ submit.addClickListener(new ClickListener()
+ {
+
+ public void onClick(Widget widget)
+ {
+ String user = usernameInput.getText();
+ String pass = passwordInput.getText();
+
+ String url = urlBuilder.getUserInRoleURL(KNOWN_ROLES);
+ auth = new Authentication(url);
+ auth.setCallback(
+ new Authentication.AuthCallback()
+ {
+
+ public void onLoginSuccess(Request request, Response response)
+ {
+ // clear the form
+ usernameInput.setText("");
+ passwordInput.setText("");
+
+ // display main console
+ window.hide();
+
+ // assemble main layout
+ new MainLayout(controller, auth, urlBuilder, config);
+ }
+
+ public void onLoginFailed(Request request, Throwable t)
+ {
+ // auth failed
+ ConsoleLog.error("Authentication failed.", t);
+ }
+ }
+ );
+
+ auth.doLogin(user, pass);
+ }
+ });
+
+ layoutPanel.add(createForm(), new BorderLayoutData(BorderLayout.Region.CENTER, 10, 200));
+ layoutPanel.add(submit, new BorderLayoutData(BorderLayout.Region.SOUTH, 10, 200));
+
+ }
+
+ private Widget createForm()
+ {
+ FormLayout layout = new FormLayout(
+ "right:pref, 10px, left:pref:grow", // 3 columns
+ "pref, pref, 5px, pref"); // 4 rows
+
+ DefaultFormBuilder builder = new DefaultFormBuilder(layout);
+ builder.appendSeparator("Login");
+
+ usernameInput = new TextBox();
+ builder.append("Username:", usernameInput);
+ builder.nextLine();
+
+ builder.nextLine(); // empty space
+
+ passwordInput = new TextBox();
+ builder.append("Password:", passwordInput);
+ builder.nextLine();
+
+ return builder.getPanel();
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Image;
+import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.*;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.util.WindowUtil;
+
+/**
+ * The main composite that assembles the gwt console application.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class MainLayout extends Composite implements ApplicationContext
+{
+
+ public final static String NAME = "mainLayout";
+
+ private Header header;
+ private Menu menu;
+
+ private Workspace workspace;
+ private URLBuilder urlBuilder;
+ private Authentication auth;
+ private ConsoleConfig config;
+
+ private Controller controller;
+ private Viewport viewport;
+
+ public MainLayout(Controller controller, Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
+ {
+ this.controller = controller;
+ this.auth = auth;
+ this.config = config;
+ this.urlBuilder = urlBuilder;
+
+ display();
+ }
+
+ public void display()
+ {
+ viewport = new Viewport();
+
+ LayoutPanel layout = createLayout();
+ viewport.add(layout);
+
+ RootPanel.get().add(viewport);
+ }
+
+ private LayoutPanel createLayout()
+ {
+ final LayoutPanel layoutPanel = new LayoutPanel(new BorderLayout());
+
+ // header
+ header = new Header(this, auth.getUsername(), auth.getRolesAssigned());
+ layoutPanel.add(header, new BorderLayoutData(Region.NORTH, 50));
+
+ // menu
+ menu = new Menu();
+ layoutPanel.add(menu, new BorderLayoutData(Region.WEST, 200));
+
+ // workspace
+ workspace = createWorkspace();
+ layoutPanel.add(workspace, new BorderLayoutData(Region.CENTER, false));
+
+
+ // register views and actions
+ controller.addView(Header.ID, header);
+
+ controller.addAction(LoadingStatusAction.ID, new LoadingStatusAction());
+
+ return layoutPanel;
+ }
+
+ private Workspace createWorkspace()
+ {
+ Workspace workspace = new Workspace(menu);
+ WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
+ launcher.launch(this, workspace); // calls Workspace.addEditor()
+ return workspace;
+ }
+
+ // ---- ApplicationContext interface ----
+
+
+ public Viewport getViewport()
+ {
+ return viewport;
+ }
+
+ public Controller getController()
+ {
+ return this.controller;
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return this.urlBuilder;
+ }
+
+ public void displayMessage(final String message, final boolean isError)
+ {
+ if(isError)
+ {
+ WindowPanel err = new WindowPanel("Error");
+ err.getHeader().add( new Image("images/icons/error.png") );
+ err.setAnimationEnabled(true);
+ err.setSize("320px", "240px");
+ ScrollLayoutPanel scrollLayoutPanel = new ScrollLayoutPanel();
+ scrollLayoutPanel.add(new HTML(message));
+ err.setWidget(scrollLayoutPanel);
+
+ WindowUtil.addMaximizeButton(err, Caption.CaptionRegion.RIGHT);
+ WindowUtil.addMinimizeButton(err, Caption.CaptionRegion.RIGHT);
+
+ err.center();
+ }
+ else
+ {
+ InfoPanel.show("", message, "");
+ }
+ }
+
+ public Authentication getAuthentication()
+ {
+ return auth;
+ }
+
+ public ConsoleConfig getConfig()
+ {
+ return config;
+ }
+
+ public Workspace getWorkpace()
+ {
+ return workspace;
+ }
+}
+
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/MainView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,174 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.core.client.GWT;
-import com.gwtext.client.core.Margins;
-import com.gwtext.client.core.RegionPosition;
-import com.gwtext.client.widgets.*;
-import com.gwtext.client.widgets.layout.BorderLayout;
-import com.gwtext.client.widgets.layout.BorderLayoutData;
-import com.gwtext.client.widgets.layout.FitLayout;
-import org.jboss.bpm.console.client.util.ConsoleLog;
-import org.jboss.bpm.console.client.WorkspaceLauncher;
-
-/**
- * The main composite that assembles the gwt console application.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class MainView extends Composite implements ApplicationContext
-{
- private HTML status = new HTML();
- private Header header;
- private Menu menu;
- private Workspace workspace;
-
- private URLBuilder urlBuilder;
- private Viewport viewport;
- private Authentication auth;
-
- private ConsoleConfig config;
-
- public MainView(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
- {
- this.auth = auth;
- this.config = config;
- this.urlBuilder = urlBuilder;
-
- Panel mainPanel = createMainPanel();
- assembleMainApplication(mainPanel);
-
- viewport = new Viewport(mainPanel);
- }
-
- private Panel createMainPanel()
- {
- Panel mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setPaddings(5); // outer most padding
- mainPanel.setLayout(new FitLayout());
- mainPanel.setWidth(UIConstants.OVERALL_WIDTH);
- mainPanel.setHeight(UIConstants.OVERALL_WIDTH);
- mainPanel.setAutoWidth(false);
- return mainPanel;
- }
-
- private void assembleMainApplication(Panel mainPanel)
- {
- Panel borderPanel = new Panel();
- borderPanel.setBorder(false);
- borderPanel.setLayout(new BorderLayout());
-
- // ------------------------------------------
-
- header = new Header(this);
- borderPanel.add(header, new BorderLayoutData(RegionPosition.NORTH));
- header.setUserInfo(auth.getUsername(), auth.getRolesAssigned());
-
- // ------------------------------------------
-
- menu = new Menu(this);
- BorderLayoutData menuData = new BorderLayoutData(RegionPosition.WEST);
- menuData.setSplit(false);
- menuData.setMinSize(UIConstants.MAIN_MENU_MIN);
- menuData.setMaxSize(UIConstants.MAIN_MENU_MAX);
- menuData.setMargins(new Margins(0, 5, 0, 0));
- borderPanel.add(menu, menuData);
-
- // ------------------------------------------
-
- workspace = new Workspace(menu);
- WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
- launcher.launch(this, workspace);
-
- borderPanel.add(workspace, new BorderLayoutData(RegionPosition.CENTER));
-
- // ------------------------------------------
-
- mainPanel.add(borderPanel);
- }
-
- public void addEditor(Editor editor)
- {
- ConsoleLog.debug("Add editor " + editor.getEditorId());
- workspace.addEditor(editor, true);
- }
-
- public boolean hasEditor(String id)
- {
- return workspace.hasEditor(id);
- }
-
- public void showEditor(String id)
- {
- workspace.showEditor(id);
- }
-
- public URLBuilder getUrlBuilder()
- {
- return this.urlBuilder;
- }
-
- public void displayMessage(final String message, final boolean isError)
- {
- status.setText(message);
-
- MessageBox.show(new MessageBoxConfig()
- {
- {
- String title = isError ? "Error" : "System Message";
- setTitle(title);
- setMsg(message);
- setButtons(MessageBox.OK);
- setCallback(new MessageBox.PromptCallback()
- {
- public void execute(String btnID, String text)
- {
- }
- });
- }
- });
- }
-
- public Authentication getAuthentication()
- {
- return auth;
- }
-
- public ConsoleConfig getConfig()
- {
- return config;
- }
-
- public Viewport getViewport()
- {
- return viewport;
- }
-
- public Workspace getWorkpace()
- {
- return workspace;
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.common;
-
-import com.google.gwt.http.client.*;
-import com.google.gwt.user.client.Timer;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.LoadingStatusAction;
-
-import java.io.IOException;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public abstract class AbstractRESTAction implements ActionInterface
-{
- protected ApplicationContext appContext;
-
- protected AbstractRESTAction(ApplicationContext appContetext)
- {
- this.appContext = appContetext;
- }
-
- public abstract String getId();
- public abstract String getUrl(Object event);
- public abstract RequestBuilder.Method getRequestMethod();
- public abstract void handleSuccessfulResponse(final Controller controller, final Object event, Response response);
-
- public void execute(final Controller controller, final Object object)
- {
- final String url = getUrl(object);
- RequestBuilder builder = new RequestBuilder(getRequestMethod(), URL.encode(url));
-
- try
- {
- controller.handleEvent( LoadingStatusAction.ON );
-
- final Request request = builder.sendRequest(null,
- new RequestCallback()
- {
- public void onError(Request request, Throwable exception) {
- // Couldn't connect to server (could be timeout, SOP violation, etc.)
- handleError(url, exception);
- controller.handleEvent( LoadingStatusAction.OFF );
- }
-
- public void onResponseReceived(Request request, Response response) {
- try
- {
- if (200 == response.getStatusCode())
- {
- handleSuccessfulResponse(controller, object, response);
- }
- else
- {
- final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
- handleError(
- url,
- new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
- );
- }
- }
- finally
- {
- controller.handleEvent( LoadingStatusAction.OFF );
- }
- }
- }
- );
-
- // Timer to handle pending request
- Timer t = new Timer() {
-
- public void run()
- {
- if(request.isPending())
- {
- request.cancel();
- handleError(
- url,
- new IOException("Request timeout")
- );
- }
-
- }
- };
- t.schedule(5000);
-
- }
- catch (RequestException e)
- {
- // Couldn't connect to server
- handleError(url, e);
- controller.handleEvent( LoadingStatusAction.OFF );
- }
- }
-
- protected void handleError(String url, Throwable t)
- {
- final String out =
- "<ul>"+
- "<li>URL: '" + url + "'\n"+
- "<li>Action: '" + getId() + "'\n" +
- "<li>Exception: '" + t.getClass() +
- "</ul>'\n\n"+
- t.getMessage();
-
- appContext.displayMessage(out, true);
-
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.common;
+
+import com.google.gwt.http.client.*;
+import com.google.gwt.user.client.Timer;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LoadingStatusAction;
+
+import java.io.IOException;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractRESTAction implements ActionInterface
+{
+ protected ApplicationContext appContext;
+
+ protected AbstractRESTAction(ApplicationContext appContetext)
+ {
+ this.appContext = appContetext;
+ }
+
+ public abstract String getId();
+ public abstract String getUrl(Object event);
+ public abstract RequestBuilder.Method getRequestMethod();
+ public abstract void handleSuccessfulResponse(final Controller controller, final Object event, Response response);
+
+ public void execute(final Controller controller, final Object object)
+ {
+ final String url = getUrl(object);
+ RequestBuilder builder = new RequestBuilder(getRequestMethod(), URL.encode(url));
+
+ try
+ {
+ controller.handleEvent( LoadingStatusAction.ON );
+
+ final Request request = builder.sendRequest(null,
+ new RequestCallback()
+ {
+ public void onError(Request request, Throwable exception) {
+ // Couldn't connect to server (could be timeout, SOP violation, etc.)
+ handleError(url, exception);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+
+ public void onResponseReceived(Request request, Response response) {
+ try
+ {
+ if (200 == response.getStatusCode())
+ {
+ handleSuccessfulResponse(controller, object, response);
+ }
+ else
+ {
+ final String msg = response.getText().equals("") ? "Unknown error" : response.getText();
+ handleError(
+ url,
+ new RequestException("HTTP "+ response.getStatusCode()+ ": " + msg)
+ );
+ }
+ }
+ finally
+ {
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+ }
+ }
+ );
+
+ // Timer to handle pending request
+ Timer t = new Timer() {
+
+ public void run()
+ {
+ if(request.isPending())
+ {
+ request.cancel();
+ handleError(
+ url,
+ new IOException("Request timeout")
+ );
+ }
+
+ }
+ };
+ t.schedule(5000);
+
+ }
+ catch (RequestException e)
+ {
+ // Couldn't connect to server
+ handleError(url, e);
+ controller.handleEvent( LoadingStatusAction.OFF );
+ }
+ }
+
+ protected void handleError(String url, Throwable t)
+ {
+ final String out =
+ "<ul>"+
+ "<li>URL: '" + url + "'\n"+
+ "<li>Action: '" + getId() + "'\n" +
+ "<li>Exception: '" + t.getClass() +
+ "</ul>'\n\n"+
+ t.getMessage();
+
+ appContext.displayMessage(out, true);
+
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/events)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.events;
-
-import org.jboss.bpm.console.client.Authentication;
-import org.jboss.bpm.console.client.URLBuilder;
-import org.jboss.bpm.console.client.ConsoleConfig;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public final class BootstrapEvent
-{
- Authentication auth;
- URLBuilder urlBuilder;
- ConsoleConfig config;
-
- public BootstrapEvent(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
- {
- this.auth = auth;
- this.urlBuilder = urlBuilder;
- this.config = config;
- }
-
- public Authentication getAuth()
- {
- return auth;
- }
-
- public URLBuilder getUrlBuilder()
- {
- return urlBuilder;
- }
-
- public ConsoleConfig getConfig()
- {
- return config;
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/events/BootstrapEvent.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.events;
+
+import org.jboss.bpm.console.client.Authentication;
+import org.jboss.bpm.console.client.URLBuilder;
+import org.jboss.bpm.console.client.ConsoleConfig;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class BootstrapEvent
+{
+ Authentication auth;
+ URLBuilder urlBuilder;
+ ConsoleConfig config;
+
+ public BootstrapEvent(Authentication auth, URLBuilder urlBuilder, ConsoleConfig config)
+ {
+ this.auth = auth;
+ this.urlBuilder = urlBuilder;
+ this.config = config;
+ }
+
+ public Authentication getAuth()
+ {
+ return auth;
+ }
+
+ public URLBuilder getUrlBuilder()
+ {
+ return urlBuilder;
+ }
+
+ public ConsoleConfig getConfig()
+ {
+ return config;
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,186 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import com.mvc4g.client.ViewInterface;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.LazyPanel;
-
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class DefinitionListView extends LayoutPanel
- implements ViewInterface, LazyPanel
-{
- public final static String ID = DefinitionListView.class.getName();
-
- private Controller controller;
-
- private LayoutPanel definitionList = null;
-
- private ListBox<ProcessDefinitionRef> listBox;
-
- private boolean isInitialized;
-
- public DefinitionListView()
- {
- super();
- setTitle("Process Definitions");
- }
-
- public boolean isInitialized()
- {
- return isInitialized;
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- definitionList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
- definitionList.setPadding(0);
- definitionList.setWidgetSpacing(0);
-
- listBox =
- new ListBox<ProcessDefinitionRef>(
- new String[] {
- "Process ID", "Name", "Key", "Version"}
- );
-
-
- listBox.setCellRenderer(new ListBox.CellRenderer<ProcessDefinitionRef>() {
- public void renderCell(ListBox<ProcessDefinitionRef> listBox, int row, int column,
- ProcessDefinitionRef item) {
- switch (column) {
- case 0:
- listBox.setText(row, column, item.getId());
- break;
- case 1:
- listBox.setText(row, column, item.getName());
- break;
- case 2:
- listBox.setText(row, column, item.getKey());
- break;
- case 3:
- listBox.setText(row, column, String.valueOf(item.getVersion()));
- break;
- default:
- throw new RuntimeException("Unexpected column size");
- }
- }
- });
-
- listBox.addChangeListener(new ChangeListener()
- {
- public void onChange(Widget widget)
- {
- int index = listBox.getSelectedIndex();
- if(index!=-1)
- {
- controller.handleEvent(
- new Event(
- LoadInstancesAction.ID,
- listBox.getItem( index )
- )
- );
- }
- }
- });
-
- final DefaultListModel<ProcessDefinitionRef> model =
- (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
-
- // toolbar
-
- final LayoutPanel toolBox = new LayoutPanel();
- toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
- //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
-
- final ToolBar toolBar = new ToolBar();
- toolBar.add(
- new ToolButton("Refresh", new ClickListener() {
- public void onClick(Widget sender) {
- // force loading
- controller.handleEvent(
- new Event(LoadDefinitionsAction.ID, null)
- );
- }
- }
- )
- );
-
- toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
-
- this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- this.definitionList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
-
- this.add(definitionList);
-
- isInitialized = true;
- }
- }
-
-
- public void setController(Controller controller)
- {
- this.controller = controller;
- }
-
- public void update(List<ProcessDefinitionRef> definitions)
- {
- // lazy init
- initialize();
-
- final DefaultListModel<ProcessDefinitionRef> model =
- (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
-
- model.clear();
-
- for(ProcessDefinitionRef def : definitions)
- {
- model.add(def);
- }
- }
-
- public ProcessDefinitionRef getSelection()
- {
- ProcessDefinitionRef selection = null;
- if(isInitialized() && listBox.getSelectedIndex()!=-1)
- selection = listBox.getItem( listBox.getSelectedIndex());
- return selection;
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,186 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.LazyPanel;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class DefinitionListView extends LayoutPanel
+ implements ViewInterface, LazyPanel
+{
+ public final static String ID = DefinitionListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel definitionList = null;
+
+ private ListBox<ProcessDefinitionRef> listBox;
+
+ private boolean isInitialized;
+
+ public DefinitionListView()
+ {
+ super();
+ setTitle("Process Definitions");
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ definitionList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ definitionList.setPadding(0);
+ definitionList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<ProcessDefinitionRef>(
+ new String[] {
+ "Process ID", "Name", "Key", "Version"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<ProcessDefinitionRef>() {
+ public void renderCell(ListBox<ProcessDefinitionRef> listBox, int row, int column,
+ ProcessDefinitionRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 2:
+ listBox.setText(row, column, item.getKey());
+ break;
+ case 3:
+ listBox.setText(row, column, String.valueOf(item.getVersion()));
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ controller.handleEvent(
+ new Event(
+ LoadInstancesAction.ID,
+ listBox.getItem( index )
+ )
+ );
+ }
+ }
+ });
+
+ final DefaultListModel<ProcessDefinitionRef> model =
+ (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+
+ // toolbar
+
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+ //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadDefinitionsAction.ID, null)
+ );
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ this.definitionList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.definitionList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(definitionList);
+
+ isInitialized = true;
+ }
+ }
+
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public void update(List<ProcessDefinitionRef> definitions)
+ {
+ // lazy init
+ initialize();
+
+ final DefaultListModel<ProcessDefinitionRef> model =
+ (DefaultListModel<ProcessDefinitionRef>) listBox.getModel();
+
+ model.clear();
+
+ for(ProcessDefinitionRef def : definitions)
+ {
+ model.add(def);
+ }
+ }
+
+ public ProcessDefinitionRef getSelection()
+ {
+ ProcessDefinitionRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,236 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.ViewInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.LazyPanel;
-
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class InstanceListView extends LayoutPanel
- implements ViewInterface, LazyPanel
-{
- public final static String ID = InstanceListView.class.getName();
-
- private Controller controller;
-
- private LayoutPanel instanceList = null;
-
- private ListBox<ProcessInstanceRef> listBox;
-
- private ProcessDefinitionRef currentDefinition;
-
- private boolean isInitialized;
-
- private List<ProcessInstanceRef> cachedInstances = null;
-
- public InstanceListView()
- {
- super();
- setTitle("Process Instances");
-
- }
-
- public boolean isInitialized()
- {
- return isInitialized;
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- instanceList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
- instanceList.setPadding(0);
- instanceList.setWidgetSpacing(0);
-
- listBox =
- new ListBox<ProcessInstanceRef>(
- new String[] {
- "Instance ID", "State", "Start Date"}
- );
-
- listBox.setCellRenderer(new ListBox.CellRenderer<ProcessInstanceRef>() {
- public void renderCell(ListBox<ProcessInstanceRef> listBox, int row, int column,
- ProcessInstanceRef item) {
- switch (column) {
- case 0:
- listBox.setText(row, column, item.getId());
- break;
- case 1:
- listBox.setText(row, column, item.getState().toString());
- break;
- case 2:
- listBox.setText(row, column, item.getStartDate().toString());
- break;
- default:
- throw new RuntimeException("Unexpected column size");
- }
- }
- });
-
- // toolbar
- final LayoutPanel toolBox = new LayoutPanel();
- toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
-
- final ToolBar toolBar = new ToolBar();
- toolBar.add(
- new ToolButton("Refresh", new ClickListener() {
- public void onClick(Widget sender) {
- controller.handleEvent(
- new Event(
- LoadInstancesAction.ID,
- getCurrentDefinition()
- )
- );
- }
- }
- )
- );
-
- toolBar.addSeparator();
-
- toolBar.add(
- new ToolButton("Start new instance", new ClickListener()
- {
- public void onClick(Widget sender)
- {
- controller.handleEvent(
- new Event(
- StartNewInstanceAction.ID,
- getCurrentDefinition()
- )
- );
- }
- }
- )
- );
-
- toolBar.addSeparator();
-
- toolBar.add(
- new ToolButton("Cancel execution", new ClickListener()
- {
- public void onClick(Widget sender)
- {
- ProcessInstanceRef selection = getSelection();
- if(selection!=null)
- {
- selection.setState(ProcessInstanceRef.STATE.ENDED);
-
- controller.handleEvent(
- new Event(
- StateChangeAction.ID,
- selection
- )
- );
- }
- else
- {
- MessageBox.alert("Missing selection", "Please select an instance");
- }
- }
- }
- )
- );
-
- toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
-
- instanceList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- instanceList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
-
- // cached data?
- if(this.cachedInstances!=null)
- bindData(this.cachedInstances);
-
- this.add(instanceList);
-
-
-
- isInitialized = true;
-
- }
- }
-
- public ProcessInstanceRef getSelection()
- {
- ProcessInstanceRef selection = null;
- if(listBox.getSelectedIndex()!=-1)
- selection = listBox.getItem( listBox.getSelectedIndex());
- return selection;
- }
-
- public ProcessDefinitionRef getCurrentDefinition()
- {
- return this.currentDefinition;
- }
-
- public void setController(Controller controller)
- {
- this.controller = controller;
- }
-
-
- public void update(final ProcessDefinitionRef def, List<ProcessInstanceRef> instances)
- {
- this.currentDefinition = def;
- this.cachedInstances = instances;
-
- if(isInitialized())
- {
- bindData(instances);
- }
- }
-
- private void bindData(List<ProcessInstanceRef> instances)
- {
- final DefaultListModel<ProcessInstanceRef> model =
- (DefaultListModel<ProcessInstanceRef>) listBox.getModel();
- model.clear();
-
- for(ProcessInstanceRef inst : instances)
- {
- model.add(inst);
- }
-
- // layout again
- this.invalidate();
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.LazyPanel;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class InstanceListView extends LayoutPanel
+ implements ViewInterface, LazyPanel
+{
+ public final static String ID = InstanceListView.class.getName();
+
+ private Controller controller;
+
+ private LayoutPanel instanceList = null;
+
+ private ListBox<ProcessInstanceRef> listBox;
+
+ private ProcessDefinitionRef currentDefinition;
+
+ private boolean isInitialized;
+
+ private List<ProcessInstanceRef> cachedInstances = null;
+
+ public InstanceListView()
+ {
+ super();
+ setTitle("Process Instances");
+
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ instanceList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ instanceList.setPadding(0);
+ instanceList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<ProcessInstanceRef>(
+ new String[] {
+ "Instance ID", "State", "Start Date"}
+ );
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<ProcessInstanceRef>() {
+ public void renderCell(ListBox<ProcessInstanceRef> listBox, int row, int column,
+ ProcessInstanceRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, item.getId());
+ break;
+ case 1:
+ listBox.setText(row, column, item.getState().toString());
+ break;
+ case 2:
+ listBox.setText(row, column, item.getStartDate().toString());
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ controller.handleEvent(
+ new Event(
+ LoadInstancesAction.ID,
+ getCurrentDefinition()
+ )
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Start new instance", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+ controller.handleEvent(
+ new Event(
+ StartNewInstanceAction.ID,
+ getCurrentDefinition()
+ )
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Cancel execution", new ClickListener()
+ {
+ public void onClick(Widget sender)
+ {
+ ProcessInstanceRef selection = getSelection();
+ if(selection!=null)
+ {
+ selection.setState(ProcessInstanceRef.STATE.ENDED);
+
+ controller.handleEvent(
+ new Event(
+ StateChangeAction.ID,
+ selection
+ )
+ );
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select an instance");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ instanceList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ instanceList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ // cached data?
+ if(this.cachedInstances!=null)
+ bindData(this.cachedInstances);
+
+ this.add(instanceList);
+
+
+
+ isInitialized = true;
+
+ }
+ }
+
+ public ProcessInstanceRef getSelection()
+ {
+ ProcessInstanceRef selection = null;
+ if(listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public ProcessDefinitionRef getCurrentDefinition()
+ {
+ return this.currentDefinition;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+
+ public void update(final ProcessDefinitionRef def, List<ProcessInstanceRef> instances)
+ {
+ this.currentDefinition = def;
+ this.cachedInstances = instances;
+
+ if(isInitialized())
+ {
+ bindData(instances);
+ }
+ }
+
+ private void bindData(List<ProcessInstanceRef> instances)
+ {
+ final DefaultListModel<ProcessInstanceRef> model =
+ (DefaultListModel<ProcessInstanceRef>) listBox.getModel();
+ model.clear();
+
+ for(ProcessInstanceRef inst : instances)
+ {
+ model.add(inst);
+ }
+
+ // layout again
+ this.invalidate();
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.json.client.JSONValue;
-import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-
-import java.util.List;
-
-/**
- * Loads a process definition list.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class LoadDefinitionsAction extends AbstractRESTAction
-{
- public final static String ID = LoadDefinitionsAction.class.getName();
-
- public LoadDefinitionsAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- return appContext.getUrlBuilder().getProcessDefinitionsURL();
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.GET;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- if (200 == response.getStatusCode())
- {
- JSONValue json = JSONParser.parse(response.getText());
- List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
- DefinitionListView view = (DefinitionListView) controller.getView(DefinitionListView.ID);
- view.update(definitions);
-
- appContext.displayMessage("Loaded " + definitions.size() + " process definitions", false);
- }
- else
- {
- // Handle the error. Can get the status text from response.getStatusText()
- appContext.displayMessage("Failed to load instances. " +
- "HTTP " + response.getStatusCode()+
- ": " +response.getText(),
- true
- );
- }
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadDefinitionsAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+import java.util.List;
+
+/**
+ * Loads a process definition list.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class LoadDefinitionsAction extends AbstractRESTAction
+{
+ public final static String ID = LoadDefinitionsAction.class.getName();
+
+ public LoadDefinitionsAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ return appContext.getUrlBuilder().getProcessDefinitionsURL();
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ if (200 == response.getStatusCode())
+ {
+ JSONValue json = JSONParser.parse(response.getText());
+ List<ProcessDefinitionRef> definitions = DTOParser.parseProcessDefinitions(json);
+ DefinitionListView view = (DefinitionListView) controller.getView(DefinitionListView.ID);
+ view.update(definitions);
+
+ appContext.displayMessage("Loaded " + definitions.size() + " process definitions", false);
+ }
+ else
+ {
+ // Handle the error. Can get the status text from response.getStatusText()
+ appContext.displayMessage("Failed to load instances. " +
+ "HTTP " + response.getStatusCode()+
+ ": " +response.getText(),
+ true
+ );
+ }
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.google.gwt.json.client.JSONParser;
-import com.google.gwt.json.client.JSONValue;
-import com.mvc4g.client.Controller;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-
-import java.util.List;
-
-/**
- * Force loading of a process instance list.
- * Triggered through {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class LoadInstancesAction extends AbstractRESTAction
-{
- public final static String ID = LoadInstancesAction.class.getName();
-
- public LoadInstancesAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
- return appContext.getUrlBuilder().getProcessInstancesURL(def.getId());
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.GET;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
- JSONValue json = JSONParser.parse(response.getText());
-
- List<ProcessInstanceRef> instances = DTOParser.parseProcessInstances(json);
- InstanceListView view = (InstanceListView) controller.getView(InstanceListView.ID);
- view.update(def, instances);
-
- appContext.displayMessage("Loaded " + instances.size() + " process instances", false);
-
- }
-
-}
-
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.google.gwt.json.client.JSONParser;
+import com.google.gwt.json.client.JSONValue;
+import com.mvc4g.client.Controller;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+
+import java.util.List;
+
+/**
+ * Force loading of a process instance list.
+ * Triggered through {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class LoadInstancesAction extends AbstractRESTAction
+{
+ public final static String ID = LoadInstancesAction.class.getName();
+
+ public LoadInstancesAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getProcessInstancesURL(def.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ JSONValue json = JSONParser.parse(response.getText());
+
+ List<ProcessInstanceRef> instances = DTOParser.parseProcessInstances(json);
+ InstanceListView view = (InstanceListView) controller.getView(InstanceListView.ID);
+ view.update(def, instances);
+
+ appContext.displayMessage("Loaded " + instances.size() + " process instances", false);
+
+ }
+
+}
+
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import com.mvc4g.client.ViewInterface;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.LazyPanel;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ProcessEditor extends Editor
-{
- public final static String ID = ProcessEditor.class.getName();
-
- private TabLayoutPanel tabPanel;
-
- public ProcessEditor(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
- {
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
- {
- boolean showTab = true;
-
- if(i!=0)
- {
- DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
- boolean hasSelection = view.getSelection() != null;
- if(!hasSelection)
- {
- MessageBox.alert("Missing selection", "Please select a process");
- showTab=false;
- }
- }
-
- return showTab;
- }
-
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
- {
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- refreshView(); // TODO: hack around rendering problems
- }
- }
- }
- );
-
- this.add(tabPanel, new BorderLayoutData(Region.CENTER));
-
- // create and register views
- registerView(DefinitionListView.ID, new DefinitionListView());
- registerView(InstanceListView.ID, new InstanceListView());
-
- // create and register actions
- registerAction(LoadDefinitionsAction.ID, new LoadDefinitionsAction(appContext));
- registerAction(LoadInstancesAction.ID, new LoadInstancesAction(appContext));
- registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction(appContext));
- registerAction(StateChangeAction.ID, new StateChangeAction(appContext));
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(LoadDefinitionsAction.ID, null)
- );
-
- refreshView();
-
- isInitialized = true;
- }
- }
-
- private void registerView(String id, Widget view)
- {
- // register view with controller
- super.controller.addView(id, (ViewInterface)view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getTitle());
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
- public String getEditorId()
- {
- return ID;
- }
-
- public String getTitle()
- {
- return "Processes";
- }
-
- public String getIconCSS()
- {
- return "bpm-process-icon";
- }
-
- public MenuSection provideMenuSection()
- {
- return new MenuSection(
- "Processes",
- "bpm-process-icon",
- new ProcessEditorNavigation(appContext)
- );
- }
-}
-
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Event;
+import com.mvc4g.client.ViewInterface;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.LazyPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ProcessEditor extends Editor
+{
+ public final static String ID = ProcessEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ public ProcessEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ }
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(Region.CENTER));
+
+ // create and register views
+ registerView(DefinitionListView.ID, new DefinitionListView());
+ registerView(InstanceListView.ID, new InstanceListView());
+
+ // create and register actions
+ registerAction(LoadDefinitionsAction.ID, new LoadDefinitionsAction(appContext));
+ registerAction(LoadInstancesAction.ID, new LoadInstancesAction(appContext));
+ registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction(appContext));
+ registerAction(StateChangeAction.ID, new StateChangeAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(LoadDefinitionsAction.ID, null)
+ );
+
+ refreshView();
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, Widget view)
+ {
+ // register view with controller
+ super.controller.addView(id, (ViewInterface)view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getTitle());
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Processes";
+ }
+
+ public String getIconCSS()
+ {
+ return "bpm-process-icon";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ return new MenuSection(
+ "Processes",
+ "bpm-process-icon",
+ new ProcessEditorNavigation(appContext)
+ );
+ }
+}
+
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.TreeListener;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Workspace;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class ProcessEditorNavigation extends Tree
-{
-
- public ProcessEditorNavigation(final ApplicationContext appContext)
- {
- super.setTitle("Processes");
-
- TreeItem root = addItem("Process Definitions");
- TreeItem definitions = root.addItem("View definitions");
-
- addTreeListener(
- new TreeListener()
- {
- public void onTreeItemSelected(TreeItem treeItem)
- {
- if("View definitions".equals(treeItem.getText()))
- {
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(ProcessEditor.ID);
- }
- }
-
- public void onTreeItemStateChanged(TreeItem treeItem)
- {
-
- }
- }
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorNavigation.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class ProcessEditorNavigation extends Tree
+{
+
+ public ProcessEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Processes");
+
+ TreeItem root = addItem("Process Definitions");
+ TreeItem definitions = root.addItem("View definitions");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("View definitions".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(ProcessEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-
-/**
- * Starts a new process instance.
- * Triggered through {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class StartNewInstanceAction extends AbstractRESTAction
-{
- public final static String ID = StartNewInstanceAction.class.getName();
-
- public StartNewInstanceAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
- return appContext.getUrlBuilder().getStartNewInstanceURL(def.getId());
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.POST;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
-
- // force reload instance list
- controller.handleEvent(
- new Event(LoadInstancesAction.ID, def)
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StartNewInstanceAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+
+/**
+ * Starts a new process instance.
+ * Triggered through {@link org.jboss.bpm.console.client.model.ProcessDefinitionRef}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class StartNewInstanceAction extends AbstractRESTAction
+{
+ public final static String ID = StartNewInstanceAction.class.getName();
+
+ public StartNewInstanceAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getStartNewInstanceURL(def.getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+
+ // force reload instance list
+ controller.handleEvent(
+ new Event(LoadInstancesAction.ID, def)
+ );
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.process;
-
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import com.google.gwt.http.client.*;
-
-/**
- * Starts a new process instance.
- * Triggered through {@link org.jboss.bpm.console.client.model.ProcessInstanceRef}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class StateChangeAction extends AbstractRESTAction
-{
- public final static String ID = StateChangeAction.class.getName();
-
- public StateChangeAction(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- final ProcessInstanceRef inst = (ProcessInstanceRef)event;
- return appContext.getUrlBuilder().getStateChangeURL(inst.getId(), inst.getState());
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.POST;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- InstanceListView view = (InstanceListView)
- controller.getView(InstanceListView.ID);
- ProcessDefinitionRef def = view.getCurrentDefinition();
-
- // force reload instance list
- controller.handleEvent( new Event(LoadInstancesAction.ID, def));
- }
-}
-
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/StateChangeAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.process;
+
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import com.google.gwt.http.client.*;
+
+/**
+ * Starts a new process instance.
+ * Triggered through {@link org.jboss.bpm.console.client.model.ProcessInstanceRef}
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class StateChangeAction extends AbstractRESTAction
+{
+ public final static String ID = StateChangeAction.class.getName();
+
+ public StateChangeAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ final ProcessInstanceRef inst = (ProcessInstanceRef)event;
+ return appContext.getUrlBuilder().getStateChangeURL(inst.getId(), inst.getState());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ InstanceListView view = (InstanceListView)
+ controller.getView(InstanceListView.ID);
+ ProcessDefinitionRef def = view.getCurrentDefinition();
+
+ // force reload instance list
+ controller.handleEvent( new Event(LoadInstancesAction.ID, def));
+ }
+}
+
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.jboss.bpm.console.client.LazyPanel;
-import org.jboss.bpm.console.client.model.TaskRef;
-import com.mvc4g.client.ViewInterface;
-import com.mvc4g.client.Controller;
-
-import java.util.List;
-
-/**
- * Base class for task lists.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public abstract class AbstractTaskList extends LayoutPanel
- implements ViewInterface, LazyPanel
-{
- protected Controller controller;
- protected LayoutPanel taskList = null;
- protected ListBox<TaskRef> listBox;
- protected boolean isInitialized;
- protected String identity;
-
- public AbstractTaskList()
- {
- super();
- }
-
- public boolean isInitialized()
- {
- return isInitialized;
- }
-
- public void setController(Controller controller)
- {
- this.controller = controller;
- }
-
- public abstract void update(String identity, List<TaskRef> tasks);
-
- public TaskRef getSelection()
- {
- TaskRef selection = null;
- if(isInitialized() && listBox.getSelectedIndex()!=-1)
- selection = listBox.getItem( listBox.getSelectedIndex());
- return selection;
- }
-
- public String getAssignedIdentity()
- {
- return identity;
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AbstractTaskList.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+
+import java.util.List;
+
+/**
+ * Base class for task lists.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public abstract class AbstractTaskList extends LayoutPanel
+ implements ViewInterface, LazyPanel
+{
+ protected Controller controller;
+ protected LayoutPanel taskList = null;
+ protected ListBox<TaskRef> listBox;
+ protected boolean isInitialized;
+ protected String identity;
+
+ public AbstractTaskList()
+ {
+ super();
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ public abstract void update(String identity, List<TaskRef> tasks);
+
+ public TaskRef getSelection()
+ {
+ TaskRef selection = null;
+ if(isInitialized() && listBox.getSelectedIndex()!=-1)
+ selection = listBox.getItem( listBox.getSelectedIndex());
+ return selection;
+ }
+
+ public String getAssignedIdentity()
+ {
+ return identity;
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,178 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.mvc4g.client.Event;
-
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class AssignedTasksView extends AbstractTaskList
-{
-
- public final static String ID = AssignedTasksView.class.getName();
-
- public AssignedTasksView()
- {
- super();
- setTitle("Your Tasks");
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
- taskList.setPadding(0);
- taskList.setWidgetSpacing(0);
-
- listBox =
- new ListBox<TaskRef>(
- new String[] {
- "Task ID", "Name", "Assignee"}
- );
-
-
- listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
- public void renderCell(ListBox<TaskRef> listBox, int row, int column,
- TaskRef item) {
- switch (column) {
- case 0:
- listBox.setText(row, column, String.valueOf(item.getId()));
- break;
- case 1:
- listBox.setText(row, column, item.getName());
- break;
- case 2:
- listBox.setText(row, column, item.getAssignee());
- break;
- default:
- throw new RuntimeException("Unexpected column size");
- }
- }
- });
-
- listBox.addChangeListener(new ChangeListener()
- {
- public void onChange(Widget widget)
- {
- int index = listBox.getSelectedIndex();
- if(index!=-1)
- {
- System.out.println("Selected row "+ index);
- }
- }
- });
-
- // toolbar
- final LayoutPanel toolBox = new LayoutPanel();
- toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
- //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
-
- final ToolBar toolBar = new ToolBar();
- toolBar.add(
- new ToolButton("Refresh", new ClickListener() {
- public void onClick(Widget sender) {
- // force loading
- controller.handleEvent(
- new Event(LoadTasksAction.ID, getAssignedIdentity())
- );
- }
- }
- )
- );
-
- toolBar.addSeparator();
-
- toolBar.add(
- new ToolButton("Release", new ClickListener() {
- public void onClick(Widget sender) {
-
- TaskRef selection = getSelection();
-
- if(selection!=null)
- {
- controller.handleEvent(
- new Event(
- ReleaseTaskAction.ID,
- new TaskIdentityEvent(getAssignedIdentity(), selection)
- )
- );
- }
- else
- {
- MessageBox.alert("Missing selection", "Please select a task");
- }
- }
- }
- )
- );
-
-
- toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
-
- this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
-
- this.add(taskList);
-
- isInitialized = true;
- }
- }
-
- public void update(String identity, List<TaskRef> tasks)
- {
-
- this.identity = identity;
-
- // lazy init
- initialize();
-
- final DefaultListModel<TaskRef> model =
- (DefaultListModel<TaskRef>) listBox.getModel();
-
- model.clear();
-
- for(TaskRef task : tasks)
- {
- if(TaskRef.STATE.ASSIGNED ==task.getCurrentState())
- model.add(task);
- }
- }
-
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.mvc4g.client.Event;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class AssignedTasksView extends AbstractTaskList
+{
+
+ public final static String ID = AssignedTasksView.class.getName();
+
+ public AssignedTasksView()
+ {
+ super();
+ setTitle("Your Tasks");
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ taskList.setPadding(0);
+ taskList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<TaskRef>(
+ new String[] {
+ "Task ID", "Name", "Assignee"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
+ public void renderCell(ListBox<TaskRef> listBox, int row, int column,
+ TaskRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, String.valueOf(item.getId()));
+ break;
+ case 1:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 2:
+ listBox.setText(row, column, item.getAssignee());
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ listBox.addChangeListener(new ChangeListener()
+ {
+ public void onChange(Widget widget)
+ {
+ int index = listBox.getSelectedIndex();
+ if(index!=-1)
+ {
+ System.out.println("Selected row "+ index);
+ }
+ }
+ });
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+ //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, getAssignedIdentity())
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Release", new ClickListener() {
+ public void onClick(Widget sender) {
+
+ TaskRef selection = getSelection();
+
+ if(selection!=null)
+ {
+ controller.handleEvent(
+ new Event(
+ ReleaseTaskAction.ID,
+ new TaskIdentityEvent(getAssignedIdentity(), selection)
+ )
+ );
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a task");
+ }
+ }
+ }
+ )
+ );
+
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(taskList);
+
+ isInitialized = true;
+ }
+ }
+
+ public void update(String identity, List<TaskRef> tasks)
+ {
+
+ this.identity = identity;
+
+ // lazy init
+ initialize();
+
+ final DefaultListModel<TaskRef> model =
+ (DefaultListModel<TaskRef>) listBox.getModel();
+
+ model.clear();
+
+ for(TaskRef task : tasks)
+ {
+ if(TaskRef.STATE.ASSIGNED ==task.getCurrentState())
+ model.add(task);
+ }
+ }
+
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,71 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ClaimTaskAction extends AbstractRESTAction
-{
- public final static String ID = ClaimTaskAction.class.getName();
-
- public ClaimTaskAction(ApplicationContext appContetext)
- {
- super(appContetext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
-
- return appContext.getUrlBuilder().getTaskAssignURL(
- claimEvent.getTask().getId(), claimEvent.getIdentity()
- );
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.POST;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
-
- controller.handleEvent(
- new Event(LoadTasksAction.ID, claimEvent.getIdentity())
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ClaimTaskAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ClaimTaskAction extends AbstractRESTAction
+{
+ public final static String ID = ClaimTaskAction.class.getName();
+
+ public ClaimTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
+
+ return appContext.getUrlBuilder().getTaskAssignURL(
+ claimEvent.getTask().getId(), claimEvent.getIdentity()
+ );
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ TaskIdentityEvent claimEvent = (TaskIdentityEvent)event;
+
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, claimEvent.getIdentity())
+ );
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.model.DTOParser;
-import org.jboss.bpm.console.client.model.TaskRef;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.mvc4g.client.Controller;
-
-import java.util.List;
-
-/**
- * Loads a task list for a particular identity.
- *
- * @see org.jboss.bpm.console.client.task.AssignedTasksView
- * @see org.jboss.bpm.console.client.task.OpenTasksView
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class LoadTasksAction extends AbstractRESTAction
-{
- public final static String ID = LoadTasksAction.class.getName();
-
- public LoadTasksAction(ApplicationContext appContetext)
- {
- super(appContetext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- String identity = (String)event;
- return appContext.getUrlBuilder().getTaskListURL(identity);
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.GET;
- }
-
- public void handleSuccessfulResponse(
- final Controller controller, final Object event, Response response)
- {
- String identity = (String)event;
-
- List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
- OpenTasksView openTasks = (OpenTasksView)controller.getView(OpenTasksView.ID);
- AssignedTasksView personalTasks = (AssignedTasksView)controller.getView(AssignedTasksView.ID);
-
- openTasks.update(identity, tasks);
- personalTasks.update(identity, tasks);
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/LoadTasksAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.model.DTOParser;
+import org.jboss.bpm.console.client.model.TaskRef;
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+
+import java.util.List;
+
+/**
+ * Loads a task list for a particular identity.
+ *
+ * @see org.jboss.bpm.console.client.task.AssignedTasksView
+ * @see org.jboss.bpm.console.client.task.OpenTasksView
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class LoadTasksAction extends AbstractRESTAction
+{
+ public final static String ID = LoadTasksAction.class.getName();
+
+ public LoadTasksAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ String identity = (String)event;
+ return appContext.getUrlBuilder().getTaskListURL(identity);
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ public void handleSuccessfulResponse(
+ final Controller controller, final Object event, Response response)
+ {
+ String identity = (String)event;
+
+ List<TaskRef> tasks = DTOParser.parseTaskReferenceList(response.getText());
+ OpenTasksView openTasks = (OpenTasksView)controller.getView(OpenTasksView.ID);
+ AssignedTasksView personalTasks = (AssignedTasksView)controller.getView(AssignedTasksView.ID);
+
+ openTasks.update(identity, tasks);
+ personalTasks.update(identity, tasks);
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,163 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.ListBox;
-import org.gwt.mosaic.ui.client.MessageBox;
-import org.gwt.mosaic.ui.client.ToolBar;
-import org.gwt.mosaic.ui.client.ToolButton;
-import org.gwt.mosaic.ui.client.layout.BoxLayout;
-import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import org.gwt.mosaic.ui.client.list.DefaultListModel;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
-
-import java.util.List;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class OpenTasksView extends AbstractTaskList
-{
-
- public final static String ID = OpenTasksView.class.getName();
-
- public OpenTasksView()
- {
- super();
- setTitle("Open Tasks");
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
- taskList.setPadding(0);
- taskList.setWidgetSpacing(0);
-
- listBox =
- new ListBox<TaskRef>(
- new String[] {
- "Task ID", "Name", "Status"}
- );
-
-
- listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
- public void renderCell(ListBox<TaskRef> listBox, int row, int column,
- TaskRef item) {
- switch (column) {
- case 0:
- listBox.setText(row, column, String.valueOf(item.getId()));
- break;
- case 1:
- listBox.setText(row, column, item.getName());
- break;
- case 2:
- listBox.setText(row, column, String.valueOf(item.getCurrentState()));
- break;
- default:
- throw new RuntimeException("Unexpected column size");
- }
- }
- });
-
- // toolbar
- final LayoutPanel toolBox = new LayoutPanel();
- toolBox.setPadding(0);
- toolBox.setWidgetSpacing(5);
-
- final ToolBar toolBar = new ToolBar();
- toolBar.add(
- new ToolButton("Refresh", new ClickListener() {
- public void onClick(Widget sender) {
- // force loading
- controller.handleEvent(
- new Event(LoadTasksAction.ID, getAssignedIdentity())
- );
- }
- }
- )
- );
-
- toolBar.addSeparator();
-
- toolBar.add(
- new ToolButton("Claim", new ClickListener() {
- public void onClick(Widget sender)
- {
- TaskRef selection = getSelection();
-
- if(selection!=null)
- {
- controller.handleEvent(
- new Event(
- ClaimTaskAction.ID,
- new TaskIdentityEvent(getAssignedIdentity(), selection)
- )
- );
- }
- else
- {
- MessageBox.alert("Missing selection", "Please select a task");
- }
- }
- }
- )
- );
-
- toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
-
- this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
- this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
-
- this.add(taskList);
-
- isInitialized = true;
- }
- }
-
- public void update(String identity, List<TaskRef> tasks)
- {
-
- this.identity = identity;
-
- // lazy init
- initialize();
-
- final DefaultListModel<TaskRef> model =
- (DefaultListModel<TaskRef>) listBox.getModel();
-
- model.clear();
-
- for(TaskRef task : tasks)
- {
- if(TaskRef.STATE.OPEN ==task.getCurrentState())
- model.add(task);
- }
- }
-
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.ListBox;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.model.TaskRef;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+
+import java.util.List;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class OpenTasksView extends AbstractTaskList
+{
+
+ public final static String ID = OpenTasksView.class.getName();
+
+ public OpenTasksView()
+ {
+ super();
+ setTitle("Open Tasks");
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ taskList = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ taskList.setPadding(0);
+ taskList.setWidgetSpacing(0);
+
+ listBox =
+ new ListBox<TaskRef>(
+ new String[] {
+ "Task ID", "Name", "Status"}
+ );
+
+
+ listBox.setCellRenderer(new ListBox.CellRenderer<TaskRef>() {
+ public void renderCell(ListBox<TaskRef> listBox, int row, int column,
+ TaskRef item) {
+ switch (column) {
+ case 0:
+ listBox.setText(row, column, String.valueOf(item.getId()));
+ break;
+ case 1:
+ listBox.setText(row, column, item.getName());
+ break;
+ case 2:
+ listBox.setText(row, column, String.valueOf(item.getCurrentState()));
+ break;
+ default:
+ throw new RuntimeException("Unexpected column size");
+ }
+ }
+ });
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ // force loading
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, getAssignedIdentity())
+ );
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBar.add(
+ new ToolButton("Claim", new ClickListener() {
+ public void onClick(Widget sender)
+ {
+ TaskRef selection = getSelection();
+
+ if(selection!=null)
+ {
+ controller.handleEvent(
+ new Event(
+ ClaimTaskAction.ID,
+ new TaskIdentityEvent(getAssignedIdentity(), selection)
+ )
+ );
+ }
+ else
+ {
+ MessageBox.alert("Missing selection", "Please select a task");
+ }
+ }
+ }
+ )
+ );
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ this.taskList.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ this.taskList.add(listBox, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(taskList);
+
+ isInitialized = true;
+ }
+ }
+
+ public void update(String identity, List<TaskRef> tasks)
+ {
+
+ this.identity = identity;
+
+ // lazy init
+ initialize();
+
+ final DefaultListModel<TaskRef> model =
+ (DefaultListModel<TaskRef>) listBox.getModel();
+
+ model.clear();
+
+ for(TaskRef task : tasks)
+ {
+ if(TaskRef.STATE.OPEN ==task.getCurrentState())
+ model.add(task);
+ }
+ }
+
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.Response;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.common.AbstractRESTAction;
-import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ReleaseTaskAction extends AbstractRESTAction
-{
- public final static String ID = ReleaseTaskAction.class.getName();
-
- public ReleaseTaskAction(ApplicationContext appContetext)
- {
- super(appContetext);
- }
-
- public String getId()
- {
- return ID;
- }
-
- public String getUrl(Object event)
- {
- TaskIdentityEvent tie = (TaskIdentityEvent)event;
- return appContext.getUrlBuilder().getTaskReleaseURL(tie.getTask().getId());
- }
-
- public RequestBuilder.Method getRequestMethod()
- {
- return RequestBuilder.POST;
- }
-
- public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
- {
- TaskIdentityEvent tie = (TaskIdentityEvent)event;
-
- // force refresh reload
- controller.handleEvent(
- new Event(LoadTasksAction.ID, tie.getIdentity())
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/ReleaseTaskAction.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.http.client.Response;
+import com.mvc4g.client.Controller;
+import com.mvc4g.client.Event;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.task.events.TaskIdentityEvent;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReleaseTaskAction extends AbstractRESTAction
+{
+ public final static String ID = ReleaseTaskAction.class.getName();
+
+ public ReleaseTaskAction(ApplicationContext appContetext)
+ {
+ super(appContetext);
+ }
+
+ public String getId()
+ {
+ return ID;
+ }
+
+ public String getUrl(Object event)
+ {
+ TaskIdentityEvent tie = (TaskIdentityEvent)event;
+ return appContext.getUrlBuilder().getTaskReleaseURL(tie.getTask().getId());
+ }
+
+ public RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.POST;
+ }
+
+ public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
+ {
+ TaskIdentityEvent tie = (TaskIdentityEvent)event;
+
+ // force refresh reload
+ controller.handleEvent(
+ new Event(LoadTasksAction.ID, tie.getIdentity())
+ );
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,142 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.google.gwt.user.client.ui.Widget;
-import com.mvc4g.client.ViewInterface;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
-import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.LazyPanel;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class TaskEditor extends Editor
-{
- public final static String ID = TaskEditor.class.getName();
-
- private TabLayoutPanel tabPanel;
-
- public TaskEditor(ApplicationContext appContext)
- {
- super(appContext);
- }
-
- public void initialize()
- {
- if(!isInitialized)
- {
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
- {
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
- {
- return true;
- }
-
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
- {
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- refreshView(); // TODO: hack around rendering problems
- }
- }
- }
- );
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- // create and register views
- registerView(OpenTasksView.ID, new OpenTasksView());
- registerView(AssignedTasksView.ID, new AssignedTasksView());
-
- // create and register actions
- registerAction(LoadTasksAction.ID, new LoadTasksAction(appContext));
- registerAction(ClaimTaskAction.ID, new ClaimTaskAction(appContext));
- registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction(appContext));
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
- );
-
- refreshView();
-
- isInitialized = true;
- }
- }
-
- private void registerView(String id, Widget view)
- {
- // register view with controller
- super.controller.addView(id, (ViewInterface)view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getTitle());
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
- public String getEditorId()
- {
- return ID;
- }
-
- public String getTitle()
- {
- return "Task Management";
- }
-
- public String getIconCSS()
- {
- return "bpm-task-icon";
- }
-
- public MenuSection provideMenuSection()
- {
- return new MenuSection(
- "Tasks",
- "bpm-task-icon",
- new TaskEditorNavigation(appContext)
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.ActionInterface;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.LazyPanel;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class TaskEditor extends Editor
+{
+ public final static String ID = TaskEditor.class.getName();
+
+ private TabLayoutPanel tabPanel;
+
+ public TaskEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+ // create inner tab layout
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ return true;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // create and register views
+ registerView(OpenTasksView.ID, new OpenTasksView());
+ registerView(AssignedTasksView.ID, new AssignedTasksView());
+
+ // create and register actions
+ registerAction(LoadTasksAction.ID, new LoadTasksAction(appContext));
+ registerAction(ClaimTaskAction.ID, new ClaimTaskAction(appContext));
+ registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // force loading
+ super.controller.handleEvent(
+ new Event(LoadTasksAction.ID, appContext.getAuthentication().getUsername())
+ );
+
+ refreshView();
+
+ isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, Widget view)
+ {
+ // register view with controller
+ super.controller.addView(id, (ViewInterface)view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getTitle());
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Task Management";
+ }
+
+ public String getIconCSS()
+ {
+ return "bpm-task-icon";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ return new MenuSection(
+ "Tasks",
+ "bpm-task-icon",
+ new TaskEditorNavigation(appContext)
+ );
+ }
+}
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task;
-
-import com.google.gwt.user.client.ui.Tree;
-import com.google.gwt.user.client.ui.TreeItem;
-import com.google.gwt.user.client.ui.TreeListener;
-import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Workspace;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-class TaskEditorNavigation extends Tree
-{
- public TaskEditorNavigation(final ApplicationContext appContext)
- {
- super.setTitle("Tasks");
-
- TreeItem root = addItem("Task Management");
- TreeItem definitions = root.addItem("View Tasks");
-
- addTreeListener(
- new TreeListener()
- {
- public void onTreeItemSelected(TreeItem treeItem)
- {
- if("View Tasks".equals(treeItem.getText()))
- {
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(TaskEditor.ID);
- }
- }
-
- public void onTreeItemStateChanged(TreeItem treeItem)
- {
-
- }
- }
- );
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class TaskEditorNavigation extends Tree
+{
+ public TaskEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Tasks");
+
+ TreeItem root = addItem("Task Management");
+ TreeItem definitions = root.addItem("View Tasks");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("View Tasks".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(TaskEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/events)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.task.events;
-
-import org.jboss.bpm.console.client.model.TaskRef;
-
-/**
- * Composite event that represents Identities working on tasks.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public final class TaskIdentityEvent
-{
- private String identity;
- private TaskRef task;
-
- public TaskIdentityEvent(String identity, TaskRef task)
- {
- this.identity = identity;
- this.task = task;
- }
-
- public String getIdentity()
- {
- return identity;
- }
-
- public TaskRef getTask()
- {
- return task;
- }
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/events/TaskIdentityEvent.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.task.events;
+
+import org.jboss.bpm.console.client.model.TaskRef;
+
+/**
+ * Composite event that represents Identities working on tasks.
+ *
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public final class TaskIdentityEvent
+{
+ private String identity;
+ private TaskRef task;
+
+ public TaskIdentityEvent(String identity, TaskRef task)
+ {
+ this.identity = identity;
+ this.task = task;
+ }
+
+ public String getIdentity()
+ {
+ return identity;
+ }
+
+ public TaskRef getTask()
+ {
+ return task;
+ }
+}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/util)
Deleted: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.Widget;
-import org.gwt.mosaic.ui.client.Caption;
-import org.gwt.mosaic.ui.client.ImageButton;
-import org.gwt.mosaic.ui.client.WindowPanel;
-
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class WindowUtil
-{
- /**
- *
- * @param windowPanel
- */
- public static void addMaximizeButton(final WindowPanel windowPanel,
- Caption.CaptionRegion captionRegion) {
- final ImageButton maximizeBtn = new ImageButton(
- Caption.IMAGES.windowMaximize());
- maximizeBtn.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
- if (windowPanel.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
- windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
- } else {
- windowPanel.setWindowState(WindowPanel.WindowState.MAXIMIZED);
- }
- }
- });
- windowPanel.addWindowStateListener(new WindowPanel.WindowStateListener() {
- public void onWindowStateChange(WindowPanel sender) {
- if (sender.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
- maximizeBtn.setImage(Caption.IMAGES.windowRestore().createImage());
- } else {
- maximizeBtn.setImage(Caption.IMAGES.windowMaximize().createImage());
- }
-
- }
- });
- windowPanel.getHeader().add(maximizeBtn, captionRegion);
- }
-
- /**
- *
- * @param windowPanel
- */
- public static void addMinimizeButton(final WindowPanel windowPanel,
- Caption.CaptionRegion captionRegion) {
- final ImageButton minimizeBtn = new ImageButton(
- Caption.IMAGES.windowMinimize());
- minimizeBtn.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
- windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
- }
- });
- windowPanel.getHeader().add(minimizeBtn, captionRegion);
- }
-
-}
Copied: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java)
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java (rev 0)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/WindowUtil.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.console.client.util;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Widget;
+import org.gwt.mosaic.ui.client.Caption;
+import org.gwt.mosaic.ui.client.ImageButton;
+import org.gwt.mosaic.ui.client.WindowPanel;
+
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class WindowUtil
+{
+ /**
+ *
+ * @param windowPanel
+ */
+ public static void addMaximizeButton(final WindowPanel windowPanel,
+ Caption.CaptionRegion captionRegion) {
+ final ImageButton maximizeBtn = new ImageButton(
+ Caption.IMAGES.windowMaximize());
+ maximizeBtn.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ if (windowPanel.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
+ windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
+ } else {
+ windowPanel.setWindowState(WindowPanel.WindowState.MAXIMIZED);
+ }
+ }
+ });
+ windowPanel.addWindowStateListener(new WindowPanel.WindowStateListener() {
+ public void onWindowStateChange(WindowPanel sender) {
+ if (sender.getWindowState() == WindowPanel.WindowState.MAXIMIZED) {
+ maximizeBtn.setImage(Caption.IMAGES.windowRestore().createImage());
+ } else {
+ maximizeBtn.setImage(Caption.IMAGES.windowMaximize().createImage());
+ }
+
+ }
+ });
+ windowPanel.getHeader().add(maximizeBtn, captionRegion);
+ }
+
+ /**
+ *
+ * @param windowPanel
+ */
+ public static void addMinimizeButton(final WindowPanel windowPanel,
+ Caption.CaptionRegion captionRegion) {
+ final ImageButton minimizeBtn = new ImageButton(
+ Caption.IMAGES.windowMinimize());
+ minimizeBtn.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ windowPanel.setWindowState(WindowPanel.WindowState.NORMAL);
+ }
+ });
+ windowPanel.getHeader().add(minimizeBtn, captionRegion);
+ }
+
+}
Copied: projects/gwt-console/trunk/war/src/main/resources/mvc4g-conf.xml (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/resources/mvc4g-conf.xml)
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/mvc4g-conf.xml (rev 0)
+++ projects/gwt-console/trunk/war/src/main/resources/mvc4g-conf.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ Console MVC configuration
+ Further explanations canbe found here:
+ http://code.google.com/p/mvc4g
+ -->
+<mvc4g>
+ <controller name="mainController" class="com.mvc4g.client.Controller">
+ <views>
+ <view name="loginView" class="org.jboss.bpm.console.client.LoginView" />
+ </views>
+ <actions>
+ <action name="login" class="org.jboss.bpm.console.client.LoginAction" />
+ </actions>
+ </controller>
+
+ <start controllerName="mainController" actionName="login" />
+
+</mvc4g>
\ No newline at end of file
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml 2009-04-22 14:00:15 UTC (rev 4606)
@@ -3,12 +3,32 @@
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.json.JSON'/>
- <inherits name="com.google.gwt.i18n.I18N"/>
- <inherits name='com.gwtext.GwtExt' />
+ <inherits name="com.google.gwt.i18n.I18N"/>
<!-- Add gwt-log support, default level `DEBUG` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
+ <!-- Includes the public resources used by the GWT themes. Those files -->
+ <!-- do not inject a style sheet into the application. -->
+ <inherits name='com.google.gwt.user.theme.standard.StandardResources' />
+ <inherits name="com.google.gwt.user.theme.chrome.ChromeResources" />
+ <inherits name="com.google.gwt.user.theme.dark.DarkResources" />
+
+ <!-- Other module inherits -->
+ <inherits name='org.gwt.mosaic.core.Core' />
+ <inherits name='org.gwt.mosaic.ui.UI'/>
+ <inherits name="org.gwt.mosaic.forms.Forms"/>
+
+ <!-- mvc4g -->
+ <inherits name='com.mvc4g.Mvc4gModule'/>
+
+ <!-- Inherit the default GWT style sheet. You can change -->
+ <!-- the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <inherits name='com.google.gwt.user.theme.standard.Standard' />
+ <!-- <inherits name="com.google.gwt.user.theme.chrome.Chrome"/> -->
+ <!-- <inherits name="com.google.gwt.user.theme.dark.Dark"/> -->
+
<generate-with class="org.jboss.bpm.console.rebind.WorkspaceGenerator" >
<when-type-assignable class="org.jboss.bpm.console.client.WorkspaceLauncher"/>
</generate-with>
@@ -28,15 +48,19 @@
<set-property name="log_WindowLogger" value="DISABLED" />
<!-- Specify the app entry point class. -->
- <entry-point class='org.jboss.bpm.console.client.Application' />
+ <entry-point class='com.mvc4g.client.Mvc4gEntryPoint' />
<servlet path="/xhp" class="jmaki.xhp.XmlHttpProxyServlet"/>
+ <!-- Inherit the default GWT-Mosaic style sheet. You can -->
+ <!-- change the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <stylesheet src="gwt/standard/Mosaic.css" />
+ <!-- <stylesheet src="gwt/chrome/Mosaic.css" /> -->
+ <!-- <stylesheet src="gwt/dark/Mosaic.css" /> -->
+
+
<!-- Specify a css to load into your gwt application -->
<stylesheet src='console.css' />
- <stylesheet src="js/ext/resources/css/ext-all.css" />
- <script src="js/ext/adapter/ext/ext-base.js" />
- <script src="js/ext/ext-all.js" />
-
</module>
\ No newline at end of file
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/Application.html 2009-04-22 14:00:15 UTC (rev 4606)
@@ -31,40 +31,7 @@
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic ui -->
<!-- -->
-<body style="font:sans-serif;">
-<p>
- <center>
- <br/>
- <table width=250 style="color:gray;position:relative;">
- <th colspan=3>Demo user accounts</th>
- <tr style="font-weight:bold">
- <td>Role</td>
- <td>Username</td>
- <td>Password</td>
- </tr>
- <tr>
- <td>Manager</td>
- <td>mike</td>
- <td>password</td>
- </tr>
- <tr>
- <td>User</td>
- <td>peter</td>
- <td>password</td>
- </tr>
- <tr>
- <td>User</td>
- <td>mary</td>
- <td>password</td>
- </tr>
- <tr>
- <td>Administrator</td>
- <td>alex</td>
- <td>password</td>
- </tr>
- </table>
- </center>
- </p>
+<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
Modified: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/console.css
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/console.css 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,44 +1,46 @@
.bpm-layout {
- border: 1px solid green;
- margin: 10px;
+ border: 1px solid green;
+ margin: 10px;
}
.bpm-header {
- height: 50px;
- width: 100%;
- background-color:#ffffff;
- background-image: url( images/Jbpm_logo_small.png);
- background-repeat:no-repeat;
+ background-color:#ffffff;
+ background-image: url( images/Jbpm_logo_small.png);
+ background-repeat:no-repeat;
}
.bpm-header-userinfo {
- float: right;
- position:relative; top: 10px; right:20px;
- font-family: sans-serif;
+ font-family: sans-serif;
+ width:150px;
}
+.bpm-editor-info {
+ font-family: sans-serif;
+ font-size:18px;
+}
+
.bpm-menu {
- height: 50px;
- width: 100%;
- border: 1px solid;
+ height: 50px;
+ width: 100%;
+ border: 1px solid;
}
.bpm-workspace {
- width: 100%;
- height:100%;
+ width: 100%;
+ height:100%;
}
.bpm-label {
- font-family: sans-serif;
- font-size: small;
+ font-family: sans-serif;
+ font-size: small;
}
.bpm-ListHeaderRow {
- font-weight: bold;
+ font-weight: bold;
}
.bpm-EvenRow {
- background-color: #f0f4f8;
+ background-color: #f0f4f8;
}
.bpm-FieldValue {
@@ -49,131 +51,137 @@
}
+.bpm-loading-image {
+ background-color:#ffffff;
+ width:16pt;
+ height:16pt;
+}
+
.bpm-ProcessImage {
- border: 0px;
+ border: 0px;
}
.bpm-SplitPanel {
- border: 1px dashed green;
- vertical-align: top;
- position:relative; top:5px; left:5px;
+ border: 1px dashed green;
+ vertical-align: top;
+ position:relative; top:5px; left:5px;
}
.piechart-types {
- font-size: small;
- list-style-type:decimal;
- font-family: sans-serif;
+ font-size: small;
+ list-style-type:decimal;
+ font-family: sans-serif;
}
.bpm-help-panel {
- background-color:#F0F0F0;
- font-family: sans-serif;
- font-size: small;
+ background-color:#F0F0F0;
+ font-family: sans-serif;
+ font-size: small;
}
.bpm-help-icon {
- background-image: url( images/icons/14.png)
+ background-image: url( images/icons/14.png)
}
.bpm-report-icon {
- background-image: url( images/icons/31.png)
+ background-image: url( images/icons/31.png)
}
.bpm-process-icon {
- background-image: url( images/icons/41.png)
+ background-image: url( images/icons/41.png)
}
.bpm-task-icon {
- background-image: url( images/icons/29.png)
+ background-image: url( images/icons/29.png)
}
.bpm-instance-icon {
- background-image: url( images/icons/05_1.png)
+ background-image: url( images/icons/05_1.png)
}
.bpm-settings-icon {
-
+
}
.bpm-tools-icon {
- background-image: url( images/icons/36.png)
+ background-image: url( images/icons/36.png)
}
.bpm-switch-context-icon {
- background-image: url( images/icons/13.png)
+ background-image: url( images/icons/13.png)
}
.bpm-comment-icon {
- background-image: url( images/icons/27.png)
+ background-image: url( images/icons/27.png)
}
.bpm-enalrge-icon {
- background-image: url( images/icons/49.png)
+ background-image: url( images/icons/49.png)
}
.login-panel-content {
- text-align: center;
+ text-align: center;
}
.bpm-examine-icon {
- background-image: url( images/icons/examine.png)
+ background-image: url( images/icons/examine.png)
}
.bpm-add-icon {
- background-image: url( images/icons/add.png)
+ background-image: url( images/icons/add.png)
}
.bpm-lock-icon-small {
- background-image: url( images/icons/lock_small.png)
+ background-image: url( images/icons/lock_small.png)
}
.bpm-remove-icon {
- background-image: url( images/icons/remove.png)
+ background-image: url( images/icons/remove.png)
}
.bpm-play-icon {
- background-image: url( images/icons/play.png)
+ background-image: url( images/icons/play.png)
}
.bpm-stop-icon {
- background-image: url( images/icons/stop.png)
+ background-image: url( images/icons/stop.png)
}
.bpm-pause-icon {
- background-image: url( images/icons/pause.png)
+ background-image: url( images/icons/pause.png)
}
div.activeNode {
- position:absolute;
- border-width:1px;
- border-style:solid;
- border-color:#6699CC;
+ position:absolute;
+ border-width:1px;
+ border-style:solid;
+ border-color:#6699CC;
}
div.activeNode-header {
- position:absolute;
- overflow:hidden;
+ position:absolute;
+ overflow:hidden;
}
div.activeNode-header-link {
- cursor:default;
- font-family:sans-serif;
- font-size:10px;
- white-space:nowrap;
- color:#ffffff;
- padding-left:3px;
- padding-right:3px;
- border-width:1px;
- border-style:solid;
- border-color:#6699CC;
- background-color:#6699CC;
+ cursor:default;
+ font-family:sans-serif;
+ font-size:10px;
+ white-space:nowrap;
+ color:#ffffff;
+ padding-left:3px;
+ padding-right:3px;
+ border-width:1px;
+ border-style:solid;
+ border-color:#6699CC;
+ background-color:#6699CC;
}
div.activeNode-header-link a {
- color:#ffffff;
- text-decoration:none;
+ color:#ffffff;
+ text-decoration:none;
}
div.activeNode-header-link a:hover {
- text-decoration:underline;
+ text-decoration:underline;
}
\ No newline at end of file
Copied: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/images/icons/error.png)
===================================================================
(Binary files differ)
Copied: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/images/loading-circle.gif)
===================================================================
(Binary files differ)
Copied: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/images/loading.gif)
===================================================================
(Binary files differ)
Copied: projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js (from rev 4605, projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js)
===================================================================
--- projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js (rev 0)
+++ projects/gwt-console/trunk/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js 2009-04-22 14:00:15 UTC (rev 4606)
@@ -0,0 +1,123 @@
+// This file contains a simple Javascript broker that encapsulates
+// the AJAST technique, allowing for cross-domain REST
+// (REpresentatoinal State Transfer) calls.
+//
+// Copyright (c) 2008 Håvard Stranden <havard.stranden at gmail.com>
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+if(typeof(OX) === 'undefined') OX = {};
+OX.AJAST =
+{
+ Broker : function(url, callbackparameter, optional_decode_json_response, optional_timeout_milliseconds, optional_default_params)
+ {
+ this.url = url;
+ this.cb = callbackparameter;
+ this.params = [];
+ this.timeout = optional_timeout_milliseconds || 5000; // Timeout in milliseconds
+ if(typeof(optional_default_params) !== 'undefined')
+ {
+ for(p in optional_default_params)
+ this.params.push(p + '=' + encodeURIComponent(optional_default_params[p]));
+ }
+
+ this.jsonmode = optional_decode_json_response || false;
+ },
+
+ __callbacks__ : {},
+
+ __callid__ : 1,
+
+ call: function(url, callbackparameter, callbackfunction, optional_timeout, optional_decode_json_response)
+ {
+ var callbackid = 'callback' + OX.AJAST.__callid__;
+
+ // Append callback parameter (this also implicitly avoids caching, since the callback id is different for each call)
+ url += '&' + encodeURIComponent(callbackparameter) + '=' + encodeURIComponent('OX.AJAST.__callbacks__.' + callbackid);
+
+ // Create script tag for the call
+ var tag = OX.AJAST.createScriptTag(url);
+ // Get the head of the document
+ var head = document.getElementsByTagName('head').item(0);
+
+
+ // Create a timeout function
+ var timedout = function()
+ {
+ if(OX.AJAST.__callbacks__[callbackid] !== 'undefined') // If the callback still exists...
+ {
+ // Replace original wrapped callback with a dummy that just deletes itself
+ OX.AJAST.__callbacks__[callbackid] = function(){ delete OX.AJAST.__callbacks__[callbackid]; };
+ // Signal that the call timed out
+ callbackfunction(false);
+ // Remove the script tag (timed out)
+ head.removeChild(tag);
+ }
+ };
+
+ // Create timer for the timeout function
+ var timer = setTimeout(timedout, optional_timeout || 5000);
+
+ var decode_response = optional_decode_json_response || false;
+
+ // Create the callback function
+ OX.AJAST.__callbacks__[callbackid] = function(data)
+ {
+ // Clear the timeout
+ clearTimeout(timer);
+
+ if(typeof(data) === 'undefined')
+ callbackfunction(false); // Callback with nothing
+ else
+ {
+ callbackfunction(true, decode_response ? eval(data) : data);
+ }
+ // Replace original callback with a dummy function
+ delete OX.AJAST.__callbacks__[callbackid];
+ // Remove the script tag (finished)
+ head.removeChild(tag);
+ };
+
+ // Inject the call
+ head.appendChild(tag);
+ },
+
+ createScriptTag: function(url)
+ {
+ var s = document.createElement('script');
+ s.setAttribute('type', 'text/javascript');
+ s.setAttribute('id', 'oxajastcall' + OX.AJAST.Broker.__callid__++);
+ s.setAttribute('src', url);
+ return s;
+ }
+};
+
+OX.AJAST.Broker.prototype.call = function(params, callback)
+{
+ // Create arguments
+ var args = [];
+ for(p in params)
+ args.push(p + '=' + encodeURIComponent(params[p]));
+ for(p in this.params)
+ args.push(this.params[p]);
+ OX.AJAST.call(this.url + '?' + args.join('&'), this.cb, callback, this.timeout, this.jsonmode);
+};
\ No newline at end of file
Deleted: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/AbstractConsoleTC.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/AbstractConsoleTC.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/AbstractConsoleTC.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,89 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.junit.client.GWTTestCase;
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.core.client.GWT;
-
-import java.util.Map;
-
-/**
- * Base class for console tests
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class AbstractConsoleTC extends GWTTestCase
-{
-
- protected static Application application = null;
- protected static final String GWT_TEST_HARNESS = "GWT_Test_Harness";
- protected URLBuilder urlBuilder;
-
- public String getModuleName()
- {
- return "org.jboss.bpm.console.Application";
- }
-
- protected void gwtSetUp() throws Exception
- {
- super.gwtSetUp();
-
- if(null==application)
- {
- application = new Application();
- application.onModuleLoad2();
- }
-
- String proxyUrl = GWT.getModuleBaseURL() + "xhp";
- ConsoleConfig config = new ConsoleConfig(proxyUrl, proxyUrl);
- urlBuilder = new URLBuilder(config);
- }
-
- protected abstract class ChainedTimer extends Timer
- {
- protected Map<String,Object> context;
-
- protected ChainedTimer(Map<String, Object> context)
- {
- this.context = context;
- }
-
- protected void proceedOrFinish()
- {
-
- ChainedTimer next = getNext();
- if(next !=null)
- {
- next.schedule(2000);
- delayTestFinish(5000);
- }
- else
- {
- finishTest();
- }
- }
-
- public abstract ChainedTimer getNext();
-
- }
-}
Deleted: projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java
===================================================================
--- projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java 2009-04-22 13:23:11 UTC (rev 4605)
+++ projects/gwt-console/trunk/war/src/test/java/org/jboss/bpm/console/client/GwtTestProcessManagement.java 2009-04-22 14:00:15 UTC (rev 4606)
@@ -1,278 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client;
-
-import com.google.gwt.http.client.Request;
-import com.google.gwt.http.client.RequestBuilder;
-import com.google.gwt.http.client.RequestCallback;
-import com.google.gwt.http.client.Response;
-import com.gwtext.client.widgets.ComponentMgr;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.process.ProcessDefinitionList;
-import org.jboss.bpm.console.client.process.ProcessEditor;
-import org.jboss.bpm.console.client.process.ProcessInstanceListView;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class GwtTestProcessManagement extends AbstractConsoleTC
-{
- public void testProcessManagement()
- {
- System.out.println("=== testProcessInstanceEditor ===");
-
- final ProcessEditor editor = (ProcessEditor)
- ComponentMgr.getComponent(ProcessEditor.ID);
-
- Map<String, Object> context = new HashMap<String, Object>();
- context.put("editor", editor);
-
- DeployTestHarnessTimer deployTimer = new DeployTestHarnessTimer(context);
- AuthenticationTimer authTimer = new AuthenticationTimer(context,"admin", "admin");
- LoadTestHarnessTimer loadingTimer = new LoadTestHarnessTimer(context);
- InstanceEditorTimer instanceTimer = new InstanceEditorTimer(context);
- UndeployTimer undeployTimer = new UndeployTimer(context);
-
- context.put("deployFollow", authTimer);
- context.put("authFollow", loadingTimer);
- context.put("loadFollow", instanceTimer);
- context.put("instanceFollow", undeployTimer);
-
- // trigger first timer
- deployTimer.schedule(1000);
- delayTestFinish(2000);
-
- }
-
- class DeployTestHarnessTimer extends ChainedTimer
- {
-
- protected DeployTestHarnessTimer(Map<String, Object> context)
- {
- super(context);
- }
-
- public void run()
- {
- String url = urlBuilder.getDeployTestHarnessUrl();
- RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
- try
- {
- rb.sendRequest("",
- new RequestCallback()
- {
-
- public void onResponseReceived(Request request, Response response)
- {
- if(response.getStatusCode()!=200)
- throw new RuntimeException("HTTP status " + response.getStatusCode());
-
- proceedOrFinish();
- }
-
- public void onError(Request request, Throwable t)
- {
- throw new RuntimeException("Connection problem", t);
- }
- }
- );
- }
- catch (Throwable e)
- {
- throw new RuntimeException("Failed to remove process definition", e);
- }
- }
-
- public ChainedTimer getNext()
- {
- return (ChainedTimer)context.get("deployFollow");
- }
- }
- class LoadTestHarnessTimer extends ChainedTimer
- {
-
- public LoadTestHarnessTimer(Map<String, Object> context)
- {
- super(context);
- }
-
- public ChainedTimer getNext()
- {
- return (ChainedTimer)context.get("loadFollow");
- }
-
- public void run()
- {
- ProcessEditor editor = (ProcessEditor) context.get("editor");
- editor.resetEditor();
- ProcessDefinitionList list = editor.getProcessDefinitionList();
- proceedOrFinish();
- }
- }
-
- class InstanceEditorTimer extends ChainedTimer
- {
- public InstanceEditorTimer(Map<String, Object> context)
- {
- super(context);
- }
-
-
- public ChainedTimer getNext()
- {
- return (ChainedTimer)context.get("instanceFollow");
- }
-
- public void run()
- {
- ProcessEditor editor = (ProcessEditor)context.get("editor");
- ProcessDefinitionList list = editor.getProcessDefinitionList();
-
- List<ProcessDefinitionRef> processDefinitions = list.getAvailableProcessDefinitions();
- ProcessDefinitionRef testPd = getTestProcessDefinition(processDefinitions);
- assertNotNull("No test definition given: " +processDefinitions, testPd);
-
- list.launchInstanceView(testPd); // will create an instance editor
-
- // lookup instance editor
- String editorId = ProcessInstanceListView.createWidgetID(testPd);
- ProcessInstanceListView instanceView = (ProcessInstanceListView)
- ComponentMgr.getComponent(editorId);
- assertNotNull("Failed to create instance editor for process", instanceView);
-
- // todo: start new instance
- System.out.println("FIXME: Implement instance creation test");
-
- List<ProcessDefinitionRef> defs = list.getAvailableProcessDefinitions();
- assertFalse(defs.isEmpty());
-
- proceedOrFinish();
- }
- }
-
- private ProcessDefinitionRef getTestProcessDefinition(List<ProcessDefinitionRef> list)
- {
- ProcessDefinitionRef def =null;
- for(ProcessDefinitionRef pd : list)
- {
- if(pd.getName().equals(GWT_TEST_HARNESS))
- {
- def=pd;
- break;
- }
- }
- return def;
- }
-
- class UndeployTimer extends ChainedTimer
- {
- public UndeployTimer(Map<String, Object> context)
- {
- super(context);
- }
-
- public ChainedTimer getNext()
- {
- return (ChainedTimer)context.get("undeployFollow");
- }
-
- public void run()
- {
- String deleteUrl = urlBuilder.getUndeployTestHarnessUrl();
- RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, deleteUrl);
- try
- {
-
- rb.sendRequest("",
- new RequestCallback()
- {
-
- public void onResponseReceived(Request request, Response response)
- {
- if(response.getStatusCode()!=200)
- throw new RuntimeException("HTTP status " + response.getStatusCode());
- }
-
- public void onError(Request request, Throwable t)
- {
- throw new RuntimeException("Connection problem", t);
- }
- }
- );
- }
- catch (Throwable e)
- {
- throw new RuntimeException("Failed to remove process definition", e);
- }
-
- proceedOrFinish();
- }
- }
-
- class AuthenticationTimer extends ChainedTimer
- {
- String user;
- String pass;
-
- public AuthenticationTimer(Map<String,Object> context, String user, String pass)
- {
- super(context);
-
- this.user = user;
- this.pass = pass;
- }
-
-
- public ChainedTimer getNext()
- {
- return (ChainedTimer)context.get("authFollow");
- }
-
- public void run()
- {
-
- String inRoleURL = urlBuilder.getUserInRoleURL(Application.KNOWN_ROLES);
- final Authentication auth = new Authentication(inRoleURL);
- auth.setCallback(
- new Authentication.AuthCallback() {
-
- public void onLoginSuccess(Request request, Response response) {
- System.out.println("Assigned roles: " + auth.getRolesAssigned() );
-
- // only proceed when authentication was successfull
- proceedOrFinish();
- }
-
- public void onLoginFailed(Request request, Throwable t) {
-
- throw new RuntimeException("Login failed", t);
- }
- }
- );
- auth.doLogin(user,pass);
- }
- }
-}
More information about the jbpm-commits
mailing list