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 we...@apache.org on 2003/03/27 18:46:21 UTC

cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal BasePortletSkin.java PortletSkin.java

weaver      2003/03/27 09:46:20

  Modified:    webapp/WEB-INF/templates/vm/controls/html jetspeed.vm
               src/java/org/apache/jetspeed/portal BasePortletSkin.java
                        PortletSkin.java
  Log:
  Bug ID: 18208 "Allow skinning of action icons"
  
  - Portlets using the jetspeed.vm can now have "skinned" action icons.  
    This is acheived by creating properties within the skin in the format of
    "image-{action name}".  If these are not defined, the original icons are used.
  
  - Removed redundant "public" modifiers within the PortletSkin interface per Checkstyle recommendation.
  
  Revision  Changes    Path
  1.15      +2 -1      jakarta-jetspeed/webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm
  
  Index: jetspeed.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/webapp/WEB-INF/templates/vm/controls/html/jetspeed.vm,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jetspeed.vm	10 Jan 2003 23:06:05 -0000	1.14
  +++ jetspeed.vm	27 Mar 2003 17:46:19 -0000	1.15
  @@ -53,7 +53,8 @@
       </td>
       <td align="right" nowrap="true" valign="middle" #if (${skin.TitleStyleClass}) class="${skin.TitleStyleClass}" #end #if (${titlestyle}) style="${titlestyle}" #end>
   #foreach ( $action in $actions )
  -      <a href="${action.Link}" title="${action.Name}" ><img src="images/${action.Name}.gif" alt="${action.Alt}" border="0"></a>
  +      <!--<a href="${action.Link}" title="${action.Name}" ><img src="images/${action.Name}.gif" alt="${action.Alt}" border="0"></a>-->
  +      <a href="${action.Link}" title="${action.Name}" ><img src="${skin.getImage($action.Name,"images/${action.Name}.gif")}" alt="${action.Alt}" border="0"></a>
   #end
       </td>
     </tr>
  
  
  
  1.4       +20 -1     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletSkin.java
  
  Index: BasePortletSkin.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/BasePortletSkin.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BasePortletSkin.java	16 Nov 2001 22:44:34 -0000	1.3
  +++ BasePortletSkin.java	27 Mar 2003 17:46:20 -0000	1.4
  @@ -60,6 +60,7 @@
    *
    * @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
    * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
  + * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
    * @version $Id$
    */
   public class BasePortletSkin extends java.util.HashMap implements PortletSkin
  @@ -378,4 +379,22 @@
               put(CONTROLLER_STYLE_CLASS,controllerStyleClass);
           }
       }
  +    
  +   
  +    /**
  +     * @see org.apache.jetspeed.portal.PortletSkin#getImage(String, String)
  +     */
  +    public String getImage(String name, String dftPath)
  +    {
  +
  +        if (containsKey("image-" + name))
  +        {
  +            return (String) get("image-" + name);
  +        }
  +        else
  +        {
  +            return dftPath;
  +        }
  +    }
  +
   }
  
  
  
  1.4       +44 -30    jakarta-jetspeed/src/java/org/apache/jetspeed/portal/PortletSkin.java
  
  Index: PortletSkin.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/PortletSkin.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortletSkin.java	16 Nov 2001 22:44:34 -0000	1.3
  +++ PortletSkin.java	27 Mar 2003 17:46:20 -0000	1.4
  @@ -60,6 +60,7 @@
    *
    * @author <a href="mailto:raphael@apache.org">Rapha�l Luta</a>
    * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
  + * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
    * @version $Id$
    */
   public interface PortletSkin extends java.util.Map
  @@ -84,174 +85,187 @@
        * Returns the name of this color scheme
        * @return the color scheme name
        */
  -    public String getName();
  +    String getName();
   
       /**
        * Returns the color to use for displaying the portlet text
        * @return the text color value in HTML format (#RRGGBB)
        */
  -    public String getTextColor();
  +    String getTextColor();
   
       /**
        * Sets the color to use for displaying the portlet text
        * @param color the text color value in HTML format (#RRGGBB)
        */
  -    public void setTextColor(String color);
  +    void setTextColor(String color);
   
       /**
        * Returns the color to use for displaying the portlet background
        * @return the text color value in HTML format (#RRGGBB)
        */
  -    public String getBackgroundColor();
  +    String getBackgroundColor();
   
       /**
        * Sets the color to use for displaying the portlet background
        * @param backgroundColor the background color value in HTML format (#RRGGBB)
        */
  -    public void setBackgroundColor(String backgroundColor);
  +    void setBackgroundColor(String backgroundColor);
   
       /**
        * Returns the color to use for displaying the portlet title text
        * @return the text color value in HTML format (#RRGGBB)
        */
  -    public String getTitleTextColor();
  +    String getTitleTextColor();
   
       /**
        * Sets the color to use for displaying the portlet title text
        * @param titleColor the title color value in HTML format (#RRGGBB)
        */
  -    public void setTitleTextColor(String titleColor);
  +    void setTitleTextColor(String titleColor);
   
       /**
        * Returns the color to use for displaying the portlet title background
        * @return the background color value in HTML format (#RRGGBB)
        */
  -    public String getTitleBackgroundColor();
  +    String getTitleBackgroundColor();
   
       /**
        * Sets the color to use for displaying the portlet title background
        * @param titleColor the title color value in HTML format (#RRGGBB)
        */
  -    public void setTitleBackgroundColor(String titleColor);
  +    void setTitleBackgroundColor(String titleColor);
   
       /**
        * Returns the color to use for displaying an highlighted text
        * @return the text color value in HTML format (#RRGGBB)
        */
  -    public String getHighlightTextColor();
  +    String getHighlightTextColor();
   
       /**
        * Sets the color to use for displaying an highlighted text
        * @param titleColor a color value in HTML format (#RRGGBB)
        */
  -    public void setHighlightTextColor(String titleColor);
  +    void setHighlightTextColor(String titleColor);
   
       /**
        * Returns the color to use for displaying an highlighted background
        * @return the background color value in HTML format (#RRGGBB)
        */
  -    public String getHighlightBackgroundColor();
  +    String getHighlightBackgroundColor();
   
       /**
        * Sets the color to use for displaying an highlighted background
        * @param titleColor the title color value in HTML format (#RRGGBB)
        */
  -    public void setHighlightBackgroundColor(String titleColor);
  +    void setHighlightBackgroundColor(String titleColor);
   
       /**
        * Returns the CSS class to use for the portlet overall
        * @return the CSS class to use (PortletStyleClass)
        */
  -    public String getPortletStyleClass();
  +    String getPortletStyleClass();
   
       /**
        * Sets the CSS class to use for the portlet overall
        * @param portletStyleClass the new class to be used
        */
  -    public void setPortletStyleClass(String portletStyleClass);
  +    void setPortletStyleClass(String portletStyleClass);
   
       /**
        * Returns the CSS class to use for the portlet title
        * @return the CSS class to use (TitleStyleClass)
        */
  -    public String getTitleStyleClass();
  +    String getTitleStyleClass();
   
       /**
        * Sets the CSS class to use for the portlet title
        * @param titleStyleClass the new class to be used
        */
  -    public void setTitleStyleClass(String titleStyleClass);
  +    void setTitleStyleClass(String titleStyleClass);
   
       /**
        * Returns the CSS class to use for the portlet content
        * @return the CSS class to use (ContentStyleClass)
        */
  -    public String getContentStyleClass();
  +    String getContentStyleClass();
   
       /**
        * Sets the CSS class to use for the portlet content
        * @param contentStyleClass the new class to be used
        */
  -    public void setContentStyleClass(String contentStyleClass);
  +     void setContentStyleClass(String contentStyleClass);
   
       /**
        * Returns the CSS class to use overall for the tabbed control
        * @return the CSS class to use (TabStyleClass)
        */
  -    public String getTabStyleClass();
  +    String getTabStyleClass();
   
       /**
        * Sets the CSS class to use for overall for the tabbed control
        * @param tabStyleClass the new class to be used
        */
  -    public void setTabStyleClass(String tabStyleClass);
  +    void setTabStyleClass(String tabStyleClass);
   
       /**
        * Returns the CSS class to use on the title of the tabbed control
        * @return the CSS class to use (TabTitleStyleClass)
        */
  -    public String getTabTitleStyleClass();
  +    String getTabTitleStyleClass();
   
       /**
        * Sets the CSS class to use on the title of the tabbed control
        * @param tabTitleStyleClass the new class to be used
        */
  -    public void setTabTitleStyleClass(String tabTitleStyleClass);
  +    void setTabTitleStyleClass(String tabTitleStyleClass);
   
       /**
        * Returns the CSS class to use on the control of the tabbed control
        * @return the CSS class to use (TabContentStyleClass)
        */
  -    public String getTabContentStyleClass();
  +    String getTabContentStyleClass();
   
       /**
        * Sets the CSS class to use on the control of the tabbed control
        * @param tabContentStyleClass the new class to be used
        */
  -    public void setTabContentStyleClass(String tabContentStyleClass);
  +    void setTabContentStyleClass(String tabContentStyleClass);
   
       /**
        * Returns the CSS class to use on the control of the Highlighted titles on tab or menu item
        * @return the CSS class to use (HighlightTitleStyleClass)
        */
  -    public String getHighlightTitleStyleClass();
  +    String getHighlightTitleStyleClass();
   
       /**
        * Sets the CSS class to use on the control of the Highlighted titles tab or menu item
        * @param highlightTabStyleClass the new class to be used
        */
  -    public void setHighlightTitleStyleClass(String highlightTitleStyleClass);
  +    void setHighlightTitleStyleClass(String highlightTitleStyleClass);
   
       /**
        * Returns the CSS class to use for the Controller overall
        * @return the CSS class to use (ControllerStyleClass)
        */
  -    public String getControllerStyleClass();
  +    String getControllerStyleClass();
   
       /**
        * Sets the CSS class to use for the controller overall
        * @param controllerStyleClass the new class to be used
        */
  -    public void setControllerStyleClass(String controllerStyleClass);
  +    void setControllerStyleClass(String controllerStyleClass);
  +    
  +    /**
  +     * Returns a named image from this skin.  The skin property
  +     * must be prefixed with "image-" within the registry.  
  +     * @param String name name of image to retreive.  
  +     *  <strong>DO NOT PREFIX WITH "image-"</strong>
  +     * as getImage will do this for you.
  +     * @param String dftPath realtive path to a default image if
  +     * the named one is not in the registry.
  +     * @return String relative path to the image
  +     * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
  +     */
  +    String getImage(String name, String dftPath);
   
   }
  
  
  

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