• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 package org.chromium.content.browser.input;
6 
7 import org.chromium.ui.DropdownItem;
8 
9 /**
10  * Select popup item containing the label, the type and the enabled state
11  * of an item belonging to a select popup dialog.
12  */
13 public class SelectPopupItem implements DropdownItem {
14     private final String mLabel;
15     private final int mType;
16 
SelectPopupItem(String label, int type)17     public SelectPopupItem(String label, int type) {
18         mLabel = label;
19         mType = type;
20     }
21 
22     @Override
getLabel()23     public String getLabel() {
24         return mLabel;
25     }
26 
27     @Override
getSublabel()28     public String getSublabel() {
29         return null;
30     }
31 
32     @Override
isEnabled()33     public boolean isEnabled() {
34         return mType == PopupItemType.ENABLED || mType == PopupItemType.GROUP;
35     }
36 
37     @Override
isGroupHeader()38     public boolean isGroupHeader() {
39         return mType == PopupItemType.GROUP;
40     }
41 
getType()42     public int getType() {
43         return mType;
44     }
45 }
46