001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.portalsite;
018:
019: import java.util.Locale;
020:
021: import org.apache.jetspeed.om.common.GenericMetadata;
022:
023: /**
024: * This interface describes common features of portal-site
025: * menu elements constructed and returned to decorators.
026: *
027: * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
028: * @version $Id: MenuElement.java 516448 2007-03-09 16:25:47Z ate $
029: */
030: public interface MenuElement {
031: /**
032: * MENU_ELEMENT_TYPE - element type of menu elements
033: */
034: String MENU_ELEMENT_TYPE = "menu";
035:
036: /**
037: * OPTION_ELEMENT_TYPE - element type of menu elements
038: */
039: String OPTION_ELEMENT_TYPE = "option";
040:
041: /**
042: * SEPARATOR_ELEMENT_TYPE - element type of separator elements
043: */
044: String SEPARATOR_ELEMENT_TYPE = "separator";
045:
046: /**
047: * getElementType - get type of menu element
048: *
049: * @return MENU_ELEMENT_TYPE, OPTION_ELEMENT_TYPE, or
050: * SEPARATOR_ELEMENT_TYPE
051: */
052: String getElementType();
053:
054: /**
055: * getParentMenu - get menu that contains menu element
056: *
057: * @return parent menu
058: */
059: Menu getParentMenu();
060:
061: /**
062: * getTitle - get default title for menu element
063: *
064: * @return title text
065: */
066: String getTitle();
067:
068: /**
069: * getShortTitle - get default short title for menu element
070: *
071: * @return short title text
072: */
073: String getShortTitle();
074:
075: /**
076: * getTitle - get locale specific title for menu element
077: * from metadata
078: *
079: * @param locale preferred locale
080: * @return title text
081: */
082: String getTitle(Locale locale);
083:
084: /**
085: * getShortTitle - get locale specific short title for menu
086: * element from metadata
087: *
088: * @param locale preferred locale
089: * @return short title text
090: */
091: String getShortTitle(Locale locale);
092:
093: /**
094: * getMetadata - get generic metadata for menu element
095: *
096: * @return metadata
097: */
098: GenericMetadata getMetadata();
099:
100: /**
101: * getSkin - get skin name for menu element
102: *
103: * @return skin name
104: */
105: String getSkin();
106: }
|