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  /***
20   * This interface describes the portal-site menu option
21   * elements constructed and returned to decorators.
22   * 
23   * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
24   * @version $Id: MenuOption.java 537314 2007-05-11 23:08:36Z taylor $
25   */
26  public interface MenuOption extends MenuElement
27  {
28      /***
29       * FOLDER_OPTION_TYPE - type of folder menu option
30       */
31      String FOLDER_OPTION_TYPE = "folder";
32  
33      /***
34       * PAGE_OPTION_TYPE - type of page menu option
35       */
36      String PAGE_OPTION_TYPE = "page";
37  
38      /***
39       * LINK_OPTION_TYPE - type of link menu option
40       */
41      String LINK_OPTION_TYPE = "link";
42  
43      /***
44       * getType - get type of menu option
45       *
46       * @return FOLDER_OPTION_TYPE, PAGE_OPTION_TYPE, or
47       *         LINK_OPTION_TYPE
48       */
49      String getType();
50  
51      /***
52       * getUrl - get url of menu option
53       *
54       * @return folder, page, or link url
55       */
56      String getUrl();
57  
58      /***
59       * getTarget - get target for url of menu option
60       *
61       * @return url target
62       */
63      String getTarget();
64  
65      /***
66       * getDefaultPage - get target for url of menu option
67       *
68       * @return url target
69       */
70      String getDefaultPage();
71      
72      /***
73       * isHidden - get hidden state of menu option
74       *
75       * @return hidden state
76       */
77      boolean isHidden();
78  
79      /***
80       * isSelected - return true if menu option is selected in
81       *              the specified request context
82       *
83       * @param context request context
84       * @return selected state
85       */
86      boolean isSelected(PortalSiteRequestContext context);
87  }