forked from tomivirkki/cdiutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
22 lines (16 loc) · 1.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CDI Utils is an add-on for Vaadin framework aiming at simplifying
application development with Vaadin and CDI. Here are the utilities it provides:
1. @VaadinScope
Custom CDI scope designed especially for vaadin applications.
2. Lightweight MVP framework
2.1.Extend View interface for your view
2.2.Create view instance that extends AbstractView and implements your View extension
2.3.Extend AbstractPresenter and annotate it with @ViewInterface(YourViewInterface.class)
That's it.
-The correct view instance is then automatically injected to your presenter (Your view control logic can then reside in the presenter)
-The view should use CDI's built-in event bus to fire events that are observed by the presenter. The add-on provides a utility for this: fireViewEvent(ParameterDTO). The ParameterDTO can be used to transfer any data to the presenter (CDI Event observers only accept one parameter)
-Call yourViewImplementationInstance.openView() each time the view is accessed (this will eventually invoke yourPresenterInstance.viewOpened())
3. Producers for declaratively defined Vaadin components (@Preconfigured -annotation)
Inject preconfigured Vaadin Components to your views. For example:
@Preconfigured(captionKey="btnUpdate", styleName=Button.STYLE_LINK, enabled=false)
private Button button;