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;
}
Aggregations