View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.portalsite;
18  
19  import java.util.Locale;
20  
21  import org.apache.jetspeed.om.common.GenericMetadata;
22  
23  /***
24   * This interface describes common features of portal-site
25   * menu elements constructed and returned to decorators.
26   * 
27   * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
28   * @version $Id: MenuElement.java 516448 2007-03-09 16:25:47Z ate $
29   */
30  public interface MenuElement
31  {
32      /***
33       * MENU_ELEMENT_TYPE - element type of menu elements
34       */
35      String MENU_ELEMENT_TYPE = "menu";
36  
37      /***
38       * OPTION_ELEMENT_TYPE - element type of menu elements
39       */
40      String OPTION_ELEMENT_TYPE = "option";
41  
42      /***
43       * SEPARATOR_ELEMENT_TYPE - element type of separator elements
44       */
45      String SEPARATOR_ELEMENT_TYPE = "separator";
46  
47      /***
48       * getElementType - get type of menu element
49       *
50       * @return MENU_ELEMENT_TYPE, OPTION_ELEMENT_TYPE, or
51       *         SEPARATOR_ELEMENT_TYPE
52       */
53      String getElementType();
54  
55      /***
56       * getParentMenu - get menu that contains menu element 
57       *
58       * @return parent menu
59       */    
60      Menu getParentMenu();
61  
62      /***
63       * getTitle - get default title for menu element
64       *
65       * @return title text
66       */
67      String getTitle();
68  
69      /***
70       * getShortTitle - get default short title for menu element
71       *
72       * @return short title text
73       */
74      String getShortTitle();
75  
76      /***
77       * getTitle - get locale specific title for menu element
78       *            from metadata
79       *
80       * @param locale preferred locale
81       * @return title text
82       */
83      String getTitle(Locale locale);
84  
85      /***
86       * getShortTitle - get locale specific short title for menu
87       *                 element from metadata
88       *
89       * @param locale preferred locale
90       * @return short title text
91       */
92      String getShortTitle(Locale locale);
93  
94      /***
95       * getMetadata - get generic metadata for menu element
96       *
97       * @return metadata
98       */    
99      GenericMetadata getMetadata();
100 
101     /***
102      * getSkin - get skin name for menu element
103      *
104      * @return skin name
105      */
106     String getSkin();
107 }