[galaxy-dev] [2059] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util: Change the URL when the tab changes.

View: New views
1 Messages — Rating Filter:   Alert me  

[galaxy-dev] [2059] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util: Change the URL when the tab changes.

by dandiep-2 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
[2059] trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util: Change the URL when the tab changes.
Revision
2059
Author
dandiep
Date
2009-11-04 13:07:53 -0600 (Wed, 04 Nov 2009)

Log Message

Change the URL when the tab changes.

Modified Paths

Diff

Modified: trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/item/ItemPanel.java (2058 => 2059)

--- trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/item/ItemPanel.java	2009-11-03 05:14:28 UTC (rev 2058)
+++ trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/item/ItemPanel.java	2009-11-04 19:07:53 UTC (rev 2059)
@@ -122,7 +122,7 @@
         /**
          * Lazily initialize the panels with the proper parameters.
          */
-        tabPanel.addListener(Events.Select, new ShowableTabListener(tabPanel, menuPanel, params, null));
+        tabPanel.addListener(Events.Select, new ShowableTabListener(tabPanel, menuPanel, "items/" + itemId, params, null));
 
         cp.add(tabPanel);
         panel.add(cp);

Modified: trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/ShowableTabListener.java (2058 => 2059)

--- trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/ShowableTabListener.java	2009-11-03 05:14:28 UTC (rev 2058)
+++ trunk/gwt-client/src/main/java/org/mule/galaxy/web/client/util/ShowableTabListener.java	2009-11-04 19:07:53 UTC (rev 2059)
@@ -7,6 +7,7 @@
 import com.extjs.gxt.ui.client.event.TabPanelEvent;
 import com.extjs.gxt.ui.client.widget.TabItem;
 import com.extjs.gxt.ui.client.widget.TabPanel;
+import com.google.gwt.user.client.History;
 import com.google.gwt.user.client.ui.Widget;
 
 import java.util.List;
@@ -21,14 +22,17 @@
     private final ErrorPanel errorPanel;
     private final List<String> tabNames;
     private final TabPanel tabPanel;
+    private final String urlBase;
     
     public ShowableTabListener(TabPanel tabPanel,
                                ErrorPanel errorPanel, 
+                               String urlBase,
                                List<String> params,
                                List<String> tabNames) {
         super();
         this.tabPanel = tabPanel;
         this.errorPanel = errorPanel;
+        this.urlBase = urlBase;
         this.params = params;
         this.tabNames = tabNames;
     }
@@ -55,6 +59,13 @@
             ((Showable)widget).showPage(params);
         }
         
+        // Update the History token once the tab is selected.
+        int tabIndex = tabPanel.indexOf(item);
+        if (tabNames != null && tabIndex < tabNames.size()) {
+            String name = tabNames.get(tabIndex);
+            History.newItem(urlBase + "/" + name, false);
+        }
+        
         previous = item;
         // Once we've shown a panel, store the previous params. We aren't going to trigger a new tab  
         // selection event again until we get new params.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MuleForge Dev" group.
To post to this group, send email to muleforgedev@...
To unsubscribe from this group, send email to muleforgedev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/muleforgedev?hl=en
-~----------~----~----~----~------~----~------~--~---
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://admin.muleforge.org/manage_email