Author: heiko.braun(a)jboss.com
Date: 2010-02-02 09:57:28 -0500 (Tue, 02 Feb 2010)
New Revision: 948
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
Log:
Add loading overlay to remaining tools
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -63,7 +63,7 @@
private Controller controller;
- public final static String[] KNOWN_ROLES = {"admin", "manager",
"user"};
+ public final static String[] KNOWN_ROLES = {"administrator",
"manager", "user"};
public LoginView()
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/DeploymentListView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -40,9 +40,12 @@
import org.gwt.mosaic.ui.client.layout.*;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.common.DataDriven;
+import org.jboss.bpm.console.client.common.LoadingOverlay;
import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
import org.jboss.bpm.console.client.model.DeploymentRef;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.bus.server.annotations.security.RequireRoles;
import org.jboss.errai.common.client.framework.WSComponent;
import org.jboss.errai.workspaces.client.Registry;
import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
@@ -55,7 +58,8 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@LoadTool(name = "Deployments", group = "Runtime",
icon="deploymentIcon")
-public class DeploymentListView implements ViewInterface, WSComponent
+@RequireRoles({"administrator"})
+public class DeploymentListView implements ViewInterface, WSComponent, DataDriven
{
public final static String ID = DeploymentListView.class.getName();
@@ -88,7 +92,6 @@
}
- @Override
public Widget getWidget()
{
panel = new MosaicPanel(new BorderLayout());
@@ -110,21 +113,6 @@
controller.addView(DeploymentListView.ID, this);
- // ----
-
- Timer t = new Timer()
- {
- @Override
- public void run()
- {
- controller.handleEvent(
- new Event(UpdateDeploymentsAction.ID, null)
- );
- }
- };
-
- t.schedule(50);
-
return panel;
}
@@ -296,6 +284,19 @@
detailView = new DeploymentDetailView();
controller.addView(DeploymentDetailView.ID, detailView);
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(
+ new Event(UpdateDeploymentsAction.ID, null)
+ );
+ }
+ };
+
+ t.schedule(500);
+
initialized = true;
}
}
@@ -308,22 +309,40 @@
return selection;
}
- public void update(List<DeploymentRef> deployments)
+ public void reset()
{
- this.deployments = deployments;
+ final DefaultListModel<DeploymentRef> model =
+ (DefaultListModel<DeploymentRef>) listBox.getModel();
+ model.clear();
+
+ // clear details
+ controller.handleEvent(
+ new Event(UpdateDeploymentDetailAction.ID, null)
+ );
+ }
+
+ public void update(Object... data)
+ {
+ this.deployments = (List<DeploymentRef>)data[0];
+
renderFiltered();
}
+ public void setLoading(boolean isLoading)
+ {
+ LoadingOverlay.on(deploymentList, isLoading);
+ }
+
private void renderFiltered()
{
if(this.deployments!=null)
{
+ reset();
+
final DefaultListModel<DeploymentRef> model =
(DefaultListModel<DeploymentRef>) listBox.getModel();
- model.clear();
-
for(DeploymentRef dpl : deployments)
{
if(FILTER_NONE==currentFilter)
@@ -341,10 +360,6 @@
if(listBox.getSelectedIndex()!=-1)
listBox.setItemSelected(listBox.getSelectedIndex(), false);
- // clear details
- controller.handleEvent(
- new Event(UpdateDeploymentDetailAction.ID, null)
- );
}
}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/JobListView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -25,6 +25,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
+import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.Widget;
@@ -38,8 +39,11 @@
import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
import org.gwt.mosaic.ui.client.layout.MosaicPanel;
import org.gwt.mosaic.ui.client.list.DefaultListModel;
+import org.jboss.bpm.console.client.common.DataDriven;
+import org.jboss.bpm.console.client.common.LoadingOverlay;
import org.jboss.bpm.console.client.model.JobRef;
import org.jboss.bpm.console.client.util.SimpleDateFormat;
+import org.jboss.errai.bus.server.annotations.security.RequireRoles;
import org.jboss.errai.common.client.framework.WSComponent;
import org.jboss.errai.workspaces.client.Registry;
import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
@@ -54,7 +58,8 @@
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@LoadTool(name = "Jobs", group = "Runtime",
icon="jobsIcon")
-public class JobListView implements ViewInterface, WSComponent
+@RequireRoles({"administrator"})
+public class JobListView implements ViewInterface, WSComponent, DataDriven
{
public final static String ID = JobListView.class.getName();
@@ -83,8 +88,7 @@
{
controller = Registry.get(Controller.class);
}
-
- @Override
+
public Widget getWidget()
{
panel = new MosaicPanel();
@@ -259,28 +263,52 @@
layout.add(detailsView, new BorderLayoutData(BorderLayout.Region.SOUTH, 10,200));
*/
+ Timer t = new Timer()
+ {
+ @Override
+ public void run()
+ {
+ controller.handleEvent(new Event(UpdateJobsAction.ID, null));
+ }
+ };
+
+ t.schedule(500);
+
controller.addAction(UpdateJobsAction.ID, new UpdateJobsAction());
this.initialized = true;
}
}
- public void update(List<JobRef> jobs)
+ public void reset()
{
- this.jobs = jobs;
+ final DefaultListModel<JobRef> model =
+ (DefaultListModel<JobRef>) listBox.getModel();
+ model.clear();
+
+ }
+
+ public void update(Object... data)
+ {
+ this.jobs = (List<JobRef>)data[0];
renderFiltered();
}
+ public void setLoading(boolean isLoading)
+ {
+ LoadingOverlay.on(jobList, isLoading);
+ }
+
private void renderFiltered()
{
if(this.jobs!=null)
{
+ reset();
+
final DefaultListModel<JobRef> model =
(DefaultListModel<JobRef>) listBox.getModel();
- model.clear();
-
for(JobRef def : jobs)
{
if(FILTER_NONE==currentFilter)
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateDeploymentsAction.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -29,6 +29,7 @@
import com.mvc4g.client.Event;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.common.DataDriven;
import org.jboss.bpm.console.client.model.DTOParser;
import org.jboss.bpm.console.client.model.DeploymentRef;
import org.jboss.bpm.console.client.process.UpdateDefinitionsAction;
@@ -60,6 +61,12 @@
return RequestBuilder.GET;
}
+ @Override
+ protected DataDriven getDataDriven(Controller controller)
+ {
+ return (DeploymentListView)controller.getView(DeploymentListView.ID);
+ }
+
public void handleSuccessfulResponse(
final Controller controller, final Object event, Response response)
{
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/engine/UpdateJobsAction.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -28,6 +28,7 @@
import com.mvc4g.client.Controller;
import org.jboss.bpm.console.client.URLBuilder;
import org.jboss.bpm.console.client.common.AbstractRESTAction;
+import org.jboss.bpm.console.client.common.DataDriven;
import org.jboss.bpm.console.client.model.DTOParser;
import org.jboss.bpm.console.client.model.JobRef;
@@ -55,6 +56,12 @@
return RequestBuilder.GET;
}
+ @Override
+ protected DataDriven getDataDriven(Controller controller)
+ {
+ return (JobListView)controller.getView(JobListView.ID);
+ }
+
public void handleSuccessfulResponse(final Controller controller, final Object event,
Response response)
{
JSONValue json = JSONParser.parse(response.getText());
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/DefinitionListView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -100,7 +100,7 @@
}
};
- t.schedule(50);
+ t.schedule(500);
return panel;
}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -285,7 +285,7 @@
}
};
- t.schedule(50);
+ t.schedule(500);
isInitialized = true;
}
Modified:
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java
===================================================================
---
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-02-02
11:57:15 UTC (rev 947)
+++
bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/OpenTasksView.java 2010-02-02
14:57:28 UTC (rev 948)
@@ -263,7 +263,7 @@
}
};
- t.schedule(50);
+ t.schedule(500);
isInitialized = true;
}