portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jf...@apache.org
Subject cvs commit: jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags PortletTreeControlTag.java
Date Fri, 04 Mar 2005 01:33:49 GMT
jford       2005/03/03 17:33:49

  Modified:    taglibs/treecontrol/src/java/org/apache/webapp/admin
                        TreeControlTag.java TreeControlNode.java
               taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags
                        PortletTreeControlTag.java
  Log:
  Allow node to have a clickable title
  Updated render methods to be up to date
  
  Revision  Changes    Path
  1.2       +29 -3     jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlTag.java
  
  Index: TreeControlTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TreeControlTag.java	2 Jul 2004 04:00:18 -0000	1.1
  +++ TreeControlTag.java	4 Mar 2005 01:33:49 -0000	1.2
  @@ -360,6 +360,12 @@
               encodeURL(updateTreeAction);
   
           out.print("    <td>");
  +        
  +//      add an anchor so that we can return to this node
  +        out.print("<a name=\"");
  +        out.print(node.getName());
  +        out.print("\">");
  +        
           if ((action != null) && !node.isLeaf()) {
               out.print("<a href=\"");
               out.print(response.encodeURL(action));
  @@ -394,14 +400,29 @@
   
           // Calculate the hyperlink for this node (if any)
           String hyperlink = null;
  -        if (node.getAction() != null)
  +        String nodeAction = node.getAction();
  +        if(nodeAction == null && node.isExpandWhenClicked())
  +        {
  +            hyperlink = action;
  +        }
  +        if (nodeAction != null)
               hyperlink = ((HttpServletResponse) pageContext.getResponse()).
                   encodeURL(node.getAction());
   
           // Render the icon for this node (if any)
           out.print("    <td colspan=\"");
           out.print(width - level + 1);
  -        out.print("\">");
  +        out.print("\"");
  +        
  +        if(node.getLabel() != null)
  +        {
  +            //make sure text does not wrap
  +            out.print(" style=\"");
  +            out.print("white-space:nowrap;");
  +            out.print("\"");
  +        }
  +        
  +        out.print(">");
           if (node.getIcon() != null) {
               if (hyperlink != null) {
                   out.print("<a href=\"");
  @@ -454,6 +475,11 @@
                       out.print(labelStyle);
                       out.print("\"");
                   }
  +                
  +                out.print(" title=\"");
  +                out.print(node.getLabel());
  +                out.print("\"");
  +                
                   // to refresh the tree in the same 'self' frame
                   out.print(" onclick=\"");
                   out.print("self.location.href='" + updateTreeAction + "'");
  
  
  
  1.4       +13 -1     jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlNode.java
  
  Index: TreeControlNode.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/webapp/admin/TreeControlNode.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TreeControlNode.java	28 Jan 2005 21:11:12 -0000	1.3
  +++ TreeControlNode.java	4 Mar 2005 01:33:49 -0000	1.4
  @@ -349,6 +349,18 @@
   		this.CSSClass = CSSClass;
   	}
       
  +    protected boolean expandWhenClicked = false;
  +    
  +    public boolean isExpandWhenClicked()
  +    {
  +        return expandWhenClicked;
  +    }
  +    
  +    public void setExpandWhenClicked(boolean expandWhenClicked)
  +    {
  +        this.expandWhenClicked = expandWhenClicked;
  +    }
  +    
   
       // --------------------------------------------------------- Public Methods
   
  
  
  
  1.8       +6 -1      jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags/PortletTreeControlTag.java
  
  Index: PortletTreeControlTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/taglibs/treecontrol/src/java/org/apache/jetspeed/portlets/tags/PortletTreeControlTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PortletTreeControlTag.java	28 Jan 2005 21:11:12 -0000	1.7
  +++ PortletTreeControlTag.java	4 Mar 2005 01:33:49 -0000	1.8
  @@ -213,7 +213,12 @@
   
           // Calculate the hyperlink for this node (if any)
           String hyperlink = null;
  -        if (node.getAction() != null)
  +        String nodeAction = node.getAction();
  +        if(nodeAction == null && node.isExpandWhenClicked())
  +        {
  +            hyperlink = treeAction;
  +        }
  +        if (nodeAction != null)
           {
               if(node.getAction().equals("portlet_url"))
               {
  
  
  

---------------------------------------------------------------------
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