397fd1c2d702be8e26f7aa5d2caef385ed5a0a8c
2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com
.actionbarsherlock
.view
;
19 import android
.graphics
.drawable
.Drawable
;
20 import android
.view
.View
;
23 * Subclass of {@link Menu} for sub menus.
25 * Sub menus do not support item icons, or nested sub menus.
27 * <div class="special reference">
28 * <h3>Developer Guides</h3>
29 * <p>For information about creating menus, read the
30 * <a href="{@docRoot}guide/topics/ui/menus.html">Menus</a> developer guide.</p>
34 public interface SubMenu
extends Menu
{
36 * Sets the submenu header's title to the title given in <var>titleRes</var>
37 * resource identifier.
39 * @param titleRes The string resource identifier used for the title.
40 * @return This SubMenu so additional setters can be called.
42 public SubMenu
setHeaderTitle(int titleRes
);
45 * Sets the submenu header's title to the title given in <var>title</var>.
47 * @param title The character sequence used for the title.
48 * @return This SubMenu so additional setters can be called.
50 public SubMenu
setHeaderTitle(CharSequence title
);
53 * Sets the submenu header's icon to the icon given in <var>iconRes</var>
56 * @param iconRes The resource identifier used for the icon.
57 * @return This SubMenu so additional setters can be called.
59 public SubMenu
setHeaderIcon(int iconRes
);
62 * Sets the submenu header's icon to the icon given in <var>icon</var>
65 * @param icon The {@link Drawable} used for the icon.
66 * @return This SubMenu so additional setters can be called.
68 public SubMenu
setHeaderIcon(Drawable icon
);
71 * Sets the header of the submenu to the {@link View} given in
72 * <var>view</var>. This replaces the header title and icon (and those
75 * @param view The {@link View} used for the header.
76 * @return This SubMenu so additional setters can be called.
78 public SubMenu
setHeaderView(View view
);
81 * Clears the header of the submenu.
83 public void clearHeader();
86 * Change the icon associated with this submenu's item in its parent menu.
88 * @see MenuItem#setIcon(int)
89 * @param iconRes The new icon (as a resource ID) to be displayed.
90 * @return This SubMenu so additional setters can be called.
92 public SubMenu
setIcon(int iconRes
);
95 * Change the icon associated with this submenu's item in its parent menu.
97 * @see MenuItem#setIcon(Drawable)
98 * @param icon The new icon (as a Drawable) to be displayed.
99 * @return This SubMenu so additional setters can be called.
101 public SubMenu
setIcon(Drawable icon
);
104 * Gets the {@link MenuItem} that represents this submenu in the parent
105 * menu. Use this for setting additional item attributes.
107 * @return The {@link MenuItem} that launches the submenu when invoked.
109 public MenuItem
getItem();