portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Christianson <r...@echospace.com>
Subject Proposal, rename method PanedPortletController.retrievePaneID
Date Tue, 13 May 2003 22:56:04 GMT
I spent a long time trying to figure out the best way to get the current 
selected pane/portlet id from PanedPortletController. My first solution 
was to use the method "isSelected", but then I noticed the odd'ly named 
method "retrievePaneID". It seems "retrievePaneID" actually returns the 
currently selected pane's id. Which is actually a portlet id right? I 
propose we rename "retrievePaneID" to "getSelectedPortletID" or 
"getSelectedPaneID".

If my proposal doesnt taste good, maybe we should atleast update the 
javadocs, so you can tell what the method does. Right now it reads 
"Returns the pane id of the parameter used for pane selection".

BTW, is there a better way to get the current selected pane/portlet id? 
Here is how I did it:


PanedPortletController controller = null;
PortletSet portlets = (PortletSet) getPortlet();
if (portlets.getController() instanceof PanedPortletController) {    
    controller = (PanedPortletController) portlets.getController();
}

if ( controller != null ) {
    selectedPaneID = controller.retrievePaneID( rundata, true );
    if ( selectedPaneID == null ) {
        selectedPaneID = controller.retrievePaneID( rundata, false );    
    }
}


Ryan Christianson
**


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


Mime
View raw message