Search in sources :

Example 1 with StartAgentClickListener

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

the class AgentOperationsOverviewPageModContentFactoryImpl method createContent.

@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    getMenuItemFactory().createMainPageMenuBar(menuBar);
    LabelFactory.createHeader2Label(content, ADMIN_AGENT_OPERATION);
    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
    final ResponsiveRow grid = createGridLayout(overviewLayout);
    for (final DataAgentTarget dataAgentTarget : DataAgentTarget.values()) {
        final Button importDataButton = new Button(MessageFormat.format(BUTTON_PATTERN, DataAgentOperation.IMPORT, dataAgentTarget), VaadinIcons.BULLSEYE);
        importDataButton.addClickListener(new StartAgentClickListener(dataAgentTarget, DataAgentOperation.IMPORT));
        importDataButton.setId(MessageFormat.format(BUTTON_ID_PATTERN, ViewAction.START_AGENT_BUTTON, DataAgentOperation.IMPORT, dataAgentTarget));
        createRowItem(grid, importDataButton, WILL_FETCH_DATA_FROM_SOURCE);
    }
    final String pageId = getPageId(parameters);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
    return content;
}
Also used : Button(com.vaadin.ui.Button) ResponsiveRow(com.jarektoro.responsivelayout.ResponsiveRow) VerticalLayout(com.vaadin.ui.VerticalLayout) DataAgentTarget(com.hack23.cia.model.internal.application.data.impl.DataAgentTarget) StartAgentClickListener(com.hack23.cia.web.impl.ui.application.views.pageclicklistener.StartAgentClickListener) Secured(org.springframework.security.access.annotation.Secured)

Aggregations

DataAgentTarget (com.hack23.cia.model.internal.application.data.impl.DataAgentTarget)1 StartAgentClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.StartAgentClickListener)1 ResponsiveRow (com.jarektoro.responsivelayout.ResponsiveRow)1 Button (com.vaadin.ui.Button)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Secured (org.springframework.security.access.annotation.Secured)1