Search in sources :

Example 1 with SendEmailClickListener

use of com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener in project cia by Hack23.

the class EmailPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    final String pageId = getPageId(parameters);
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_EMAIL);
    final VerticalLayout emailLayout = new VerticalLayout();
    emailLayout.setSizeFull();
    final Panel formPanel = new Panel();
    formPanel.setSizeFull();
    emailLayout.addComponent(formPanel);
    final FormLayout formContent = new FormLayout();
    formPanel.setContent(formContent);
    final SendEmailRequest sendEmailRequest = new SendEmailRequest();
    sendEmailRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    sendEmailRequest.setEmail("");
    sendEmailRequest.setSubject("");
    sendEmailRequest.setContent("");
    final ClickListener sendEmailListener = new SendEmailClickListener(sendEmailRequest);
    getFormFactory().addRequestInputFormFields(formContent, sendEmailRequest, SendEmailRequest.class, SEND_EMAIL_REQUEST_FORM_FIELDS, EMAIL, sendEmailListener);
    content.addComponent(emailLayout);
    content.setExpandRatio(emailLayout, ContentRatio.LARGE_FORM);
    panel.setCaption(NAME + "::" + ADMIN_EMAIL);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_EMAIL_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : FormLayout(com.vaadin.ui.FormLayout) SendEmailClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener) Panel(com.vaadin.ui.Panel) VerticalLayout(com.vaadin.ui.VerticalLayout) ClickListener(com.vaadin.ui.Button.ClickListener) SendEmailClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener) SendEmailRequest(com.hack23.cia.service.api.action.admin.SendEmailRequest) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

SendEmailRequest (com.hack23.cia.service.api.action.admin.SendEmailRequest)1 SendEmailClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 FormLayout (com.vaadin.ui.FormLayout)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1