public class CPreferenceMenuPiece extends BaseMenuPiece
model to show on the dialog can either be set
explicitly using setModel(PreferenceModel), or else will be read
from CControl.getPreferenceModel().setup(CControl) to ensure that the
CControl has a model.| Constructor and Description |
|---|
CPreferenceMenuPiece(CControl control)
Creates a new menu piece.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
action()
Opens a dialog with the current
PreferenceModel. |
void |
bind()
This method is called if there is a possibility for the user to see this menu.
|
PreferenceModel |
getModel()
Gets the model which was explicitly set.
|
void |
setModel(PreferenceModel model)
Explicitly sets the model which will be shown on the dialog.
|
static CPreferenceMenuPiece |
setup(CControl control)
Creates a new
CPreferenceMenuPiece. |
void |
unbind()
This method is called if the user has no longer any possibility to see this menu.
|
add, addSeparator, fill, getItem, getItemCount, insert, insertSeparator, remove, remove, removeAlladdListener, fireInsert, fireRemove, getMenu, getParent, isBound, items, removeListener, setParentpublic CPreferenceMenuPiece(CControl control)
control - the control for which this piece works, not nullpublic static CPreferenceMenuPiece setup(CControl control)
CPreferenceMenuPiece. Reads the model of control,
if control has no model then a new PreferenceModel will
be created and set.control - the control whose model will be shownCControl.getPreferenceModel(),
CControl.setPreferenceModel(PreferenceModel)public void bind()
MenuPiecebind in class MenuPieceMenuPiece.unbind()public void unbind()
MenuPieceunbind in class MenuPieceMenuPiece.bind()public void setModel(PreferenceModel model)
null is set, then this menu will try to show
CControl.getPreferenceModel().model - the model to use or nullpublic PreferenceModel getModel()
nullsetModel(PreferenceModel)protected void action()
PreferenceModel.Copyright © 2018. All rights reserved.