SigSlotCustom
realization of Signal-Slot paradigm for Vaadin
Signal-Slot-Custom component for Vaadin
This is realization of Signal-Slot paradigm for Vaadin, it's entry signal bus to application. Signal's may generated anywhere for 3 scope: Local - only for current instants Application - for current UI (thread) Deployment - for all UI in current container Server - for JMX propagation
Also intoduce some CDI as @Resource(lookup="JNDI") implementation
To work with this:
- Add this add-on to project
- Make own superclass of SigSlotComponent.
Here is trivial chat application widget with signal-slot (as included in demo project) @Push public class Chat extends SigSlotComponent { private String name = null; private TextField query = new TextField();
@Signal("sendtext")
public Button send = new Button("send");
private VerticalLayout text = new VerticalLayout(query,send);
@Slot("sendtext") public void send(Object o) { if (name == null) name = query.getValue(); else signal(SignalScope.Deployment, "chatmessage", name + ":" + query.getValue()); query.setValue(""); }
@Slot(value = "chatmessage", scope = SignalScope.Deployment)
public void receiver(String message) {
text.addComponent(new Label(message), text.getComponentIndex(query));
}
public Chat() {
setCompositionRoot(text);
}
}
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
- add JMX support for Server scope signal distribution
- add @Resource(lookup="JNDI") annotation (replace CDI)
- Released
- 2015-03-10
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 7.1+
- Browser
- Browser Independent