[jbpm-commits] JBoss JBPM SVN: r4591 - in projects/gwt-console/branches/hbraun: plugin-api and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Apr 21 07:54:32 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-04-21 07:54:32 -0400 (Tue, 21 Apr 2009)
New Revision: 4591

Added:
   projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js
Removed:
   projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java
   projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java
   projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java
   projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java
Modified:
   projects/gwt-console/branches/hbraun/plugin-api/pom.xml
   projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java
   projects/gwt-console/branches/hbraun/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
   projects/gwt-console/branches/hbraun/pom.xml
   projects/gwt-console/branches/hbraun/war/pom.xml
   projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
Log:
Remove the dependency on gwtext

Modified: projects/gwt-console/branches/hbraun/plugin-api/pom.xml
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/pom.xml	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/pom.xml	2009-04-21 11:54:32 UTC (rev 4591)
@@ -38,13 +38,8 @@
       <version>${gwt.version}</version>
       <scope>provided</scope>
     </dependency>
-
+    
     <dependency>
-      <groupId>com.gwtext</groupId>
-      <artifactId>gwtext</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>com.google.code.gwt-log</groupId>
       <artifactId>gwt-log</artifactId>
     </dependency>

Modified: projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/View.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -21,16 +21,16 @@
  */
 package org.jboss.bpm.console.client;
 
-import com.gwtext.client.widgets.Panel;
 import com.mvc4g.client.ViewInterface;
 import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
 
 /**
  * View's are {@link org.jboss.bpm.console.client.Editor} components
  *
  * @author Heiko.Braun <heiko.braun at jboss.com>
  */
-public abstract class View extends Panel implements ViewInterface
+public abstract class View extends LayoutPanel implements ViewInterface
 {
 
   protected ApplicationContext mainMenu;
@@ -40,8 +40,7 @@
   protected View(ApplicationContext main)
   {
     super();
-    this.mainMenu = main;
-    this.setPaddings(10);
+    this.mainMenu = main;    
   }
 
   public abstract String getViewId();

Deleted: projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/DateRenderer.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.widgets.grid.Renderer;
-import com.gwtext.client.widgets.grid.CellMetadata;
-import com.gwtext.client.data.Store;
-import com.gwtext.client.data.Record;
-
-import java.util.Date;
-
-import org.jboss.bpm.console.client.model.util.SimpleDateFormat;
-
-/**
- * Renders a Date according to {@link org.jboss.bpm.console.client.model.util.SimpleDateFormat#DEFAULT_FORMAT}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class DateRenderer implements Renderer
-{
-  private String fieldName;
-
-  public DateRenderer(String fieldName)
-  {
-    this.fieldName = fieldName;
-  }
-
-  /**
-   * Returns an empty string (field is null) or a formatted date (field is set).
-   */
-  public String render(Object value, CellMetadata cellMetadata, Record record,
-                       int rowIndex, int colNum, Store store)
-  {
-    String s = "";
-    SimpleDateFormat df = new SimpleDateFormat();
-    Date d = record.getAsDate(fieldName);
-    if (d != null)
-      s = df.format(d);
-
-    return s;
-  }
-}
\ No newline at end of file

Deleted: projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelChangeListener.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.data.Record;
-
-/**
- * Get's notified when model change events are fire on {@link ModelListenerRegistry}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface ModelChangeListener
-{
-  void onModelChange(ModelListenerRegistry parent, Object changeEvent);
-
-  void onRecordChange(ModelListenerRegistry parent, Record record);
-
-  void onReset();
-}

Deleted: projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelListenerRegistry.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import com.gwtext.client.data.Record;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Utility to propagate model change events to {@link ModelChangeListener}
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class ModelListenerRegistry
-{
-  private List<ModelChangeListener> listeners = new ArrayList<ModelChangeListener>();
-
-  public void addListener(ModelChangeListener listener)
-  {
-    this.listeners.add(listener);
-  }
-
-  public void fireRecordChangeEvent(Record record)
-  {
-    for (ModelChangeListener l : listeners)
-    {
-      l.onRecordChange(this, record);
-    }
-  }
-
-  public void fireModelChangeEvent(Object event)
-  {
-    for (ModelChangeListener l : listeners)
-    {
-      l.onModelChange(this, event);
-    }
-  }
-
-  public void fireResetEvent()
-  {
-    for (ModelChangeListener l : listeners)
-    {
-      l.onReset();
-    }
-  }
-}

Deleted: projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-api/src/main/java/org/jboss/bpm/console/client/util/ModelModificationCallback.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.console.client.util;
-
-import org.jboss.bpm.console.client.model.ProcessInstanceRef;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface ModelModificationCallback
-{
-  void onStaleModel();
-}

Modified: projects/gwt-console/branches/hbraun/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java
===================================================================
--- projects/gwt-console/branches/hbraun/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/plugin-example/src/main/java/org/jboss/bpm/console/client/mapsplugin/MapsEditor.java	2009-04-21 11:54:32 UTC (rev 4591)
@@ -60,8 +60,7 @@
     frame.setUrl("http://maps.google.com");
 
     // assemble the view
-    defaultView.add(frame);
-    defaultView.setPaddings(10,0,0,0);
+    defaultView.add(frame);    
     defaultView.setTitle("Maps");
 
     // add it to the editor

Modified: projects/gwt-console/branches/hbraun/pom.xml
===================================================================
--- projects/gwt-console/branches/hbraun/pom.xml	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/pom.xml	2009-04-21 11:54:32 UTC (rev 4591)
@@ -23,7 +23,7 @@
     <commons-config.version>1.6</commons-config.version>
     <gson.version>1.2.2</gson.version>
     <gwt.version>1.5.3</gwt.version>
-    <gwtext.version>2.0.5</gwtext.version>
+
     <gwt-mosaic.version>0.1.9</gwt-mosaic.version>
     <gwt-log.version>2.5.2</gwt-log.version>
     <jaf.version>1.1</jaf.version>
@@ -74,11 +74,6 @@
       </dependency>
 
       <dependency>
-        <groupId>com.gwtext</groupId>
-        <artifactId>gwtext</artifactId>
-        <version>${gwtext.version}</version>
-      </dependency>
-      <dependency>
         <groupId>com.google.gwt</groupId>
         <artifactId>gchart</artifactId>
         <version>${gchart.version}</version>

Modified: projects/gwt-console/branches/hbraun/war/pom.xml
===================================================================
--- projects/gwt-console/branches/hbraun/war/pom.xml	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/war/pom.xml	2009-04-21 11:54:32 UTC (rev 4591)
@@ -72,10 +72,6 @@
 
     <!-- GWT extensions -->
     <dependency>
-      <groupId>com.gwtext</groupId>
-      <artifactId>gwtext</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.google.code.gwt-log</groupId>
       <artifactId>gwt-log</artifactId>
     </dependency>

Modified: projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml	2009-04-20 20:43:59 UTC (rev 4590)
+++ projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/Application.gwt.xml	2009-04-21 11:54:32 UTC (rev 4591)
@@ -3,8 +3,7 @@
   <!-- Inherit the core Web Toolkit stuff. -->
   <inherits name='com.google.gwt.user.User' />
   <inherits name='com.google.gwt.json.JSON'/>
-  <inherits name="com.google.gwt.i18n.I18N"/>
-  <inherits name='com.gwtext.GwtExt' />
+  <inherits name="com.google.gwt.i18n.I18N"/>  
 
   <!-- Add gwt-log support, default level `DEBUG` -->
   <inherits name="com.allen_sauer.gwt.log.gwt-log-DEBUG" />
@@ -63,9 +62,5 @@
 
   <!-- Specify a css to load into your gwt application -->
   <stylesheet src='console.css' />
-  <stylesheet src="js/ext/resources/css/ext-all.css" />
 
-  <script src="js/ext/adapter/ext/ext-base.js" />
-  <script src="js/ext/ext-all.js" />
-
 </module>
\ No newline at end of file

Added: projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js
===================================================================
--- projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js	                        (rev 0)
+++ projects/gwt-console/branches/hbraun/war/src/main/resources/org/jboss/bpm/console/public/js/ox.ajast.js	2009-04-21 11:54:32 UTC (rev 4591)
@@ -0,0 +1,123 @@
+// This file contains a simple Javascript broker that encapsulates 
+// the AJAST technique, allowing for cross-domain REST 
+// (REpresentatoinal State Transfer) calls.
+// 
+// Copyright (c) 2008 Håvard Stranden <havard.stranden at gmail.com>
+//
+// Permission is hereby granted, free of charge, to any person
+// obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without
+// restriction, including without limitation the rights to use,
+// copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the
+// Software is furnished to do so, subject to the following
+// conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+// OTHER DEALINGS IN THE SOFTWARE.
+
+if(typeof(OX) === 'undefined') OX = {};
+OX.AJAST = 
+{
+  Broker : function(url, callbackparameter, optional_decode_json_response, optional_timeout_milliseconds, optional_default_params)
+  {
+    this.url = url;
+    this.cb = callbackparameter;
+    this.params = [];
+    this.timeout = optional_timeout_milliseconds || 5000; // Timeout in milliseconds
+    if(typeof(optional_default_params) !== 'undefined')
+    {
+      for(p in optional_default_params)
+        this.params.push(p + '=' + encodeURIComponent(optional_default_params[p]));
+    }
+    
+    this.jsonmode = optional_decode_json_response || false;
+  },
+  
+  __callbacks__ : {},
+  
+  __callid__ : 1,
+  
+  call: function(url, callbackparameter, callbackfunction, optional_timeout, optional_decode_json_response)
+  {
+    var callbackid = 'callback' + OX.AJAST.__callid__;
+    
+    // Append callback parameter (this also implicitly avoids caching, since the callback id is different for each call)
+    url += '&' + encodeURIComponent(callbackparameter) + '=' + encodeURIComponent('OX.AJAST.__callbacks__.' + callbackid);
+      
+    // Create script tag for the call
+    var tag = OX.AJAST.createScriptTag(url);
+    // Get the head of the document
+    var head = document.getElementsByTagName('head').item(0);
+    
+      
+    // Create a timeout function  
+    var timedout = function()
+    {
+      if(OX.AJAST.__callbacks__[callbackid] !== 'undefined') // If the callback still exists...
+      {
+        // Replace original wrapped callback with a dummy that just deletes itself
+        OX.AJAST.__callbacks__[callbackid] = function(){ delete OX.AJAST.__callbacks__[callbackid]; }; 
+        // Signal that the call timed out
+        callbackfunction(false); 
+        // Remove the script tag (timed out)
+        head.removeChild(tag); 
+      }    
+    };
+    
+    // Create timer for the timeout function
+    var timer = setTimeout(timedout, optional_timeout || 5000);
+      
+    var decode_response = optional_decode_json_response || false;
+    
+    // Create the callback function          
+    OX.AJAST.__callbacks__[callbackid] = function(data)
+    {
+      // Clear the timeout
+      clearTimeout(timer);
+      
+      if(typeof(data) === 'undefined')
+        callbackfunction(false); // Callback with nothing
+      else
+      {
+        callbackfunction(true, decode_response ? eval(data) : data);
+      }
+      // Replace original callback with a dummy function 
+      delete OX.AJAST.__callbacks__[callbackid];
+      // Remove the script tag (finished)
+      head.removeChild(tag);
+    };
+    
+    // Inject the call
+    head.appendChild(tag);
+  },
+  
+  createScriptTag: function(url)
+  {
+    var s = document.createElement('script');
+    s.setAttribute('type', 'text/javascript');
+    s.setAttribute('id', 'oxajastcall' + OX.AJAST.Broker.__callid__++);
+    s.setAttribute('src', url);
+    return s;
+  }
+};
+
+OX.AJAST.Broker.prototype.call = function(params, callback)
+{
+  // Create arguments
+  var args = [];
+  for(p in params)
+    args.push(p + '=' + encodeURIComponent(params[p]));
+  for(p in this.params)
+    args.push(this.params[p]);
+  OX.AJAST.call(this.url + '?' + args.join('&'), this.cb, callback, this.timeout, this.jsonmode);
+};
\ No newline at end of file




More information about the jbpm-commits mailing list