01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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.List;
20:
21: /**
22: * This interface describes the portal-site menu elements
23: * constructed and returned to decorators.
24: *
25: * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
26: * @version $Id: Menu.java 516448 2007-03-09 16:25:47Z ate $
27: */
28: public interface Menu extends MenuElement {
29: /**
30: * getName - get name of menu
31: *
32: * @return menu name
33: */
34: String getName();
35:
36: /**
37: * getUrl - get url of top level folder that defined
38: * menu options; only available for menus
39: * defined without multiple options, nested
40: * menus, or separators
41: *
42: * @return folder url
43: */
44: String getUrl();
45:
46: /**
47: * isHidden - get hidden state of folder that defined
48: * menu options; only available for menus
49: * defined without multiple options, nested
50: * menus, or separators
51: *
52: * @return hidden state
53: */
54: boolean isHidden();
55:
56: /**
57: * isSelected - return true if an option or nested
58: * menu within this menu are selected by
59: * the specified request context
60: *
61: * @param context request context
62: * @return selected state
63: */
64: boolean isSelected(PortalSiteRequestContext context);
65:
66: /**
67: * getElements - get ordered list of menu elements that
68: * are members of this menu; possibly contains
69: * options, nested menus, or separators
70: *
71: * @return menu elements list
72: */
73: List getElements();
74:
75: /**
76: * isEmpty - get empty state of list of menu elements
77: *
78: * @return menu elements list empty state
79: */
80: boolean isEmpty();
81:
82: /**
83: * getSelectedElement - return selected option or nested
84: * menu within this menu selected by
85: * the specified request context
86: *
87: * @return selected menu element
88: */
89: MenuElement getSelectedElement(PortalSiteRequestContext context);
90: }
|