[jbpm-commits] JBoss JBPM SVN: r4888 - in projects/gwt-console/trunk/gui/war/src/main/java: javax/xml/bind/helpers and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon May 25 11:13:51 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-05-25 11:13:50 -0400 (Mon, 25 May 2009)
New Revision: 4888

Added:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java
Removed:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDiagramView.java
Modified:
   projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java
   projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
   projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusAction.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
Log:
Added plugin dependencies.

Modified: projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/JAXBContext.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -20,7 +20,7 @@
  *
  * <p>A client application normally obtains new instances of this class using
  * one of these two styles for newInstance methods, although there are other 
- * specialized forms of the method available:
+ * specialized forms of the method has:
  *
  * <ul>
  *   <li>{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )} <br/>
@@ -173,7 +173,7 @@
  * <blockquote>
  * Validation has been changed significantly since JAXB 1.0.  The {@link Validator}
  * class has been deprecated and made optional.  This means that you are advised
- * not to use this class and, in fact, it may not even be available depending on
+ * not to use this class and, in fact, it may not even be has depending on
  * your JAXB provider.  JAXB 1.0 client applications that rely on <tt>Validator</tt>
  * will still work properly when deployed with the JAXB 1.0 runtime system.
  *

Modified: projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/ValidationEventLocator.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -26,35 +26,35 @@
 public interface ValidationEventLocator {
 
     /**
-     * Return the name of the XML source as a URL if available
+     * Return the name of the XML source as a URL if has
      *
      * @return the name of the XML source as a URL or null if unavailable
      */
     public java.net.URL getURL();
     
     /**
-     * Return the byte offset if available
+     * Return the byte offset if has
      *
      * @return the byte offset into the input source or -1 if unavailable
      */
     public int getOffset();
     
     /**
-     * Return the line number if available
+     * Return the line number if has
      *
      * @return the line number or -1 if unavailable 
      */
     public int getLineNumber();
     
     /**
-     * Return the column number if available
+     * Return the column number if has
      *
      * @return the column number or -1 if unavailable
      */
     public int getColumnNumber();
     
     /**
-     * Return a reference to the object in the Java content tree if available
+     * Return a reference to the object in the Java content tree if has
      *
      * @return a reference to the object in the Java content tree or null if
      *         unavailable
@@ -62,7 +62,7 @@
     public java.lang.Object getObject();
     
     /**
-     * Return a reference to the DOM Node if available
+     * Return a reference to the DOM Node if has
      *
      * @return a reference to the DOM Node or null if unavailable 
      */

Modified: projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/javax/xml/bind/helpers/ValidationEventLocatorImpl.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -40,10 +40,10 @@
     /** 
      * Constructs an object from an org.xml.sax.Locator. 
      * 
-     * The object's ColumnNumber, LineNumber, and URL become available from the 
+     * The object's ColumnNumber, LineNumber, and URL become has from the
      * values returned by the locator's getColumnNumber(), getLineNumber(), and
      * getSystemId() methods respectively. Node, Object, and Offset are not 
-     * available. 
+     * has.
      * 
      * @param loc the SAX Locator object that will be used to populate this
      * event locator.
@@ -63,10 +63,10 @@
     /** 
      * Constructs an object from the location information of a SAXParseException. 
      * 
-     * The object's ColumnNumber, LineNumber, and URL become available from the 
+     * The object's ColumnNumber, LineNumber, and URL become has from the
      * values returned by the locator's getColumnNumber(), getLineNumber(), and
      * getSystemId() methods respectively. Node, Object, and Offset are not 
-     * available. 
+     * has.
      * 
      * @param e the SAXParseException object that will be used to populate this
      * event locator.
@@ -86,8 +86,8 @@
     /** 
      * Constructs an object that points to a DOM Node. 
      * 
-     * The object's Node becomes available.  ColumnNumber, LineNumber, Object, 
-     * Offset, and URL are not available.
+     * The object's Node becomes has.  ColumnNumber, LineNumber, Object,
+     * Offset, and URL are not has.
      * 
      * @param _node the DOM Node object that will be used to populate this
      * event locator.
@@ -105,8 +105,8 @@
     /** 
      * Constructs an object that points to a JAXB content object. 
      * 
-     * The object's Object becomes available. ColumnNumber, LineNumber, Node, 
-     * Offset, and URL are not available.
+     * The object's Object becomes has. ColumnNumber, LineNumber, Node,
+     * Offset, and URL are not has.
      * 
      * @param _object the Object that will be used to populate this
      * event locator.

Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java	                        (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerPlugins.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -0,0 +1,57 @@
+/*
+ * 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 org.jboss.bpm.console.client.model.ServerStatus;
+import org.jboss.bpm.console.client.model.PluginInfo;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerPlugins
+{
+  private static ServerStatus status;
+
+  public static void setStatus(ServerStatus s)
+  {
+    status = s;
+  }
+
+  public static boolean has(String type)
+  {
+    boolean match = false;
+
+    if(status!=null)
+    {
+      for(PluginInfo p : status.getPlugins())
+      {
+        if(p.getType().equals(type))
+        {
+          match = p.isAvailable();
+          break;                                    
+        }
+      }
+    }
+    return match;
+  }
+
+}

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusAction.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusAction.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -65,7 +65,10 @@
     ServerStatusView view = (ServerStatusView)controller.getView(ServerStatusView.ID);
 
     ConsoleLog.info("Loaded server status");
-    
+
     view.update(status);
+
+    // global var
+    ServerPlugins.setStatus(status);
   }
 }

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ServerStatusView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -41,7 +41,7 @@
   private Controller controller;
 
   private ApplicationContext appContext;
-  
+
   public ServerStatusView(ApplicationContext appContext)
   {
     super();
@@ -56,7 +56,7 @@
   public void update(ServerStatus status)
   {
     this.clear();
-    
+
     Grid g = new Grid(status.getPlugins().size(), 2);
     g.setWidth("100%");    
     
@@ -74,7 +74,8 @@
 
     this.add(g);
     
-    this.invalidate();
+    invalidate();
     
   }
+
 }

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -28,10 +28,7 @@
 import org.gwt.mosaic.ui.client.Label;
 import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
 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.gwt.mosaic.ui.client.layout.BoxLayout;
-import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.*;
 import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
 
 /**
@@ -81,17 +78,23 @@
 
       ServerStatusView serverStatus = new ServerStatusView(appContext);
 
-      Grid g2 = new Grid(2,2);      
+      Grid g2 = new Grid(1,2);
       g2.setWidget(0,0, new Label("Host:"));
       g2.setWidget(0,1, new Label(appContext.getConfig().getConsoleServerUrl()));
 
-      g2.setWidget(1,0 , new Label("Plugins:"));
-      g2.setWidget(1,1, serverStatus);
-
       g2.getColumnFormatter().setWidth(0, "20%");
 
       layoutPanel.add(g2, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));       
 
+      LayoutPanel pluginPanel = new LayoutPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+      Label label = new Label("Plugins:");
+      label.setStyleName("bpm-label-header");
+
+      pluginPanel.add(label);
+      pluginPanel.add(serverStatus);
+
+      layoutPanel.add(pluginPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
       tabPanel.add(layoutPanel, "System Overview");
 
       this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));

Copied: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java (from rev 4887, projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDiagramView.java)
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java	                        (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ActivityDiagramView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -0,0 +1,87 @@
+/*
+ * 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.model.DiagramNodeInfo;
+import org.jboss.bpm.console.client.model.ActiveNodeInfo;
+import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
+import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.gwt.mosaic.ui.client.ScrollLayoutPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.mvc4g.client.ViewInterface;
+import com.mvc4g.client.Controller;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ActivityDiagramView extends ScrollLayoutPanel
+    implements ViewInterface
+{
+
+  public final static String ID = ActivityDiagramView.class.getName();
+  
+  private ProcessDefinitionRef processRef;
+
+  private ProcessInstanceRef instanceRef;
+
+  private Controller controller;
+
+  public ActivityDiagramView()
+  {
+    super();
+  }
+
+
+  public void setController(Controller controller)
+  {
+    this.controller = controller;
+  }
+
+  public void update(ActivityDiagramResultEvent event)
+  {
+
+    ActiveNodeInfo activeNodeInfo = event.getActiveNodeInfo();
+    DiagramNodeInfo activeNode = activeNodeInfo.getActiveNode();
+    String imageUrl = event.getImageUrl();
+
+    // remove contents
+    this.clear();
+
+    // add overlay
+    HTML html = new HTML(
+        "<div style='width:1024px; height:768px; background-color:#ffffff;'><div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px\">" +
+            "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
+            "" +
+            "<div class=\"activeNode\" style=\"top:"+ (activeNode.getY()) +"px;left:"+activeNode.getX()+"px;width:"+(activeNode.getWidth()-2)+"px;height:"+(activeNode.getHeight()-2)+"px\"></div>" +
+            "" +
+            "<div class=\"activeNode-header\" style=\"top:"+(activeNode.getY()-15)+"px;left:"+activeNode.getX()+"px;width:"+activeNode.getWidth()+"px;height:15px\">" +
+            " <div class=\"activeNode-header-link\"><a href=\"javascript:alert('Not implemented!')\">Running</a></div>" +
+            "</div>" +
+            "</div></div>"
+    );
+
+    this.add(html);    
+    invalidate();
+  } 
+}
\ No newline at end of file

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceDetailView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -27,9 +27,7 @@
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.Widget;
-import com.google.gwt.user.client.ui.Frame;
 import com.google.gwt.user.client.WindowCloseListener;
-import com.google.gwt.user.client.DOM;
 import org.gwt.mosaic.ui.client.CaptionLayoutPanel;
 import org.gwt.mosaic.ui.client.WindowPanel;
 import org.gwt.mosaic.ui.client.Caption;
@@ -37,14 +35,10 @@
 import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
 import org.jboss.bpm.console.client.common.PropertyGrid;
 import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.TaskRef;
-import org.jboss.bpm.console.client.task.LoadTasksAction;
-import org.jboss.bpm.console.client.util.ConsoleLog;
 import org.jboss.bpm.console.client.util.WindowUtil;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
 
-import java.util.Date;
-
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
  */
@@ -64,13 +58,15 @@
 
   private ApplicationContext appContext;
 
-  private ProcessDiagramView diagramView;
+  private ActivityDiagramView diagramView;
 
+  private boolean hasDiagramPlugin;
+
   public InstanceDetailView(ApplicationContext appContext)
   {
     super("Instance details");
     this.appContext = appContext;
-    
+
     super.setStyleName("bpm-detail-panel");
     super.setLayout(new BoxLayout(BoxLayout.Orientation.HORIZONTAL));
 
@@ -98,6 +94,11 @@
 
     activityBtn.setEnabled(false);
     this.add(activityBtn);
+
+    // plugin availability
+    this.hasDiagramPlugin =
+        ServerPlugins.has("org.jboss.bpm.console.server.plugin.GraphViewerPlugin");
+
   }
 
   private void createActivityWindow(ProcessInstanceRef inst)
@@ -132,8 +133,8 @@
   {
     this.controller = controller;
 
-    this.diagramView = new ProcessDiagramView();
-    controller.addView(ProcessDiagramView.ID, diagramView);
+    this.diagramView = new ActivityDiagramView();
+    controller.addView(ActivityDiagramView.ID, diagramView);
     controller.addAction(LoadActivityDiagramAction.ID, new LoadActivityDiagramAction(appContext));    
   }
 
@@ -150,7 +151,8 @@
 
     grid.update(values);
 
-    this.activityBtn.setEnabled(true);
+    if(hasDiagramPlugin)
+      this.activityBtn.setEnabled(true);
   }
 
   public void clearView()

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/InstanceListView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -39,6 +39,8 @@
 import org.jboss.bpm.console.client.model.ProcessInstanceRef;
 import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerStatusView;
+import org.jboss.bpm.console.client.ServerPlugins;
 
 import java.util.List;
 
@@ -276,7 +278,7 @@
       layout.add(instanceList, new BorderLayoutData(BorderLayout.Region.CENTER));
 
       // details
-      InstanceDetailView detailsView = new InstanceDetailView(appContext);
+      InstanceDetailView detailsView = new InstanceDetailView(appContext); 
       controller.addView(InstanceDetailView.ID, detailsView);
      
       controller.addAction(UpdateInstanceDetailAction.ID, new UpdateInstanceDetailAction());

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/LoadActivityDiagramAction.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -35,7 +35,6 @@
 import com.google.gwt.json.client.JSONValue;
 import com.google.gwt.json.client.JSONParser;
 import com.mvc4g.client.Controller;
-import com.mvc4g.client.Event;
 
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
@@ -93,7 +92,7 @@
         );
 
     // update view
-    ProcessDiagramView view = (ProcessDiagramView) controller.getView(ProcessDiagramView.ID);
+    ActivityDiagramView view = (ActivityDiagramView) controller.getView(ActivityDiagramView.ID);
     view.update(
         new ActivityDiagramResultEvent(
             appContext.getUrlBuilder().getProcessImageURL(inst.getDefinitionId()),

Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDiagramView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDiagramView.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessDiagramView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -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 org.jboss.bpm.console.client.model.DiagramNodeInfo;
-import org.jboss.bpm.console.client.model.ActiveNodeInfo;
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
-import org.jboss.bpm.console.client.process.events.ActivityDiagramResultEvent;
-import org.gwt.mosaic.ui.client.layout.LayoutPanel;
-import com.google.gwt.user.client.ui.HTML;
-import com.mvc4g.client.ViewInterface;
-import com.mvc4g.client.Controller;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ProcessDiagramView extends LayoutPanel
-    implements ViewInterface
-{
-
-  public final static String ID = ProcessDiagramView.class.getName();
-  
-  private ProcessDefinitionRef processRef;
-
-  private ProcessInstanceRef instanceRef;
-
-  private Controller controller;
-
-  public ProcessDiagramView()
-  {
-    super();
-  }
-
-
-  public void setController(Controller controller)
-  {
-    this.controller = controller;
-  }
-
-  public void update(ActivityDiagramResultEvent event)
-  {
-
-    ActiveNodeInfo activeNodeInfo = event.getActiveNodeInfo();
-    DiagramNodeInfo activeNode = activeNodeInfo.getActiveNode();
-    String imageUrl = event.getImageUrl();
-
-    // remove contents
-    this.clear();
-
-    // add overlay
-    HTML html = new HTML(
-        "<div style='width:1024px; height:768px; background-color:#ffffff;'><div id=\"imageContainer\" style=\"position:relative;top:-1;left:-1;height:"+activeNodeInfo.getHeight()+"px;width:"+activeNodeInfo.getWidth()+"px\">" +
-            "<img src=\""+imageUrl+"\" style=\"position:absolute;top:0;left:0\" />" +
-            "" +
-            "<div class=\"activeNode\" style=\"top:"+ (activeNode.getY()) +"px;left:"+activeNode.getX()+"px;width:"+(activeNode.getWidth()-2)+"px;height:"+(activeNode.getHeight()-2)+"px\"></div>" +
-            "" +
-            "<div class=\"activeNode-header\" style=\"top:"+(activeNode.getY()-15)+"px;left:"+activeNode.getX()+"px;width:"+activeNode.getWidth()+"px;height:15px\">" +
-            " <div class=\"activeNode-header-link\"><a href=\"javascript:alert('Not implemented!')\">Running</a></div>" +
-            "</div>" +
-            "</div></div>"
-    );
-
-    this.add(html);    
-    invalidate();
-  } 
-}
\ No newline at end of file

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java	2009-05-25 14:31:11 UTC (rev 4887)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/AssignedTasksView.java	2009-05-25 15:13:50 UTC (rev 4888)
@@ -33,6 +33,7 @@
 import org.gwt.mosaic.ui.client.layout.*;
 import org.gwt.mosaic.ui.client.list.DefaultListModel;
 import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.ServerPlugins;
 import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
 import org.jboss.bpm.console.client.model.TaskRef;
 import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
@@ -60,7 +61,9 @@
   private TaskDetailView detailsView;
 
   private SimpleDateFormat dateFormat = new SimpleDateFormat();
-  
+
+  private boolean hasDispatcherPlugin;
+
   public AssignedTasksView(ApplicationContext appContext, TaskDetailView detailsView)
   {
     super();
@@ -145,27 +148,28 @@
 
       toolBar.addSeparator();
 
-      toolBar.add(
-          new ToolButton("View", new ClickListener() {
-            public void onClick(Widget sender) {
+      ToolButton viewBtn = new ToolButton("View", new ClickListener()
+      {
+        public void onClick(Widget sender)
+        {
 
-              TaskRef selection = getSelection();
+          TaskRef selection = getSelection();
 
-              if(selection!=null)
-              {
-                if(selection.getUrl()!=null && !selection.getUrl().equals(""))
-                  createTaskFormWindow(selection);
-                else
-                  MessageBox.alert("Invalid operation", "The task doesn't provide a UI");
-              }
-              else
-              {
-                MessageBox.alert("Missing selection", "Please select a task");
-              }
-            }
+          if (selection != null)
+          {
+            if (selection.getUrl() != null && !selection.getUrl().equals(""))
+              createTaskFormWindow(selection);
+            else
+              MessageBox.alert("Invalid operation", "The task doesn't provide a UI");
           }
-          )
+          else
+          {
+            MessageBox.alert("Missing selection", "Please select a task");
+          }
+        }
+      }
       );
+      toolBar.add(viewBtn);
 
       toolBar.addSeparator();
 
@@ -206,6 +210,11 @@
 
       this.add(layout);
 
+      // plugin availability
+      this.hasDispatcherPlugin =
+          ServerPlugins.has("org.jboss.bpm.console.server.plugin.TaskDispatcherPlugin");
+      viewBtn.setEnabled(hasDispatcherPlugin);
+      
       isInitialized = true;
     }
   }




More information about the jbpm-commits mailing list