Author: heiko.braun(a)jboss.com
Date: 2009-04-21 10:26:36 -0400 (Tue, 21 Apr 2009)
New Revision: 4593
Added:
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java
Modified:
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
Log:
Enable scrolling in error window
Modified:
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java
===================================================================
---
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-04-21
14:08:03 UTC (rev 4592)
+++
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/MainLayout.java 2009-04-21
14:26:36 UTC (rev 4593)
@@ -134,7 +134,9 @@
err.getHeader().add( new Image("images/icons/error.png") );
err.setAnimationEnabled(true);
err.setSize("320px", "240px");
- err.setWidget( new HTML(message) );
+ ScrollLayoutPanel scrollLayoutPanel = new ScrollLayoutPanel();
+ scrollLayoutPanel.add(new HTML(message));
+ err.setWidget(scrollLayoutPanel);
WindowUtil.addMaximizeButton(err, Caption.CaptionRegion.RIGHT);
WindowUtil.addMinimizeButton(err, Caption.CaptionRegion.RIGHT);
Added:
projects/gwt-console/branches/hbraun/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
(rev 0)
+++
projects/gwt-console/branches/hbraun/war/src/main/java/org/jboss/bpm/console/client/process/LoadInstancesAction.java 2009-04-21
14:26:36 UTC (rev 4593)
@@ -0,0 +1,81 @@
+/*
+ * 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.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(a)jboss.com>
+ */
+class LoadInstancesAction extends AbstractDataRequestAction
+{
+ public final static String ID = LoadInstancesAction.class.getName();
+
+ public LoadInstancesAction(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ String getId()
+ {
+ return ID;
+ }
+
+ String getUrl(Object event)
+ {
+ final ProcessDefinitionRef def = (ProcessDefinitionRef)event;
+ return appContext.getUrlBuilder().getProcessInstancesURL(def.getId());
+ }
+
+ RequestBuilder.Method getRequestMethod()
+ {
+ return RequestBuilder.GET;
+ }
+
+ protected 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);
+
+ }
+
+}
+