BridgeMenuItemImpl.java revision 5ba2f230faa355eb9bc1e90f6c48eeeb437f390c
1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package com.android.internal.view.menu;
18
19/**
20 * An extension of the {@link MenuItemImpl} to store the view cookie also.
21 */
22public class BridgeMenuItemImpl extends MenuItemImpl {
23
24    /**
25     * An object returned by the IDE that helps mapping each View to the corresponding XML tag in
26     * the layout. For Menus, we store this cookie here and attach it to the corresponding view
27     * at the time of rendering.
28     */
29    private Object viewCookie;
30
31    /**
32     * Instantiates this menu item.
33     */
34    BridgeMenuItemImpl(MenuBuilder menu, int group, int id, int categoryOrder, int ordering,
35            CharSequence title, int showAsAction) {
36        super(menu, group, id, categoryOrder, ordering, title, showAsAction);
37    }
38
39
40    public Object getViewCookie() {
41        return viewCookie;
42    }
43
44    public void setViewCookie(Object viewCookie) {
45        this.viewCookie = viewCookie;
46    }
47}
48