public class NavButtonManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
NavButtonManager.OnModelChangedListener
Listener for when a specific button model has been modified
|
static interface |
NavButtonManager.OnModelListChangedListener
Listener for when the model list has been modified
|
Constructor and Description |
---|
NavButtonManager(android.content.Context c) |
Modifier and Type | Method and Description |
---|---|
void |
addButtonModel(ActionMenuData data)
Add a button model given action menu data
|
void |
addButtonModel(NavButtonModel model)
Add a button model to the root list
|
void |
addModelChangedListener(NavButtonManager.OnModelChangedListener l)
Add listener for events where a button model has been modified
|
void |
addModelListChangedListener(NavButtonManager.OnModelListChangedListener l)
Add listener for events where the button model list is modified
|
java.util.List<NavButtonModel> |
getButtonModels()
Retrieve a copy of the model list
|
static NavButtonManager |
getInstance() |
NavButtonModel |
getModelByIndex(int index)
Get a button model given its index
|
NavButtonModel |
getModelByPlugin(Tool plugin)
Find a button model for a plugin given its
Tool instance |
NavButtonModel |
getModelByReference(java.lang.String reference)
Get a button model given its name
|
int |
indexOfModel(NavButtonModel model)
Get the index of a model in the list
|
NavButtonModel |
modelFromActionData(ActionMenuData data)
Convert action menu data to a button model
|
void |
notifyModelChanged(NavButtonModel model)
Notify listeners that a model has been modified.
|
void |
notifyModelChanged(java.lang.String reference)
Notify listeners that a model has been modified
|
boolean |
removeButtonModel(ActionMenuData data)
Remove a button model given action menu data
|
boolean |
removeButtonModel(NavButtonModel model)
Remove a button model from the root list
|
void |
removeModelChangedListener(NavButtonManager.OnModelChangedListener l)
Remove model changed listener
|
void |
removeModelListChangedListener(NavButtonManager.OnModelListChangedListener l)
Remove model list changed listener
|
public static NavButtonManager getInstance()
public NavButtonModel getModelByReference(java.lang.String reference)
reference
- model reference used to uniquely identify the modelpublic NavButtonModel getModelByIndex(int index)
index
- Button model indexpublic NavButtonModel getModelByPlugin(Tool plugin)
Tool
instanceplugin
- Plugin tool instancepublic int indexOfModel(NavButtonModel model)
model
- Button modelpublic java.util.List<NavButtonModel> getButtonModels()
public NavButtonModel modelFromActionData(ActionMenuData data)
data
- Action menu datapublic void addButtonModel(NavButtonModel model)
model
- Button model to addpublic void addButtonModel(ActionMenuData data)
data
- Action menu datapublic boolean removeButtonModel(NavButtonModel model)
model
- Button modelpublic boolean removeButtonModel(ActionMenuData data)
data
- Action menu datapublic void addModelChangedListener(NavButtonManager.OnModelChangedListener l)
l
- Listenerpublic void removeModelChangedListener(NavButtonManager.OnModelChangedListener l)
l
- Listenerpublic void addModelListChangedListener(NavButtonManager.OnModelListChangedListener l)
l
- Listenerpublic void removeModelListChangedListener(NavButtonManager.OnModelListChangedListener l)
l
- Listenerpublic void notifyModelChanged(NavButtonModel model)
model
- Model that was modifiedpublic void notifyModelChanged(java.lang.String reference)
reference
- Model reference that was modified