You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by sm...@apache.org on 2006/11/17 09:40:27 UTC

svn commit: r476079 - in /portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed: ./ desktop/ widget/

Author: smilek
Date: Fri Nov 17 00:40:26 2006
New Revision: 476079

URL: http://svn.apache.org/viewvc?view=rev&rev=476079
Log:
added PortalBreadcrumbContainer widget; added page action button support; added tooltip support for window action buttons and page action buttons

Added:
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js
Removed:
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/test-div-size.html
Modified:
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/manifest.js
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/HtmlFloatingPane.css
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js Fri Nov 17 00:40:26 2006
@@ -53,10 +53,14 @@
 jetspeed.id =
 {
     PAGE: "jetspeedPage",
+    DESKTOP_CELL: "jetspeedDesktopCell",
     DESKTOP: "jetspeedDesktop",
-    TASKBAR: "jetspeedTaskbar",
     COLUMNS: "jetspeedColumns",
+    PAGE_CONTROLS: "jetspeedPageControls",
+
+    TASKBAR: "jetspeedTaskbar",
     SELECTOR: "jetspeedSelector",
+    
     PORTLET_STYLE_CLASS: "portlet",
     PORTLET_WINDOW_STYLE_CLASS: "dojoFloatingPane",
     PORTLET_WINDOW_GHOST_STYLE_CLASS: "ghostPane",
@@ -135,11 +139,14 @@
     windowActionNotPortlet: [ jetspeed.id.PORTLET_ACTION_NAME_MENU, jetspeed.id.PORTLET_ACTION_NAME_MINIMIZE, jetspeed.id.PORTLET_ACTION_NAME_MAXIMIZE, jetspeed.id.PORTLET_ACTION_NAME_RESTORE ],
     windowActionButtonMax: 5,
     windowActionButtonHide: false,
+    windowActionButtonTooltip: true,
     windowActionMenuOrder: [ jetspeed.id.PORTLET_ACTION_NAME_DESKTOP_HEIGHT_EXPAND, jetspeed.id.PORTLET_ACTION_NAME_DESKTOP_HEIGHT_NORMAL, jetspeed.id.PORTLET_ACTION_NAME_DESKTOP_TILE, jetspeed.id.PORTLET_ACTION_NAME_DESKTOP_UNTILE ],
 
     windowThemesAllowed: [ "tigris", "blueocean" ],
     windowTheme: "tigris",
 
+    pageActionButtonTooltip: true,
+
     getWindowThemeConfig: function( windowtheme )
     {
         if ( jetspeed.prefs.windowThemeConfig == null || windowtheme == null )
@@ -388,6 +395,7 @@
     windowThemeConfig.windowActionNotPortlet = jetspeed.prefs.windowActionNotPortlet;
     windowThemeConfig.windowActionButtonMax = jetspeed.prefs.windowActionButtonMax;
     windowThemeConfig.windowActionButtonHide = jetspeed.prefs.windowActionButtonHide;
+    windowThemeConfig.windowActionButtonTooltip = jetspeed.prefs.windowActionButtonTooltip;
     windowThemeConfig.windowActionMenuOrder = jetspeed.prefs.windowActionMenuOrder;
     windowThemeConfig.windowActionNoImage = jetspeed.prefs.windowActionNoImage;
 
@@ -1169,6 +1177,9 @@
 
         // load menus
         this.retrieveAllMenus();
+
+        // render page buttons
+        this.renderPageControls();
     },
     _parsePSML: function( psml )
     {
@@ -2048,6 +2059,57 @@
         jetspeed.url.retrieveContent( { url: psmlMenuActionUrl, mimetype: mimetype }, contentListener, ajaxApiContext, jetspeed.debugContentDumpIds );
     },
 
+    // ... page buttons
+    renderPageControls: function()
+    {
+        var actionButtonNames = [];
+        actionButtonNames.push( "addportlet" );
+
+        var pageControlsContainer = dojo.byId( jetspeed.id.PAGE_CONTROLS );
+        if ( pageControlsContainer != null && actionButtonNames != null && actionButtonNames.length > 0 )
+        {
+            if ( this.actionButtons == null )
+                this.actionButtons = {};
+            
+            for ( var i = 0 ; i < actionButtonNames.length ; i++ )
+            {
+                var actionName = actionButtonNames[ i ];
+                var actionButton = document.createElement( "div" );
+                actionButton.className = "portalPageActionButton";
+                actionButton.style.backgroundImage = "url(" + jetspeed.prefs.getDesktopThemeRootUrl() + "/images/" + actionName + ".gif)";
+                actionButton.actionName = actionName;
+                this.actionButtons[ actionName ] = actionButton;
+                pageControlsContainer.appendChild( actionButton );
+    
+                dojo.event.connect( actionButton, "onclick", this, "pageActionButtonClick" );
+
+                if ( jetspeed.prefs.pageActionButtonTooltip )
+                {   // setting isContainer=false and fastMixIn=true to avoid recursion hell when connectId is a node (could give each an id instead)
+                    var actionlabel = null;
+                    if ( jetspeed.prefs.desktopActionLabels != null )
+                        actionlabel = jetspeed.prefs.desktopActionLabels[ actionName ];
+                    if ( actionlabel == null || actionlabel.length == 0 )
+                        actionlabel = dojo.string.capitalize( actionName );
+                    var tooltip = dojo.widget.createWidget( "Tooltip", { isContainer: false, fastMixIn: true, caption: actionlabel, connectId: actionButton, delay: "100" } );
+                    document.body.appendChild( tooltip.domNode );
+                }
+            }
+        }
+    },
+    pageActionButtonClick: function( evt )
+    {
+        if ( evt == null || evt.target == null ) return;
+        this.pageActionProcess( evt.target.actionName, evt );
+    },
+    pageActionProcess: function( /* String */ actionName, evt )
+    {
+        if ( actionName == null ) return;
+        alert( "pageActionProcess: " + actionName + " - not yet implemented" );
+    },
+
+
+    // ... page url access
+
     getPageUrl: function()
     {
         return jetspeed.url.path.SERVER + jetspeed.url.path.DESKTOP + this.getPath();
@@ -3698,6 +3760,19 @@
         dumpClosure.dumpMsg = "column " + i + ": " + dumpClosure.dumpMsg;
         dojo.debug( dumpClosure.dumpMsg );
     }
+};
+
+jetspeed.ui.dumpPortletWindowWidgets = function()
+{
+    var portletWindows = jetspeed.ui.getAllPortletWindowWidgets();
+    var pwOut = "";
+    for ( var i = 0 ; i < portletWindows.length; i++ )
+    {
+        if ( i > 0 )
+            pwOut += ", ";
+        pwOut += portletWindows[i].widgetId;
+    }
+    dojo.debug( "PortletWindow widgets: " + pwOut );
 };
 
 jetspeed.ui.getAllPortletWindowWidgets = function()

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/manifest.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/manifest.js?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/manifest.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/manifest.js Fri Nov 17 00:40:26 2006
@@ -21,6 +21,9 @@
             "portalaccordionpane": "jetspeed.widget.PortalAccordionPane",
             "portalmenuoptionlink": "jetspeed.widget.PortalMenuOptionLink",
             "portaltabcontainer": "jetspeed.widget.PortalTabContainer",
+            "portalbreadcrumbcontainer": "jetspeed.widget.PortalBreadcrumbContainer",
+            "portalbreadcrumblink": "jetspeed.widget.PortalBreadcrumbLink",
+            "portalbreadcrumblinkseparator": "jetspeed.widget.PortalBreadcrumbLinkSeparator",
             "portaltaskbar": "jetspeed.widget.PortalTaskBar",
             "portaltaskbaritem": "jetspeed.widget.PortalTaskBarItem",
             "portletdefcontainer": "jetspeed.widget.PortletDefContainer",

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/HtmlFloatingPane.css
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/HtmlFloatingPane.css?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/HtmlFloatingPane.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/HtmlFloatingPane.css Fri Nov 17 00:40:26 2006
@@ -102,6 +102,21 @@
     background-position: center center;
 }
 
+.portalPageActionButton {
+	/* vertical-align: middle; */
+	margin-right: 1px;
+
+	/* height: 22px; */
+	/* width: 22px; */
+
+    cursor: default;
+
+    /* float: right; */
+
+    background-repeat: no-repeat;
+    background-position: center center;
+}
+
 .dojoFloatingPaneTitleBarIcon {
 	/* essential css */
 	float: left;

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js Fri Nov 17 00:40:26 2006
@@ -110,25 +110,6 @@
     }
 });
 
-/*
-jetspeed.widget.PortalAccordionPane = function()
-{  
-    dojo.widget.AccordionPane.call(this);
-    this.widgetType = "PortalAccordionPane";
-};
-
-dojo.inherits( jetspeed.widget.PortalAccordionPane, dojo.widget.AccordionPane );
-
-dojo.lang.extend( jetspeed.widget.PortalAccordionPane,
-{
-    setSizes: function()
-    {
-        this.siblingWidgets = [];    // to keep label click from collapsing all siblings
-    }
-
-});
-*/
-
 jetspeed.widget.PortalMenuOptionLink = function()
 {    
 	dojo.widget.HtmlWidget.call(this);
@@ -141,6 +122,10 @@
 dojo.lang.extend(jetspeed.widget.PortalMenuOptionLink, {
     fillInTemplate: function()
     {
+        if ( this.menuOption.type == "page" )
+            this.menuOptionLinkNode.className = "LinkPage";
+        else if ( this.menuOption.type == "folder" )
+            this.menuOptionLinkNode.className = "LinkFolder";
 		if ( this.iconSrc )
         {
 			var img = document.createElement("img");

Added: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js?view=auto&rev=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js (added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js Fri Nov 17 00:40:26 2006
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+dojo.provide("jetspeed.widget.PortalBreadcrumbContainer");
+dojo.provide("jetspeed.widget.PortalBreadcrumbLink");
+dojo.provide("jetspeed.widget.PortalBreadcrumbLinkSeparator");
+
+dojo.require("jetspeed.desktop.core");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.TabContainer");
+
+jetspeed.widget.PortalBreadcrumbContainer = function()
+{    
+    this.widgetType = "PortalBreadcrumbContainer";
+    this.isContainer = true;
+
+    //this.templateString = '<div id="breadcrumbs"><div dojoAttachPoint="containerNode" class="FolderList"></div><div id="jetspeedPageControls"></div></div>';
+    //this.templateString = '<div dojoAttachPoint="containerNode" class="toolgroup"></div>';
+    dojo.widget.HtmlWidget.call(this);
+};
+
+dojo.inherits(jetspeed.widget.PortalBreadcrumbContainer, dojo.widget.HtmlWidget);
+
+dojo.lang.extend( jetspeed.widget.PortalBreadcrumbContainer,
+{
+    // dojo.widget.Widget create protocol
+    postMixInProperties: function( args, fragment, parentComp )
+    {
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl() + "/css/PortalBreadcrumbContainer.css" ) ;
+        this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getDesktopThemeRootUrl() + "/templates/PortalBreadcrumbContainer.html");
+        jetspeed.widget.PortalBreadcrumbContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
+    },
+
+    // dojo.widget.Widget create protocol
+    fillInTemplate: function( args, frag )
+    {
+		// Copy style info from input node to output node
+		var source = this.getFragNodeRef( frag );
+		dojo.html.copyStyle( this.domNode, source );
+		jetspeed.widget.PortalBreadcrumbContainer.superclass.fillInTemplate.apply( this, arguments );
+	},
+
+    createJetspeedMenu: function( /* jetspeed.om.Menu */ menuObj )
+    {
+        if ( ! menuObj ) return;
+        var menuOpts = menuObj.getOptions();
+        var breadcrumbLinks = [], menuOption = null;
+        for ( var i = 0 ; i < menuOpts.length ; i++ )
+        {
+            menuOption = menuOpts[ i ];
+            if ( menuOption != null && ! menuOption.isSeparator() )
+            {
+                breadcrumbLinks.push( menuOption );
+            }
+        }
+        if ( breadcrumbLinks != null && breadcrumbLinks.length > 0 )
+        {
+            var linkWidget, linkSepWidget;
+            var bcLen = breadcrumbLinks.length;
+            for ( var i = 0 ; i < bcLen ; i++ )
+            {
+                if ( i > 0 )
+                {
+                    linkSepWidget = dojo.widget.createWidget( "jetspeed:PortalBreadcrumbLinkSeparator" );
+                    this.containerNode.appendChild( linkSepWidget.domNode );
+                }
+                if ( i == (bcLen -1) )
+                {
+                    var currentLinkNode = document.createElement( "span" );
+                    currentLinkNode.appendChild( document.createTextNode( breadcrumbLinks[i].getShortTitle() ) );
+                    this.containerNode.appendChild( currentLinkNode );
+                }
+                else
+                {
+                    linkWidget = dojo.widget.createWidget( "jetspeed:PortalBreadcrumbLink", { menuOption: breadcrumbLinks[i] } );
+                    this.containerNode.appendChild( linkWidget.domNode );
+                }
+            }
+        }        
+    }
+});
+
+jetspeed.widget.PortalBreadcrumbLink = function()
+{    
+	dojo.widget.HtmlWidget.call(this);
+    
+    this.widgetType = "PortalBreadcrumbLink";
+    this.templateString = '<span dojoAttachPoint="containerNode"><a href="" dojoAttachPoint="menuOptionLinkNode" dojoAttachEvent="onClick" class="Link"></a></span>';
+};
+dojo.inherits(jetspeed.widget.PortalBreadcrumbLink, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(jetspeed.widget.PortalBreadcrumbLink, {
+    fillInTemplate: function()
+    {
+        if ( this.menuOption.type == "page" )
+            this.menuOptionLinkNode.className = "LinkPage";
+        else if ( this.menuOption.type == "folder" )
+            this.menuOptionLinkNode.className = "LinkFolder";
+		if ( this.iconSrc )
+        {
+			var img = document.createElement("img");
+			img.src = this.iconSrc;
+            this.menuOptionLinkNode.appendChild( img );
+		}
+        this.menuOptionLinkNode.href = this.menuOption.navigateUrl();
+		this.menuOptionLinkNode.appendChild( document.createTextNode( this.menuOption.getShortTitle() ) );
+		dojo.html.disableSelection( this.domNode );
+	},
+    onClick: function( evt )
+    {
+        this.menuOption.navigateTo();
+        dojo.event.browser.stopEvent( evt );
+	}
+});
+
+
+jetspeed.widget.PortalBreadcrumbLinkSeparator = function()
+{    
+	dojo.widget.HtmlWidget.call(this);
+    
+    this.widgetType = "PortalBreadcrumbLinkSeparator";
+    this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getDesktopThemeRootUrl() + "/templates/PortalBreadcrumbLinkSeparator.html");
+};
+dojo.inherits(jetspeed.widget.PortalBreadcrumbLinkSeparator, dojo.widget.HtmlWidget);

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js Fri Nov 17 00:40:26 2006
@@ -124,24 +124,24 @@
     },
     contextMenuCreate: function()
     {
-        var taskBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: "jstc_menu", targetNodeIds: [ this.domNode.id ], contextMenuForWindow: false }, null );
+        //var taskBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: "jstc_menu", targetNodeIds: [ this.domNode.id ], contextMenuForWindow: false }, null );
         //var resetLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item1", caption: "Reset Window Layout"} );
         //var freeFormLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item2", caption: "Free Flowing Layout"} );
         //var twoColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item3", caption: "Two Column Layout"} );
         //var threeColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item4", caption: "Three Column Layout"} );
-        var openPortletSelectorMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item5", caption: "Portlet Selector"} );
+        //var openPortletSelectorMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item5", caption: "Portlet Selector"} );
         
         //dojo.event.connect( resetLayoutMenuItem, "onClick", function(e) { jetspeed.page.resetWindowLayout(); } );
         //dojo.event.connect( freeFormLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = false; jetspeed.page.resetWindowLayout(); jetspeed.page.reload(); } );
         //dojo.event.connect( twoColummLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = 2; jetspeed.page.reload(); } );
         //dojo.event.connect( threeColummLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = 3; jetspeed.page.reload(); } );
-        dojo.event.connect( openPortletSelectorMenuItem, "onClick", function(e) { jetspeed.loadPortletSelector(); } );
+        //dojo.event.connect( openPortletSelectorMenuItem, "onClick", function(e) { jetspeed.loadPortletSelector(); } );
         //taskBarContextMenu.addChild( resetLayoutMenuItem );
         //taskBarContextMenu.addChild( freeFormLayoutMenuItem );
         //taskBarContextMenu.addChild( twoColummLayoutMenuItem );
         //taskBarContextMenu.addChild( threeColummLayoutMenuItem );
-        taskBarContextMenu.addChild( openPortletSelectorMenuItem );
-        document.body.appendChild( taskBarContextMenu.domNode );
+        //taskBarContextMenu.addChild( openPortletSelectorMenuItem );
+        //document.body.appendChild( taskBarContextMenu.domNode );
     }
 });
 

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js?view=diff&rev=476079&r1=476078&r2=476079
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortletWindow.js Fri Nov 17 00:40:26 2006
@@ -611,51 +611,60 @@
     {
         if ( actionName != null )
         {
-            var actionButton = document.createElement("div");
+            var actionButton = document.createElement( "div" );
             actionButton.className = "portletWindowActionButton";
             actionButton.style.backgroundImage = "url(" + jetspeed.url.basePortalWindowThemeUrl( this.windowTheme ) + "/images/desktop/" + actionName + ".gif)";
             actionButton.actionName = actionName;
-            if ( actionName == jetspeed.id.PORTLET_ACTION_NAME_MENU )
-                actionButton.id = this.widgetId + "_menuBtn";
 
             this.actionButtons[ actionName ] = actionButton;
             this.titleBar.appendChild( actionButton );
 
             dojo.event.connect( actionButton, "onclick", this, "windowActionButtonClick" );
+
+            if ( this.windowThemeConfig != null && this.windowThemeConfig.windowActionButtonTooltip )
+            {   // setting isContainer=false and fastMixIn=true to avoid recursion hell when connectId is a node (could give each an id instead)
+                var tooltip = dojo.widget.createWidget( "Tooltip", { isContainer: false, fastMixIn: true, caption: this._getActionLabel( actionName ), connectId: actionButton, delay: "100" } );
+                document.body.appendChild( tooltip.domNode );
+            }
         }
     },
 
     _getActionMenuPopupWidget: function()
     {
         return dojo.widget.byId( this.widgetId + "_ctxmenu" );
-    },  
+    },
+    _getActionLabel: function( actionName )
+    {
+        if ( actionName == null ) return null;
+        var actionlabel = null;
+        var actionLabelPrefs = jetspeed.prefs.desktopActionLabels;
+        if ( actionLabelPrefs != null )
+            actionlabel = actionLabelPrefs[ actionName ];
+        if ( actionlabel == null || actionlabel.length == 0 )
+        {
+            if ( this.portlet )
+            {
+                var portletActionDef = this.portlet.getAction( actionName );
+                if ( portletActionDef != null )
+                    actionlabel = portletActionDef.label;
+            }
+        }
+        if ( actionlabel == null || actionlabel.length == 0 )
+        {
+            actionlabel = dojo.string.capitalize( actionName );
+        }
+        return actionlabel;
+    },
     _createActionMenu: function( /* Array */ menuActionNames )
     {
         if ( menuActionNames == null || menuActionNames.length == 0 ) return;
         var portletWindow = this;
 
         var titleBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: this.widgetId + "_ctxmenu", contextMenuForWindow: false }, null );
-        var actionLabelPrefs = jetspeed.prefs.desktopActionLabels;
         for ( var i = 0 ; i < menuActionNames.length ; i++ )
         {
             var actionName = menuActionNames[i];
-            var menulabel = null;
-            if ( actionLabelPrefs != null )
-                menulabel = actionLabelPrefs[ actionName ];
-            if ( menulabel == null || menulabel.length == 0 )
-            {
-                if ( this.portlet )
-                {
-                    var portletActionDef = this.portlet.getAction( actionName );
-                    if ( portletActionDef != null )
-                        menulabel = portletActionDef.label;
-                }
-                if ( menulabel == null || menulabel.length == 0 )
-                {
-                    menulabel = dojo.string.capitalize( actionName );
-                }
-            }
-            
+            var menulabel = this._getActionLabel( actionName );
             var menuitem = this._createActionMenuItem( portletWindow, menulabel, actionName );
 
             this.actionMenus[ actionName ] = menuitem;
@@ -668,14 +677,14 @@
     _createActionMenuItem: function( portletWindow, menulabel, actionName )
     {
         var menuitem = dojo.widget.createWidget( "MenuItem2", { caption: menulabel } );
-        dojo.event.connect( menuitem, "onClick", function(e) { portletWindow.windowActionProcessChange( actionName ); } );
+        dojo.event.connect( menuitem, "onClick", function(e) { portletWindow.windowActionProcess( actionName ); } );
         return menuitem;
     },
 
     windowActionButtonClick: function( evt )
     {
         if ( evt == null || evt.target == null ) return;
-        this.windowActionProcessChange( evt.target.actionName, evt );
+        this.windowActionProcess( evt.target.actionName, evt );
     },
     windowActionMenuOpen: function( evt )
     {
@@ -700,9 +709,9 @@
         }
         this._getActionMenuPopupWidget().onOpen( evt );        
     },
-    windowActionProcessChange: function( /* String */ actionName, evt )
+    windowActionProcess: function( /* String */ actionName, evt )
     {   // evt arg is needed only for opening action menu
-        //dojo.debug( "windowActionProcessChange [" + ( this.portlet ? this.portlet.entityId : this.widgetId ) + ( this.portlet ? (" / " + this.widgetId) : "" ) + "]" + " actionName=" + actionName );
+        //dojo.debug( "windowActionProcess [" + ( this.portlet ? this.portlet.entityId : this.widgetId ) + ( this.portlet ? (" / " + this.widgetId) : "" ) + "]" + " actionName=" + actionName );
         if ( actionName == null ) return;
         if ( jetspeed.prefs.windowActionDesktop[ actionName ] != null )
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org