[overlord-commits] Overlord SVN: r929 - in bpm-console/trunk: gui/war/src/main/java/org/jboss/bpm/console and 16 other directories.
overlord-commits at lists.jboss.org
overlord-commits at lists.jboss.org
Mon Jan 25 07:15:45 EST 2010
Author: heiko.braun at jboss.com
Date: 2010-01-25 07:15:43 -0500 (Mon, 25 Jan 2010)
New Revision: 929
Added:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/
bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml
Removed:
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
Modified:
bpm-console/trunk/gui/war/pom.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
bpm-console/trunk/gui/war/war/app.html
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
Log:
Introduce split points per editor. Start migrating API into errai package
Modified: bpm-console/trunk/gui/war/pom.xml
===================================================================
--- bpm-console/trunk/gui/war/pom.xml 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/pom.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -526,25 +526,5 @@
</profile>
</profiles>
-
- <reporting>
- <excludeDefaults>true</excludeDefaults>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>gwt-maven-plugin</artifactId>
- <reportSets>
- <reportSet>
- <reports>
- <report>soyc</report>
- </reports>
- </reportSet>
- </reportSets>
- <configuration>
- <extra>target</extra>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
+
</project>
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/Application.gwt.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -9,6 +9,7 @@
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name="com.google.gwt.user.ImageBundle"/>
<inherits name="com.google.gwt.xml.XML" />
+ <inherits name="org.jboss.BPMWorkspace" />
<!-- Add gwt-log support, default level `DEBUG` -->
<inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -29,6 +29,7 @@
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Bootstrap the console form server settings.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -42,6 +42,7 @@
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
import org.jboss.bpm.console.client.util.WindowUtil;
+import org.jboss.errai.workspaces.client.Registry;
import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
@@ -72,7 +73,8 @@
this.config = config;
Registry.set(ApplicationContext.class, this);
-
+ Registry.set(Controller.class, controller);
+
display();
}
@@ -192,7 +194,7 @@
private Workspace createWorkspace()
{
- Workspace workspace = new Workspace(menu, this);
+ Workspace workspace = new Workspace(menu);
WorkspaceLauncher launcher = GWT.create(WorkspaceLauncher.class);
launcher.launch(workspace); // calls Workspace.addEditor()
return workspace;
@@ -205,12 +207,7 @@
{
return viewport;
}
-
- public Controller getController()
- {
- return this.controller;
- }
-
+
public void displayMessage(final String message, final boolean isError)
{
if(isError)
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -32,6 +32,7 @@
import org.gwt.mosaic.ui.client.layout.GridLayout;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -28,7 +28,10 @@
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.*;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.GridLayout;
+import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.common.HeaderLabel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
@@ -59,7 +62,7 @@
tabPanel.add(deck, "Settings");
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+ this.add(tabPanel);
appContext.refreshView();
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/common/AbstractRESTAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -27,8 +27,8 @@
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.LoadingStatusAction;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.workspaces.client.Registry;
import java.io.IOException;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,26 +23,18 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
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.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* Manage runtime aspects of a process engine
* (currently jbpm only).
- *
+ *
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
public class EngineEditor extends Editor
@@ -51,83 +43,33 @@
private TabLayoutPanel tabPanel;
- private Map<String,Integer> view2index = new HashMap<String,Integer>();
+ //private Map<String,Integer> view2index = new HashMap<String,Integer>();
public void initialize()
{
if(!isInitialized)
{
-
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
-
- tabPanel.addTabListener(
- new TabListener()
+ EngineEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- boolean showTab = true;
- return showTab;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ EngineEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- appContext.refreshView(); // TODO: hack around rendering problems
- }
-
- // load jobs
- if(1==i)
- {
- controller.handleEvent(
- new Event(UpdateJobsAction.ID, null)
- );
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- // create and register views
- registerView(DeploymentListView.ID, new DeploymentListView());
- registerView(JobListView.ID, new JobListView(appContext));
-
- // create and register actions
- controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction());
- controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
- controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction());
- controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction());
- controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction());
- controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
-
- // force loading
- super.controller.handleEvent(
- new Event(UpdateDeploymentsAction.ID, null)
- );
-
- isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- view2index.put(id, tabPanel.getWidgetCount());
-
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
public String getEditorId()
{
return ID;
@@ -148,12 +90,4 @@
new EngineEditorNavigation(appContext)
);
}
-
- public void showView(String viewId)
- {
- if(viewId!=null)
- tabPanel.selectTab( view2index.get(viewId) );
- else
- tabPanel.selectTab(0);
- }
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,160 @@
+/*
+ * 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.engine;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+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.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class EngineEditorModule
+{
+
+ private static TabLayoutPanel tabPanel;
+
+ //private Map<String,Integer> view2index = new HashMap<String,Integer>();
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+
+ final ApplicationContext appContext = Registry.get(ApplicationContext.class);
+
+ // create inner tab layout
+ final TabLayoutPanel tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+
+ // load jobs
+ if(1==i)
+ {
+ controller.handleEvent(
+ new Event(UpdateJobsAction.ID, null)
+ );
+ }
+ }
+ }
+ );
+
+ // create and register views
+ registerView(controller, tabPanel, DeploymentListView.ID, new DeploymentListView());
+ registerView(controller, tabPanel, JobListView.ID, new JobListView(appContext));
+
+ // create and register actions
+ controller.addAction(UpdateDeploymentsAction.ID, new UpdateDeploymentsAction());
+ controller.addAction(UpdateDeploymentDetailAction.ID, new UpdateDeploymentDetailAction());
+ controller.addAction(DeleteDeploymentAction.ID, new DeleteDeploymentAction());
+ controller.addAction(SuspendDeploymentAction.ID, new SuspendDeploymentAction());
+ controller.addAction(ResumeDeploymentAction.ID, new ResumeDeploymentAction());
+ controller.addAction(ExecuteJobAction.ID, new ExecuteJobAction());
+
+ // display tab, needs to visible for correct rendering
+ //tabPanel.selectTab( view2index.get(DeploymentListView.ID ));
+
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ //view2index.put(id, tabPanel.getWidgetCount());
+
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/EngineEditorNavigation.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -49,11 +49,11 @@
if("Deployments".equals(treeItem.getText()))
{
- workspace.showEditor(EngineEditor.ID, DeploymentListView.ID);
+ workspace.showEditor(EngineEditor.ID, null);
}
else if("Jobs".equals(treeItem.getText()))
{
- workspace.showEditor(EngineEditor.ID, JobListView.ID);
+ workspace.showEditor(EngineEditor.ID, null);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/ViewDeploymentAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,8 +25,8 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.Workspace;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Cross editor view toggle.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -42,6 +42,7 @@
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
import org.jboss.bpm.console.client.process.events.InstanceEvent;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
@@ -74,10 +75,10 @@
private PagingPanel pagingPanel;
- public InstanceListView(ApplicationContext appContext)
+ public InstanceListView()
{
super();
- this.appContext = appContext;
+ this.appContext = Registry.get(ApplicationContext.class);
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
setTitle("Process Instances");
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,22 +23,14 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.MessageBox;
import org.gwt.mosaic.ui.client.TabLayoutPanel;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
-import static org.gwt.mosaic.ui.client.layout.BorderLayout.Region;
-
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
@@ -46,91 +38,33 @@
{
public final static String ID = ProcessEditor.class.getName();
- private TabLayoutPanel tabPanel;
+ private static TabLayoutPanel tabPanel;
public void initialize()
{
if(!isInitialized)
{
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ ProcessEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- 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;
- }
- }
-
- if(showTab)
- {
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- lazyPanel.initialize();
- }
-
- return showTab;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ ProcessEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
-
+ MessageBox.error("Error", "Failed to load module "+ID);
}
- }
+ }
);
-
- this.add(tabPanel, new BorderLayoutData(Region.CENTER));
-
- // create and register views
- registerView(DefinitionListView.ID, new DefinitionListView());
- registerView(InstanceListView.ID, new InstanceListView(appContext));
-
- // create and register actions
-
- registerAction(UpdateInstancesAction.ID, new UpdateInstancesAction());
- registerAction(StartNewInstanceAction.ID, new StartNewInstanceAction());
- registerAction(StateChangeAction.ID, new StateChangeAction());
- registerAction(DeleteDefinitionAction.ID, new DeleteDefinitionAction());
- registerAction(DeleteInstanceAction.ID, new DeleteInstanceAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(UpdateDefinitionsAction.ID, null)
- );
-
- appContext.refreshView();
-
- isInitialized = true;
}
}
-
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
+
public String getEditorId()
{
return ID;
@@ -148,7 +82,7 @@
return new MenuSection(
getTitle(),
AbstractImagePrototype.create(icons.processIcon()),
- new ProcessEditorNavigation(appContext)
+ new ProcessEditorNavigation(super.appContext)
);
}
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -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.process;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+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.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class ProcessEditorModule
+{
+ // the module instance; instantiate it behind a runAsync
+ private static TabLayoutPanel tabPanel;
+
+ /**
+ * Access the module's instance. The callback
+ * runs asynchronously, once the necessary
+ * code has downloaded.
+ */
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null) {
+ tabPanel = createTabPanel(controller);
+ }
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(UpdateDefinitionsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+ // create inner tab layout
+ final TabLayoutPanel 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;
+ }
+ }
+
+ if(showTab)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ lazyPanel.initialize();
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+
+ }
+ }
+ );
+
+ // create and register views
+ registerView(controller, tabPanel, DefinitionListView.ID, new DefinitionListView());
+ registerView(controller, tabPanel, InstanceListView.ID, new InstanceListView());
+
+ // create and register actions
+
+ registerAction(controller, UpdateInstancesAction.ID, new UpdateInstancesAction());
+ registerAction(controller, StartNewInstanceAction.ID, new StartNewInstanceAction());
+ registerAction(controller, StateChangeAction.ID, new StateChangeAction());
+ registerAction(controller, DeleteDefinitionAction.ID, new DeleteDefinitionAction());
+ registerAction(controller, DeleteInstanceAction.ID, new DeleteInstanceAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private static void registerAction(Controller controller, String name, ActionInterface action)
+ {
+ controller.addAction(name, action);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/RenderReportAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -27,8 +27,8 @@
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
import org.jboss.bpm.console.client.LoadingStatusAction;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.errai.workspaces.client.Registry;
import java.io.IOException;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -24,110 +24,50 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.*;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
-import com.mvc4g.client.ViewInterface;
import org.gwt.mosaic.ui.client.Caption;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
import org.gwt.mosaic.ui.client.ImageButton;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
-import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
import org.jboss.bpm.console.client.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public class ReportEditor extends Editor implements ViewInterface
+public class ReportEditor extends Editor
{
public final static String ID = ReportEditor.class.getName();
- private DecoratedTabLayoutPanel tabPanel;
+ private TabLayoutPanel tabPanel;
- public void setController(Controller controller)
- {
- }
-
public void initialize()
{
if(!isInitialized())
{
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ ReportEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- 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;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ ReportEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- // create and register views
- ReportView view = new ReportView();
- registerView(ReportView.ID, view);
- view.initialize();
-
- controller.addView(ID, this);
-
- // create and register actions
- registerAction(UpdateReportConfigAction.ID, new UpdateReportConfigAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // load report config
- controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
-
- appContext.refreshView();
-
- this.isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
public String getEditorId()
{
return ID;
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,152 @@
+/*
+ * 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.report;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+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.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class ReportEditorModule
+{
+ public final static String ID = ReportEditor.class.getName();
+
+ private static TabLayoutPanel tabPanel;
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(final Controller controller)
+ {
+ final TabLayoutPanel 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();
+ }
+ }
+ }
+ );
+
+ // create and register views
+ ReportView view = new ReportView();
+ registerView(controller, tabPanel, ReportView.ID, view);
+ view.initialize();
+
+ //controller.addView(ID, this);
+
+ // create and register actions
+ controller.addAction(UpdateReportConfigAction.ID, new UpdateReportConfigAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ // load report config
+ controller.handleEvent(new Event(UpdateReportConfigAction.ID, null));
+
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportLaunchPadView.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -34,12 +34,12 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.IconHeader;
import org.jboss.bpm.console.client.common.WidgetWindowPanel;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.report.model.ReportReference;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.Iterator;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/UpdateReportConfigAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,10 +25,10 @@
import com.google.gwt.http.client.Response;
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
import org.jboss.bpm.console.client.model.JSOParser;
import org.jboss.bpm.report.model.ReportReference;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.List;
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/ReloadAllTaskListsAction.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -25,7 +25,7 @@
import com.mvc4g.client.Controller;
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.ApplicationContext;
-import org.jboss.bpm.console.client.Registry;
+import org.jboss.errai.workspaces.client.Registry;
/**
* Reloads all task lists after assignment or completion of a task.
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -23,19 +23,13 @@
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.SourcesTabEvents;
-import com.google.gwt.user.client.ui.TabListener;
-import com.mvc4g.client.ActionInterface;
-import com.mvc4g.client.Event;
-import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
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.Editor;
-import org.jboss.bpm.console.client.LazyPanel;
import org.jboss.bpm.console.client.MenuSection;
-import org.jboss.bpm.console.client.common.AbstractView;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
/**
* @author Heiko.Braun <heiko.braun at jboss.com>
@@ -50,81 +44,27 @@
{
if(!isInitialized)
{
- // create inner tab layout
- tabPanel = new DecoratedTabLayoutPanel();
- tabPanel.setPadding(5);
- tabPanel.addTabListener(
- new TabListener()
+ TaskEditorModule.createAsync(
+ new EditorWidgetClient()
{
- public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onSuccess(EditorWidget editorWidget)
{
- return true;
+ tabPanel = (TabLayoutPanel)editorWidget.build();
+ TaskEditor.this.add(tabPanel);
+ editorWidget.loadData();
+ appContext.refreshView();
+ isInitialized = true;
}
- public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ public void onUnavailable()
{
- LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
- if(!lazyPanel.isInitialized())
- {
- lazyPanel.initialize();
- appContext.refreshView(); // TODO: hack around rendering problems
- }
+ MessageBox.error("Error", "Failed to load module "+ID);
}
}
);
-
- this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
-
- TaskDetailView openDetailView = new TaskDetailView(true);
- TaskDetailView assignedDetailView = new TaskDetailView(false);
-
- // create and register views
- controller.addView("OpenDetailView", openDetailView);
- controller.addView("AssignedDetailView", assignedDetailView);
-
- openDetailView.initialize();
- assignedDetailView.initialize();
-
- registerView(OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
- registerView(AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
-
- // create and register actions
- registerAction(LoadTasksAction.ID, new LoadTasksAction());
- registerAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction());
- registerAction(ClaimTaskAction.ID, new ClaimTaskAction());
- registerAction(ReleaseTaskAction.ID, new ReleaseTaskAction());
- registerAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
- registerAction(AssignTaskAction.ID, new AssignTaskAction());
- registerAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction());
-
- // display tab, needs to visible for correct rendering
- tabPanel.selectTab(0);
-
- // force loading
- super.controller.handleEvent(
- new Event(ReloadAllTaskListsAction.ID, null)
- );
-
- appContext.refreshView();
-
- isInitialized = true;
}
}
- private void registerView(String id, AbstractView view)
- {
- // register view with controller
- super.controller.addView(id, view);
-
- // add to tab layout
- this.tabPanel.add(view, view.getIconTitle(), true);
- }
-
- private void registerAction(String name, ActionInterface action)
- {
- super.controller.addAction(name, action);
- }
-
public String getEditorId()
{
return ID;
@@ -146,7 +86,7 @@
);
}
- public void showView(String viewId)
+ /*public void showView(String viewId)
{
if(viewId==null || viewId.equals("group"))
tabPanel.selectTab(0);
@@ -156,5 +96,5 @@
throw new IllegalArgumentException("Unknown viewId: "+viewId);
layout();
- }
+ } */
}
Added: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java (rev 0)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorModule.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,153 @@
+/*
+ * 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.core.client.GWT;
+import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.user.client.Timer;
+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.Controller;
+import com.mvc4g.client.Event;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.TabLayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.errai.workspaces.client.EditorWidget;
+import org.jboss.errai.workspaces.client.EditorWidgetClient;
+import org.jboss.errai.workspaces.client.Registry;
+
+public class TaskEditorModule
+{
+
+ private static TabLayoutPanel tabPanel;
+
+ public static void createAsync(
+ final EditorWidgetClient client)
+ {
+ GWT.runAsync(new RunAsyncCallback() {
+ public void onFailure(Throwable err) {
+ client.onUnavailable();
+ }
+
+ public void onSuccess() {
+
+ final Controller controller = Registry.get(Controller.class);
+
+ if (tabPanel == null)
+ tabPanel = createTabPanel(controller);
+
+ client.onSuccess(
+ new EditorWidget()
+ {
+ public Widget build()
+ {
+ return tabPanel;
+ }
+
+ public void loadData()
+ {
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(ReloadAllTaskListsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(50);
+ }
+ }
+ );
+ }
+ });
+ }
+
+ private static TabLayoutPanel createTabPanel(Controller controller)
+ {
+ // create inner tab layout
+ final ApplicationContext appContext= Registry.get(ApplicationContext.class);
+
+ final TabLayoutPanel 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();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ TaskDetailView openDetailView = new TaskDetailView(true);
+ TaskDetailView assignedDetailView = new TaskDetailView(false);
+
+ // create and register views
+ controller.addView("OpenDetailView", openDetailView);
+ controller.addView("AssignedDetailView", assignedDetailView);
+
+ openDetailView.initialize();
+ assignedDetailView.initialize();
+
+ registerView(controller, tabPanel, OpenTasksView.ID, new OpenTasksView(appContext, openDetailView));
+ registerView(controller, tabPanel, AssignedTasksView.ID, new AssignedTasksView(appContext, assignedDetailView));
+
+ // create and register actions
+ controller.addAction(LoadTasksAction.ID, new LoadTasksAction());
+ controller.addAction(LoadTasksParticipationAction.ID, new LoadTasksParticipationAction());
+ controller.addAction(ClaimTaskAction.ID, new ClaimTaskAction());
+ controller.addAction(ReleaseTaskAction.ID, new ReleaseTaskAction());
+ controller.addAction(UpdateDetailsAction.ID, new UpdateDetailsAction());
+ controller.addAction(AssignTaskAction.ID, new AssignTaskAction());
+ controller.addAction(ReloadAllTaskListsAction.ID, new ReloadAllTaskListsAction());
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ return tabPanel;
+ }
+
+ private static void registerView(Controller controller, TabLayoutPanel tabPanel, String id, AbstractView view)
+ {
+ // register view with controller
+ controller.addView(id, view);
+
+ // add to tab layout
+ tabPanel.add(view, view.getIconTitle(), true);
+ }
+}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditorNavigation.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -44,15 +44,15 @@
{
public void onTreeItemSelected(TreeItem treeItem)
{
+ Workspace workspace = appContext.getWorkpace();
+
if("Group Tasks".equals(treeItem.getText()))
{
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(TaskEditor.ID, "group");
+ workspace.showEditor(TaskEditor.ID, null);
}
else if("Personal Tasks".equals(treeItem.getText()))
- {
- Workspace workspace = appContext.getWorkpace();
- workspace.showEditor(TaskEditor.ID, "personal");
+ {
+ workspace.showEditor(TaskEditor.ID, null);
}
}
Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/rebind/WorkspaceGenerator.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -104,7 +104,7 @@
new ClassSourceFileComposerFactory(packageName, className);
// Imports
- composerFactory.addImport("org.jboss.bpm.console.client.ApplicationContext");
+ //composerFactory.addImport("org.jboss.bpm.console.client.ApplicationContext");
composerFactory.addImport("org.jboss.bpm.console.client.Workspace");
composerFactory.addImport("org.jboss.bpm.console.client.WorkspaceLauncher");
Modified: bpm-console/trunk/gui/war/war/app.html
===================================================================
--- bpm-console/trunk/gui/war/war/app.html 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/gui/war/war/app.html 2010-01-25 12:15:43 UTC (rev 929)
@@ -12,7 +12,7 @@
<!-- -->
<script type="text/javascript" language="javascript" src="app/app.nocache.js"></script>
- <link rel="stylesheet" href="/console.css" type="text/css">
+ <link rel="stylesheet" href="../console.css" type="text/css">
<style type="text/css">
html, body { height: 100%; overflow: hidden; margin: 0; padding: 0; }
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/ApplicationContext.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -21,7 +21,6 @@
*/
package org.jboss.bpm.console.client;
-import com.mvc4g.client.Controller;
import org.gwt.mosaic.ui.client.Viewport;
/**
@@ -39,8 +38,6 @@
ConsoleConfig getConfig();
- Controller getController();
-
Viewport getViewport();
void refreshView();
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -22,7 +22,7 @@
package org.jboss.bpm.console.client;
import com.mvc4g.client.Controller;
-import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import org.jboss.errai.workspaces.client.Registry;
/**
@@ -45,7 +45,9 @@
*
* @author Heiko.Braun <heiko.braun at jboss.com>
*/
-public abstract class Editor extends org.gwt.mosaic.ui.client.layout.LayoutPanel implements LazyPanel
+public abstract class Editor
+ extends org.gwt.mosaic.ui.client.layout.LayoutPanel
+ implements LazyPanel
{
protected ApplicationContext appContext;
@@ -55,14 +57,9 @@
public Editor()
{
- super(new BorderLayout());
+ super();
this.appContext = Registry.get(ApplicationContext.class);
-
- // hmvc controller chain.
- //this.controller = new Controller();
- //this.controller.setParent(appContext.getController());
-
- this.controller = appContext.getController();
+ this.controller = Registry.get(Controller.class);
}
public boolean isInitialized()
Deleted: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Registry.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -1,52 +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 java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class Registry
-{
- private static Map<Class, Object> registry = new HashMap<Class,Object>();
-
- public static void set(Class key, Object obj)
- {
- registry.put(key, obj);
- }
-
- public static <T> T get(Class<T> key)
- {
- T t = (T) registry.get(key);
- if(null==t)
- throw new IllegalArgumentException(key + " not registered");
- return t;
- }
-
- public static boolean has(Class key)
- {
- return get(key)!=null;
- }
-
-}
Modified: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-22 10:33:38 UTC (rev 928)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/bpm/console/client/Workspace.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -24,6 +24,7 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import org.gwt.mosaic.ui.client.DeckLayoutPanel;
+import org.jboss.errai.workspaces.client.Registry;
import java.util.ArrayList;
import java.util.List;
@@ -38,15 +39,20 @@
protected ApplicationContext appContext;
private Menu menu;
- public Workspace(Menu menu, ApplicationContext appContext)
+ public Workspace(Menu menu)
{
super();
- this.appContext = appContext;
+ this.appContext = Registry.get(ApplicationContext.class);
this.menu = menu;
this.setPadding(5);
}
+ /**
+ * Invoked from through derferred binding
+ * @param editor
+ * @param closeable
+ */
public void addEditor(Editor editor, boolean closeable)
{
// Menu
@@ -77,9 +83,10 @@
throw new IllegalArgumentException("No such editor: " +editorId);
Workspace.this.showWidget(deck.index);
+
deck.editor.initialize();
deck.editor.showView(viewId);
-
+
// display editor
DeferredCommand.addCommand(
new Command()
@@ -89,12 +96,12 @@
}
}
);
+
}
private EditorDeck createDeck(Editor editor)
{
EditorDeck deck = new EditorDeck(editor);
- deck.add(editor);
return deck;
}
@@ -136,6 +143,7 @@
{
super();
this.editor = editor;
+ this.add(editor);
}
}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidget.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,33 @@
+/*
+ * 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.errai.workspaces.client;
+
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * An editor widget wrapper for widget that are loaded asynchronously.
+ */
+public interface EditorWidget
+{
+ Widget build();
+ void loadData();
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/EditorWidgetClient.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,32 @@
+/*
+ * 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.errai.workspaces.client;
+
+/**
+ * A callback for using the module instance once it's loaded.
+ * Used for code splitting.
+ */
+public interface EditorWidgetClient
+{
+ void onSuccess(EditorWidget instance);
+ void onUnavailable();
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/java/org/jboss/errai/workspaces/client/Registry.java 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,52 @@
+/*
+ * 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.errai.workspaces.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class Registry
+{
+ private static Map<Class, Object> registry = new HashMap<Class,Object>();
+
+ public static void set(Class key, Object obj)
+ {
+ registry.put(key, obj);
+ }
+
+ public static <T> T get(Class<T> key)
+ {
+ T t = (T) registry.get(key);
+ if(null==t)
+ throw new IllegalArgumentException(key + " not registered");
+ return t;
+ }
+
+ public static boolean has(Class key)
+ {
+ return get(key)!=null;
+ }
+
+}
Added: bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml
===================================================================
--- bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml (rev 0)
+++ bpm-console/trunk/workspace/workspace-api/src/main/resources/org/jboss/BPMWorkspace.gwt.xml 2010-01-25 12:15:43 UTC (rev 929)
@@ -0,0 +1,9 @@
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
+ "http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">
+
+<module>
+
+ <source path="errai/workspaces/client"/>
+ <source path="bpm/console/client"/>
+
+</module>
More information about the overlord-commits
mailing list