[overlord-commits] Overlord SVN: r941 - bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client.

overlord-commits at lists.jboss.org overlord-commits at lists.jboss.org
Thu Jan 28 15:13:30 EST 2010


Author: heiko.braun at jboss.com
Date: 2010-01-28 15:13:30 -0500 (Thu, 28 Jan 2010)
New Revision: 941

Removed:
   bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java
Modified:
   bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
   bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java
   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/PreferencesView.java
Log:
Move preferences to errai workspace module

Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java	2010-01-28 15:05:45 UTC (rev 940)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/BootstrapAction.java	2010-01-28 20:13:30 UTC (rev 941)
@@ -23,13 +23,10 @@
 
 import com.google.gwt.http.client.RequestBuilder;
 import com.google.gwt.http.client.Response;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
 import com.mvc4g.client.Controller;
 import org.jboss.bpm.console.client.common.AbstractRESTAction;
 import org.jboss.bpm.console.client.model.JSOParser;
 import org.jboss.bpm.console.client.model.ServerStatus;
-import org.jboss.bpm.console.client.util.ConsoleLog;
 import org.jboss.errai.workspaces.client.Registry;
 
 /**
@@ -67,28 +64,6 @@
   public void handleSuccessfulResponse(final Controller controller, final Object event, Response response)
   {
     ServerStatus status = JSOParser.parseStatus(response.getText());
-    ServerPlugins.setStatus(status);
-
-    Boolean toogleEditor = (Boolean)event;
-    if(toogleEditor)
-    {
-      // show default editor
-      DeferredCommand.addCommand(
-          new Command()
-          {
-            public void execute()
-            {
-              String defaultEditorID = Preferences.has(Preferences.BPM_DEFAULT_TOOL) ?
-                  Preferences.get(Preferences.BPM_DEFAULT_TOOL) :
-                  appContext.getConfig().getDefaultEditor();
-
-              /*Workspace workspace = appContext.getWorkpace();
-              if(workspace.hasEditor(defaultEditorID))
-                workspace.showEditor(defaultEditorID);*/
-              ConsoleLog.warn("Preferences ignored!");
-            }
-          }
-      );
-    }
+    ServerPlugins.setStatus(status);    
   }
 }

Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java	2010-01-28 15:05:45 UTC (rev 940)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/ErraiApplication.java	2010-01-28 20:13:30 UTC (rev 941)
@@ -36,9 +36,13 @@
 import org.jboss.errai.bus.client.ClientMessageBus;
 import org.jboss.errai.bus.client.ErraiBus;
 import org.jboss.errai.workspaces.client.Registry;
+import org.jboss.errai.workspaces.client.framework.annotations.GroupOrder;
 import org.jboss.errai.workspaces.client.modules.auth.AuthenticationModule;
 
-
+/**
+ * Main entry point for the BPM console module
+ */
+ at GroupOrder("Tasks, Processes, Reporting, Runtime, Settings")
 public class ErraiApplication implements EntryPoint
 {
   public void onModuleLoad() {

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-01-28 15:05:45 UTC (rev 940)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/LoginView.java	2010-01-28 20:13:30 UTC (rev 941)
@@ -37,8 +37,11 @@
 import org.jboss.bpm.console.client.util.ConsoleLog;
 import org.jboss.errai.bus.client.ErraiBus;
 import org.jboss.errai.bus.client.MessageBuilder;
+import org.jboss.errai.workspaces.client.Preferences;
 import org.jboss.errai.workspaces.client.Registry;
 import org.jboss.errai.workspaces.client.Workspace;
+import org.jboss.errai.workspaces.client.protocols.LayoutCommands;
+import org.jboss.errai.workspaces.client.protocols.LayoutParts;
 
 /**
  * @author Heiko.Braun <heiko.braun at jboss.com>
@@ -139,8 +142,8 @@
                                 {
                                   //new MainLayout(controller, auth, config);
                                   MessageBuilder.createMessage()
-                                      .toSubject("Workspace")
-                                      .command("Initialize")
+                                      .toSubject(Workspace.SUBJECT)
+                                      .command(LayoutCommands.Initialize)
                                       .noErrorHandling()
                                       .sendNowWith(ErraiBus.get()
                                       );
@@ -304,7 +307,7 @@
   private Widget createForm()
   {
     MosaicPanel p = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
-    
+
     usernameInput = new TextBox();
     passwordInput = new PasswordTextBox();
 

Deleted: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java	2010-01-28 15:05:45 UTC (rev 940)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/Preferences.java	2010-01-28 20:13:30 UTC (rev 941)
@@ -1,56 +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;
-
-import com.google.gwt.user.client.Cookies;
-
-import java.util.Date;
-
-/**
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public class Preferences
-{
-  // Editor that should be launched at startup
-  public static final String BPM_DEFAULT_TOOL = "bpm.default.tool";
-    
-  public static boolean has(String key)
-  {
-    return Preferences.get(key)!=null;
-  }
-
-  public static String get(String key)
-  {
-    return Cookies.getCookie(key);
-  }
-
-  public static void set(String key, String value)
-  {
-    Date twoWeeks = new Date(System.currentTimeMillis()+(2*604800*1000));
-    Cookies.setCookie(key, value, twoWeeks);    
-  }
-
-  public static void clear(String key)
-  {
-    Cookies.removeCookie(key);
-  }
-}

Modified: bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java
===================================================================
--- bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java	2010-01-28 15:05:45 UTC (rev 940)
+++ bpm-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/PreferencesView.java	2010-01-28 20:13:30 UTC (rev 941)
@@ -34,6 +34,7 @@
 import org.gwt.mosaic.ui.client.layout.MosaicPanel;
 import org.jboss.bpm.console.client.common.HeaderLabel;
 import org.jboss.errai.common.client.framework.WSComponent;
+import org.jboss.errai.workspaces.client.Preferences;
 import org.jboss.errai.workspaces.client.Registry;
 import org.jboss.errai.workspaces.client.framework.ToolSet;
 import org.jboss.errai.workspaces.client.framework.annotations.LoadTool;
@@ -59,8 +60,7 @@
   {
     this.controller = controller;
   }
-
-  @Override
+  
   public Widget getWidget()
   {
     panel = new MosaicPanel(new BoxLayout(BoxLayout.Orientation.VERTICAL));
@@ -81,7 +81,7 @@
     layout.add(multiBox);
 
     // init
-    String prefEditor = Preferences.get(Preferences.BPM_DEFAULT_TOOL);
+    String prefEditor = Preferences.get(Preferences.DEFAULT_TOOL);
     for(ToolSet ts : toolsets)
     {
       multiBox.addItem(ts.getToolSetName());
@@ -99,7 +99,7 @@
             {
               if(ts.getToolSetName().equals(title))
               {
-                Preferences.set(Preferences.BPM_DEFAULT_TOOL, ts.getToolSetName());
+                Preferences.set(Preferences.DEFAULT_TOOL, ts.getToolSetName());
               }
             }
           }



More information about the overlord-commits mailing list