public class GuiContext extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GuiContext.Type |
Modifier and Type | Field and Description |
---|---|
private Item |
item |
private String |
subContext |
private GuiContext.Type |
type |
Constructor and Description |
---|
GuiContext(Item item,
GuiContext.Type type) |
GuiContext(Item item,
GuiContext.Type type,
String subContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
Item |
getItem() |
String |
getSubContext() |
GuiContext.Type |
getType() |
int |
hashCode() |
boolean |
isCorrectBasicData(Object o)
Checks if the specified object is an instance of the
BasicData subclass used by the
Item in this context. |
boolean |
isCorrectBasicItem(Object o)
Checks if the specified object is an instance of the
BasicItem subclass used by the
Item in this context. |
static GuiContext |
item(Item item)
Shortcut to create a single-item context.
|
static GuiContext |
item(Item item,
String subContext)
Shortcut to create a single-item context
with a subcontext.
|
static GuiContext |
list(Item item)
Shortcut to create a list context.
|
static GuiContext |
list(Item item,
String subContext)
Shortcut to create a list context with a
subcontext.
|
String |
toString() |
private final Item item
private final GuiContext.Type type
private final String subContext
public GuiContext(Item item, GuiContext.Type type)
item
- Item the context holds.type
- Type of context,
shows if it is a list or single view.public GuiContext(Item item, GuiContext.Type type, String subContext)
public static GuiContext item(Item item)
public static GuiContext item(Item item, String subContext)
public static GuiContext list(Item item)
public static GuiContext list(Item item, String subContext)
public Item getItem()
public GuiContext.Type getType()
public String getSubContext()
public boolean isCorrectBasicItem(Object o)
Item
in this context.o
- The object to checkpublic boolean isCorrectBasicData(Object o)
Item
in this context.o
- The object to check