|
Navigation: Programming Cookbook > Creating GUI Applications > Creating MVP Components > Presenters |
![]() ![]()
|
The presenter is the "hub" of the component. All components will have their own presenter class that brings together a model with an appropriate view to display it. When we talk about a component, we are really talking about a particular presenter.
Here are some examples in the image:
Purpose |
Presenter class |
Notes |
Text editing |
TextPresenter |
Depending what sort of view is used, a TextPresenter can be used to edit single line or multiline text. |
Number editing |
NumberPresenter |
Depending on the view used, a NumberPresenter can be used to edit/display numbers in a variety of forms e.g. as text, as a slider, as a spin button, as a progress bar etc. |
Date editing |
DatePresenter |
Depending on the view used, a DataPresenter can be used to edit/display dates as text or as a calendar picker etc. |
List display |
ListPresenter |
Depending on the view used, a ListPresenter can display sequenceable collections of objects in a single column listbox, in a multicolumn list view, as a series of tabs etc |