use of com.hack23.cia.web.impl.ui.application.views.pageclicklistener.RefreshDataViewsClickListener in project cia by Hack23.
the class DataSummaryOverviewPageModContentFactoryImpl 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_DATA_SUMMARY);
final HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSizeFull();
content.addComponent(horizontalLayout);
content.setExpandRatio(horizontalLayout, ContentRatio.LARGE);
final DataContainer<DataSummary, String> dataContainer = getApplicationManager().getDataContainer(DataSummary.class);
final List<DataSummary> all = dataContainer.getAll();
if (!all.isEmpty()) {
final DataSummary dataSummary = all.get(0);
getFormFactory().addFormPanelTextFields(horizontalLayout, dataSummary, DataSummary.class, DATASUMMARY_FORM_FIELDS);
}
final VerticalLayout overviewLayout = new VerticalLayout();
overviewLayout.setSizeFull();
content.addComponent(overviewLayout);
content.setExpandRatio(overviewLayout, ContentRatio.LARGE);
final ResponsiveRow grid = createGridLayout(overviewLayout);
final Button refreshViewsButton = new Button(REFRESH_VIEWS, VaadinIcons.REFRESH);
refreshViewsButton.addClickListener(new RefreshDataViewsClickListener());
createRowItem(grid, refreshViewsButton, REFRESH_ALL_VIEWS);
final Button updateSearchIndexButton = new Button(UPDATE_SEARCH_INDEX, VaadinIcons.REFRESH);
updateSearchIndexButton.addClickListener(new UpdateSearchIndexClickListener());
createRowItem(grid, updateSearchIndexButton, UPDATE_DOCUMENT_SEARCH_INDEX);
final Button removeDataButton = new Button(REMOVE_POLITICIANS, VaadinIcons.DEL);
removeDataButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.POLITICIAN));
createRowItem(grid, removeDataButton, REMOVE_POLITICIANS);
final Button removeDocumentsButton = new Button(REMOVE_DOCUMENTS, VaadinIcons.DEL);
removeDocumentsButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.DOCUMENTS));
createRowItem(grid, removeDocumentsButton, REMOVE_DOCUMENTS);
final Button removeApplicationHistoryButton = new Button(REMOVE_APPLICATION_HISTORY, VaadinIcons.DEL);
removeApplicationHistoryButton.addClickListener(new RemoveDataClickListener(RemoveDataRequest.DataType.APPLICATION_HISTORY));
createRowItem(grid, removeApplicationHistoryButton, REMOVE_APPLICATION_HISTORY);
return content;
}
Aggregations