View Javadoc

1   /*
2    * Copyright 2000-2001,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.jetspeed.portal;
18  
19  import org.apache.jetspeed.capability.CapabilityMap;
20  
21  /***
22   * The PortletSkin defines the color scheme to use for displaying a
23   * specified portlet (and associated control)
24   *
25   * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
26   * @author <a href="mailto:paulsp@apache.org">Paul Spencer</a>
27   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
28   * @version $Id: PortletSkin.java,v 1.7 2004/02/23 04:05:35 jford Exp $
29   */
30  public interface PortletSkin extends java.util.Map
31  {
32      public static final String TEXT_COLOR = "text-color";
33      public static final String BACKGROUND_COLOR = "background-color";
34      public static final String TITLE_TEXT_COLOR = "title-text-color";
35      public static final String TITLE_BACKGROUND_COLOR = "title-background-color";
36      public static final String HIGHLIGHT_TEXT_COLOR = "highlight-text-color";
37      public static final String HIGHLIGHT_BACKGROUND_COLOR = "highlight-background-color";
38      public static final String CONTROLLER_STYLE_CLASS = "controller-style-class";
39      public static final String PORTLET_STYLE_CLASS = "portlet-style-class";
40      public static final String TITLE_STYLE_CLASS = "title-style-class";
41      public static final String CONTENT_STYLE_CLASS = "content-style-class";
42      public static final String HIGHLIGHT_TITLE_STYLE_CLASS = "highlight-title-style-class";
43      public static final String TAB_STYLE_CLASS = "tab-style-class";
44      public static final String TAB_TITLE_STYLE_CLASS = "tab-title-style-class";
45      public static final String TAB_CONTENT_STYLE_CLASS = "tab-content-style-class";
46      public static final String PORTLET_SKIN_CLASS = "portlet-skin-class";
47  
48      /***
49       * Returns the name of this color scheme
50       * @return the color scheme name
51       */
52      String getName();
53  
54      /***
55       * Returns the color to use for displaying the portlet text
56       * @return the text color value in HTML format (#RRGGBB)
57       */
58      String getTextColor();
59  
60      /***
61       * Sets the color to use for displaying the portlet text
62       * @param color the text color value in HTML format (#RRGGBB)
63       */
64      void setTextColor(String color);
65  
66      /***
67       * Returns the color to use for displaying the portlet background
68       * @return the text color value in HTML format (#RRGGBB)
69       */
70      String getBackgroundColor();
71  
72      /***
73       * Sets the color to use for displaying the portlet background
74       * @param backgroundColor the background color value in HTML format (#RRGGBB)
75       */
76      void setBackgroundColor(String backgroundColor);
77  
78      /***
79       * Returns the color to use for displaying the portlet title text
80       * @return the text color value in HTML format (#RRGGBB)
81       */
82      String getTitleTextColor();
83  
84      /***
85       * Sets the color to use for displaying the portlet title text
86       * @param titleColor the title color value in HTML format (#RRGGBB)
87       */
88      void setTitleTextColor(String titleColor);
89  
90      /***
91       * Returns the color to use for displaying the portlet title background
92       * @return the background color value in HTML format (#RRGGBB)
93       */
94      String getTitleBackgroundColor();
95  
96      /***
97       * Sets the color to use for displaying the portlet title background
98       * @param titleColor the title color value in HTML format (#RRGGBB)
99       */
100     void setTitleBackgroundColor(String titleColor);
101 
102     /***
103      * Returns the color to use for displaying an highlighted text
104      * @return the text color value in HTML format (#RRGGBB)
105      */
106     String getHighlightTextColor();
107 
108     /***
109      * Sets the color to use for displaying an highlighted text
110      * @param titleColor a color value in HTML format (#RRGGBB)
111      */
112     void setHighlightTextColor(String titleColor);
113 
114     /***
115      * Returns the color to use for displaying an highlighted background
116      * @return the background color value in HTML format (#RRGGBB)
117      */
118     String getHighlightBackgroundColor();
119 
120     /***
121      * Sets the color to use for displaying an highlighted background
122      * @param titleColor the title color value in HTML format (#RRGGBB)
123      */
124     void setHighlightBackgroundColor(String titleColor);
125 
126     /***
127      * Returns the CSS class to use for the portlet overall
128      * @return the CSS class to use (PortletStyleClass)
129      */
130     String getPortletStyleClass();
131 
132     /***
133      * Sets the CSS class to use for the portlet overall
134      * @param portletStyleClass the new class to be used
135      */
136     void setPortletStyleClass(String portletStyleClass);
137 
138     /***
139      * Returns the CSS class to use for the portlet title
140      * @return the CSS class to use (TitleStyleClass)
141      */
142     String getTitleStyleClass();
143 
144     /***
145      * Sets the CSS class to use for the portlet title
146      * @param titleStyleClass the new class to be used
147      */
148     void setTitleStyleClass(String titleStyleClass);
149 
150     /***
151      * Returns the CSS class to use for the portlet content
152      * @return the CSS class to use (ContentStyleClass)
153      */
154     String getContentStyleClass();
155 
156     /***
157      * Sets the CSS class to use for the portlet content
158      * @param contentStyleClass the new class to be used
159      */
160      void setContentStyleClass(String contentStyleClass);
161 
162     /***
163      * Returns the CSS class to use overall for the tabbed control
164      * @return the CSS class to use (TabStyleClass)
165      */
166     String getTabStyleClass();
167 
168     /***
169      * Sets the CSS class to use for overall for the tabbed control
170      * @param tabStyleClass the new class to be used
171      */
172     void setTabStyleClass(String tabStyleClass);
173 
174     /***
175      * Returns the CSS class to use on the title of the tabbed control
176      * @return the CSS class to use (TabTitleStyleClass)
177      */
178     String getTabTitleStyleClass();
179 
180     /***
181      * Sets the CSS class to use on the title of the tabbed control
182      * @param tabTitleStyleClass the new class to be used
183      */
184     void setTabTitleStyleClass(String tabTitleStyleClass);
185 
186     /***
187      * Returns the CSS class to use on the control of the tabbed control
188      * @return the CSS class to use (TabContentStyleClass)
189      */
190     String getTabContentStyleClass();
191 
192     /***
193      * Sets the CSS class to use on the control of the tabbed control
194      * @param tabContentStyleClass the new class to be used
195      */
196     void setTabContentStyleClass(String tabContentStyleClass);
197 
198     /***
199      * Returns the CSS class to use on the control of the Highlighted titles on tab or menu item
200      * @return the CSS class to use (HighlightTitleStyleClass)
201      */
202     String getHighlightTitleStyleClass();
203 
204     /***
205      * Sets the CSS class to use on the control of the Highlighted titles tab or menu item
206      * @param highlightTabStyleClass the new class to be used
207      */
208     void setHighlightTitleStyleClass(String highlightTitleStyleClass);
209 
210     /***
211      * Returns the CSS class to use for the Controller overall
212      * @return the CSS class to use (ControllerStyleClass)
213      */
214     String getControllerStyleClass();
215 
216     /***
217      * Sets the CSS class to use for the controller overall
218      * @param controllerStyleClass the new class to be used
219      */
220     void setControllerStyleClass(String controllerStyleClass);
221 
222     /***
223      * Returns a named image from this skin.  The skin property
224      * must be prefixed with "image-" within the registry.
225      * @param String name name of image to retreive.
226      *  <strong>DO NOT PREFIX WITH "image-"</strong>
227      * as getImage will do this for you.
228      * @param String dftPath realtive path to a default image if
229      * the named one is not in the registry.
230      * @return String relative path to the image
231      * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
232      */
233     String getImage(String name, String dftPath);
234 
235    /***
236     * This allows the PortalToolKit to make the PortletSkin aware
237     * of the current user-agents's capabilities
238     * @param CapabilityMap cm Current capaibilities of the user-agent
239     * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
240     */
241     void setCapabilityMap(CapabilityMap cm);
242 
243     /***
244      * This returns the class to use for the entire portlet, based
245      * on the cascading :
246      * portlet has 9 possible class to be used in a skin :
247      *                             ________________
248      * - title   (+ left/right)   |__|__________|__|
249      *                            |  |          |  |
250      *                            |  |          |  |
251      * - content (+ left/right)   |  |          |  |
252      *                            |  |          |  |
253      *                            |__|__________|__|
254      * - bottom  (+ left/right)   |__|__________|__|
255      *
256      * using cascading, we can change all of those class with one parent class
257      * -> this is how PortletSkinClass is used
258      */
259      String getPortletSkinClass();
260 
261 }