public class Item extends AbstractItem
| Constructor and Description |
|---|
Item(android.content.Context context,
int id,
int resourceId)
Creates a new item.
|
Item(int id,
java.lang.CharSequence title)
Creates a new item.
|
| Modifier and Type | Method and Description |
|---|---|
Item |
clone() |
boolean |
equals(java.lang.Object obj) |
android.graphics.drawable.Drawable |
getIcon()
Returns the item's icon.
|
int |
hashCode() |
boolean |
isEnabled()
Returns, whether the item is enabled, or not.
|
void |
setEnabled(boolean enabled)
Sets, whether the item should be enabled, or not.
|
void |
setIcon(android.content.Context context,
int resourceId)
Sets the item's icon.
|
void |
setIcon(android.graphics.drawable.Drawable icon)
Sets the item's icon.
|
void |
setTitle(java.lang.CharSequence title)
Sets the item's title.
|
void |
setTitle(android.content.Context context,
int resourceId)
Sets the title of the item.
|
java.lang.String |
toString() |
getId, getTitlepublic Item(int id,
java.lang.CharSequence title)
id - The item's id as an Integer value. The id must be at least 0title - The item's title as an instance of the type CharSequence. The title may
neither be null, nor emptypublic Item(android.content.Context context,
int id,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullid - The item's id as an Integer valueresourceId - The resource id of the item's title as an Integer value. The resource id must
correspond to a valid string resourcepublic final android.graphics.drawable.Drawable getIcon()
Drawablepublic final void setIcon(android.graphics.drawable.Drawable icon)
icon - The icon, which should be set, as an instance of the class Drawable, or null,
if no icon should be setpublic final void setIcon(android.content.Context context,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcepublic final boolean isEnabled()
public final void setEnabled(boolean enabled)
enabled - True, if the item should be enabled, false otherwisepublic final void setTitle(android.content.Context context,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the title, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final void setTitle(java.lang.CharSequence title)
AbstractItemsetTitle in class AbstractItemtitle - The title, which should be set, as an instance of the type CharSequence or
null, of no title should be setpublic final Item clone()
clone in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Objectpublic final int hashCode()
hashCode in class AbstractItempublic final boolean equals(java.lang.Object obj)
equals in class AbstractItem