[jbpm-commits] JBoss JBPM SVN: r4901 - in projects/gwt-console/trunk/gui: war/src/main/java/org/jboss/bpm/console/client/icons and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue May 26 11:37:22 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-05-26 11:37:22 -0400 (Tue, 26 May 2009)
New Revision: 4901

Added:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
Removed:
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/31.png
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/icons/ConsoleIconBundle.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
   projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
   projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
   projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
   projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
Log:
Started work on ReportEditor

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-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -122,11 +122,6 @@
     return "Settings";
   }
 
-  public String getIconCSS()
-  {
-    return "bpm-settings-editor";
-  }
-
   public MenuSection provideMenuSection()
   {
     ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);

Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/31.png
===================================================================
(Binary files differ)

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -108,4 +108,9 @@
    * @gwt.resource reload_small.png
    */
   AbstractImagePrototype reloadSmallIcon();
+
+  /**
+   * @gwt.resource report.png
+   */
+  AbstractImagePrototype reportIcon();
 }

Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
===================================================================
(Binary files differ)


Property changes on: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -146,11 +146,6 @@
     return "Processes";
   }
 
-  public String getIconCSS()
-  {
-    return "bpm-process-icon";
-  }
-
   public MenuSection provideMenuSection()
   {
     ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);

Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java	                        (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,134 @@
+/*
+ * 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.user.client.DOM;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class OverviewReportView extends AbstractView
+{
+  public final static String ID = OverviewReportView.class.getName();
+  
+  private Controller controller;
+
+  private boolean isInitialized;
+
+  private ApplicationContext appContext;
+
+  private LayoutPanel layout;
+
+  private Frame frame;
+
+  public OverviewReportView(ApplicationContext appContext)
+  {
+    super();
+    this.appContext = appContext;
+    ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+    setTitle("Process Activity");
+    setIcon(icons.reportIcon());
+  }
+
+  public boolean isInitialized()
+  {
+    return isInitialized;
+  }
+
+  public void initialize()
+  {
+    if(!isInitialized)
+    {
+
+      // layout
+      layout = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+      layout.setPadding(0);
+      layout.setWidgetSpacing(0);
+
+      // report frame
+      frame = new Frame();
+      DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+      setFrameUrl(appContext.getUrlBuilder().getOverviewReportUrl());
+
+
+      // toolbar
+      final LayoutPanel toolBox = new LayoutPanel();
+      toolBox.setPadding(0);
+      toolBox.setWidgetSpacing(5);
+      //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+      final ToolBar toolBar = new ToolBar();
+      toolBar.add(
+          new ToolButton("Refresh", new ClickListener() {
+            public void onClick(Widget sender) {
+              setFrameUrl(appContext.getUrlBuilder().getOverviewReportUrl());  
+            }
+          }
+          )
+      );
+
+      toolBar.addSeparator();
+
+      toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+      // assembly
+      layout.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+      layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+      this.add(layout);
+      this.isInitialized = true;
+    }
+  }
+
+  public void setController(Controller controller)
+  {
+    this.controller = controller;
+  }
+
+  private void setFrameUrl(String url)
+  {
+    // https://jira.jboss.org/jira/browse/JBPM-2244
+    frame.getElement().setId(
+        String.valueOf( new Date().getTime())
+    );
+
+    frame.setUrl(url);
+
+  }
+}

Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java	                        (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,150 @@
+/*
+ * 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 org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+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.bpm.console.client.process.*;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.DOM;
+import com.mvc4g.client.Event;
+import com.mvc4g.client.ActionInterface;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ReportEditor extends Editor
+{
+  public final static String ID = ReportEditor.class.getName();
+
+  private DecoratedTabLayoutPanel tabPanel;
+
+  public ReportEditor(ApplicationContext appContext)
+  {
+    super(appContext);
+  }
+
+  public void initialize()
+  {
+    if(!isInitialized())
+    {
+      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();
+                appContext.refreshView(); // TODO: hack around rendering problems
+              }
+            }
+          }
+      );
+
+      this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+      // create and register views
+      registerView(OverviewReportView.ID, new OverviewReportView(appContext));
+
+      // create and register actions
+      //registerAction(LoadDefinitionsAction.ID, new LoadDefinitionsAction(appContext));
+
+      // display tab, needs to visible for correct rendering
+      tabPanel.selectTab(0);
+
+      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;
+  }
+
+  public String getTitle()
+  {
+    return "Reporting";
+  }
+
+  public MenuSection provideMenuSection()
+  {
+    ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+    return new MenuSection(
+        "Reporting",
+        icons.reportIcon(),
+        new ReportEditorNavigation(appContext)
+    );
+  }
+}

Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java	                        (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,61 @@
+/*
+ * 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.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+class ReportEditorNavigation extends Tree
+{
+  public ReportEditorNavigation(final ApplicationContext appContext)
+  {
+    super.setTitle("Reporting");
+
+    TreeItem root = addItem("Processes");
+    TreeItem definitions = root.addItem("Overview");
+
+    addTreeListener(
+        new TreeListener()
+        {
+          public void onTreeItemSelected(TreeItem treeItem)
+          {
+            if("Overview".equals(treeItem.getText()))
+            {
+              Workspace workspace = appContext.getWorkpace();
+              workspace.showEditor(ReportEditor.ID);
+            }
+          }
+
+          public void onTreeItemStateChanged(TreeItem treeItem)
+          {
+
+          }
+        }
+    );
+  }
+}

Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -140,11 +140,6 @@
     return "Task Management";
   }
 
-  public String getIconCSS()
-  {
-    return "bpm-task-icon";
-  }
-
   public MenuSection provideMenuSection()
   {
     ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);

Modified: projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json	2009-05-26 15:37:22 UTC (rev 4901)
@@ -8,7 +8,7 @@
          "password":"password"
         },
         {"id": "birt",
-         "url":"http://localhost:8080/report",
+         "url":"http://localhost:8080/gwt-console-server",
          "passthrough":true,
          "contentType":"text/html"         
         }

Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg	2009-05-26 15:37:22 UTC (rev 4901)
@@ -1,6 +1,4 @@
 org.jboss.bpm.console.client.SettingsEditor
 org.jboss.bpm.console.client.process.ProcessEditor
 org.jboss.bpm.console.client.task.TaskEditor
-
-# not yet implemented in jBPM4
-#org.jboss.bpm.console.client.report.ReportEditor  
\ No newline at end of file
+org.jboss.bpm.console.client.report.ReportEditor  
\ No newline at end of file

Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java	2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java	2009-05-26 15:37:22 UTC (rev 4901)
@@ -76,8 +76,6 @@
   public abstract String getEditorId();
 
   public abstract String getTitle();
-
-  public abstract String getIconCSS();
   
   public abstract MenuSection provideMenuSection();  
  




More information about the jbpm-commits mailing list