Java Code Examples for com.vaadin.ui.VerticalLayout#setSizeFull()

The following examples show how to use com.vaadin.ui.VerticalLayout#setSizeFull() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MyUI.java    From framework-spring-tutorial with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    final VerticalLayout root = new VerticalLayout();
    root.setSizeFull();
    setContent(root);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    navigationBar.addComponent(createNavigationButton("UI Scoped View",
            UIScopedView.VIEW_NAME));
    navigationBar.addComponent(createNavigationButton("View Scoped View",
            ViewScopedView.VIEW_NAME));
    root.addComponent(navigationBar);

    springViewDisplay = new Panel();
    springViewDisplay.setSizeFull();
    root.addComponent(springViewDisplay);
    root.setExpandRatio(springViewDisplay, 1.0f);
}
 
Example 2
Source File: FilterManagementView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildFilterDetailOrCreateView() {
    removeAllComponents();
    final VerticalLayout tableHeaderLayout = new VerticalLayout();
    tableHeaderLayout.setSizeFull();
    tableHeaderLayout.setSpacing(false);
    tableHeaderLayout.setMargin(false);
    tableHeaderLayout.setStyleName("table-layout");
    tableHeaderLayout.addComponent(createNewFilterHeader);
    tableHeaderLayout.setComponentAlignment(createNewFilterHeader, Alignment.TOP_CENTER);
    tableHeaderLayout.addComponent(createNewFilterTable);
    tableHeaderLayout.setComponentAlignment(createNewFilterTable, Alignment.TOP_CENTER);
    tableHeaderLayout.setExpandRatio(createNewFilterTable, 1.0F);

    addComponent(tableHeaderLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0F);

    final HorizontalLayout targetsCountmessageLabelLayout = addTargetFilterMessageLabel();
    addComponent(targetsCountmessageLabelLayout);
    setComponentAlignment(targetsCountmessageLabelLayout, Alignment.BOTTOM_CENTER);

}
 
Example 3
Source File: UploadDropAreaLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private VerticalLayout createDropAreaLayout() {
    final VerticalLayout dropAreaLayout = new VerticalLayout();
    final Label dropHereLabel = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_DROP_AREA_UPLOAD));
    dropHereLabel.setWidth(null);

    final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
    dropIcon.addStyleName("drop-icon");
    dropIcon.setWidth(null);

    dropAreaLayout.addComponent(dropIcon);
    dropAreaLayout.setComponentAlignment(dropIcon, Alignment.TOP_CENTER);
    dropAreaLayout.addComponent(dropHereLabel);
    dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);

    uploadButtonLayout.setWidth(null);
    uploadButtonLayout.addStyleName("upload-button");
    dropAreaLayout.addComponent(uploadButtonLayout);
    dropAreaLayout.setComponentAlignment(uploadButtonLayout, Alignment.BOTTOM_CENTER);

    dropAreaLayout.setSizeFull();
    dropAreaLayout.setStyleName("upload-drop-area-layout-info");
    dropAreaLayout.setSpacing(false);
    return dropAreaLayout;
}
 
Example 4
Source File: UserHomeSecuritySettingsPageModContentFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the change password button.
 *
 * @return the vertical layout
 */
private VerticalLayout createChangePasswordButton() {

	final VerticalLayout formLayout = new VerticalLayout();
	formLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	formLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formPanel.setContent(formContent);

	final ChangePasswordRequest request = new ChangePasswordRequest();
	request.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	request.setCurrentPassword("");
	request.setNewPassword("");
	request.setRepeatNewPassword("");
	
	final ClickListener listener = new ChangePasswordClickListener(request);
	getFormFactory().addRequestInputFormFields(formContent, request,
			ChangePasswordRequest.class, Arrays.asList("currentPassword","newPassword","repeatNewPassword"), "Change password", listener);

	return formLayout;
}
 
Example 5
Source File: ToolEditorUI.java    From chipster with MIT License 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
	treeToolEditor = new TreeToolEditor(this);
	toolEditor = new ToolEditor(this);
	textEditor = new TextEditor(this);
	final Panel vLayout = new Panel();
	vSplitPanel = new VerticalSplitPanel();
	vSplitPanel.setSplitPosition(50, Unit.PERCENTAGE);
	vSplitPanel.setImmediate(true);
	vSplitPanel.setLocked(false);
	vSplitPanel.setWidth("100%");
	vLayout.setContent(vSplitPanel);
    setContent(vSplitPanel);
    VerticalLayout vvLayout = new VerticalLayout();
    vvLayout.setSizeFull();
    Label title = new Label("<h2><b>&nbsp;Tool Editor</b></h2>", ContentMode.HTML);

    vvLayout.addComponent(title);
    vvLayout.setComponentAlignment(title, Alignment.TOP_LEFT);
    HorizontalSplitPanel hSplitpPanel = new HorizontalSplitPanel();
    hSplitpPanel.setSizeFull();
    vvLayout.addComponent(hSplitpPanel);

    HorizontalLayout buttonPanel = getButtonPanel();
    vvLayout.addComponent(buttonPanel);
    vvLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_CENTER);

    vvLayout.setExpandRatio(hSplitpPanel, 5);
    vvLayout.setComponentAlignment(hSplitpPanel, Alignment.TOP_LEFT);
    vvLayout.setMargin(false);
    vvLayout.setSpacing(false);
    hSplitpPanel.setFirstComponent(treeToolEditor);
    hSplitpPanel.setSecondComponent(toolEditor);
    vSplitPanel.setFirstComponent(vvLayout);
    vSplitPanel.setSecondComponent(textEditor);
    hSplitpPanel.setStyleName("topborder");
}
 
Example 6
Source File: RolloutConfigurationView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void init() {

        final Panel rootPanel = new Panel();
        rootPanel.setSizeFull();

        rootPanel.addStyleName("config-panel");

        final VerticalLayout vLayout = new VerticalLayout();
        vLayout.setMargin(true);
        vLayout.setSizeFull();

        final Label header = new Label(i18n.getMessage("configuration.rollout.title"));
        header.addStyleName("config-panel-header");
        vLayout.addComponent(header);

        final GridLayout gridLayout = new GridLayout(3, 1);
        gridLayout.setSpacing(true);
        gridLayout.setImmediate(true);
        gridLayout.setColumnExpandRatio(1, 1.0F);
        gridLayout.setSizeFull();

        approvalCheckbox = SPUIComponentProvider.getCheckBox("", "", null, false, "");
        approvalCheckbox.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_ENABLED_CHECKBOX);
        approvalCheckbox.setValue(approvalConfigurationItem.isConfigEnabled());
        approvalCheckbox.addValueChangeListener(this);
        approvalConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(approvalCheckbox, 0, 0);
        gridLayout.addComponent(approvalConfigurationItem, 1, 0);

        final Link linkToApprovalHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getRollout());
        gridLayout.addComponent(linkToApprovalHelp, 2, 0);
        gridLayout.setComponentAlignment(linkToApprovalHelp, Alignment.BOTTOM_RIGHT);

        vLayout.addComponent(gridLayout);
        rootPanel.setContent(vLayout);
        setCompositionRoot(rootPanel);
    }
 
Example 7
Source File: PoliticianRoleSummaryPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the role summary.
 *
 * @param roleSummaryLayoutTabsheet the role summary layout tabsheet
 * @param assignmentList the assignment list
 * @param viewRiksdagenPolitician the view riksdagen politician
 */
private void createRoleSummary(final VerticalLayout roleSummaryLayoutTabsheet,
		final List<AssignmentData> assignmentList, final ViewRiksdagenPolitician viewRiksdagenPolitician) {

	final VerticalLayout layout = new VerticalLayout();
	layout.setSizeFull();

	layout.addComponent(new Label(TOTAL_ASSIGNMENTS + assignmentList.size()));

	if (viewRiksdagenPolitician != null) {

		layout.addComponent(new Label(GOVERNMENT_EXPERIENCE
				+ convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedGovernment())));
		layout.addComponent(new Label(
				SPEAKER_EXPERIENCE + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedSpeaker())));
		layout.addComponent(new Label(COMMITTEE_EXPERIENCE
				+ convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedCommittee())));
		layout.addComponent(
				new Label(EU_EXPERIENCE + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedEu())));
		layout.addComponent(new Label(PARLIAMENT_EXPERIENCE
				+ convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedParliament())));
		layout.addComponent(new Label(
				PARTY_EXPERIENCE + convertToYearsString(viewRiksdagenPolitician.getTotalDaysServedParty())));
	}

	roleSummaryLayoutTabsheet.addComponent(layout);
	roleSummaryLayoutTabsheet.setExpandRatio(layout, ContentRatio.GRID);

}
 
Example 8
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected VerticalLayout createMetadataFieldsLayout() {
    final VerticalLayout metadataFieldsLayout = new VerticalLayout();
    metadataFieldsLayout.setSizeFull();
    metadataFieldsLayout.setHeight("100%");
    metadataFieldsLayout.addComponent(keyTextField);
    metadataFieldsLayout.addComponent(valueTextArea);
    metadataFieldsLayout.setSpacing(true);
    metadataFieldsLayout.setExpandRatio(valueTextArea, 1F);
    return metadataFieldsLayout;
}
 
Example 9
Source File: AbstractMainView.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new {@link VerticalLayout}
 * @return a new VerticalLayout.
 */
protected VerticalLayout createVerticalLayout() {
	VerticalLayout vl = new VerticalLayout();
	vl.setMargin(true);
	vl.setSizeFull();
	vl.setSpacing(true);
	
	return vl;
}
 
Example 10
Source File: FilterManagementView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void viewListView() {
    removeAllComponents();
    final VerticalLayout tableListViewLayout = new VerticalLayout();
    tableListViewLayout.setSizeFull();
    tableListViewLayout.setSpacing(false);
    tableListViewLayout.setMargin(false);
    tableListViewLayout.setStyleName("table-layout");
    tableListViewLayout.addComponent(targetFilterHeader);
    tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
    tableListViewLayout.addComponent(targetFilterTable);
    tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
    tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F);
    addComponent(tableListViewLayout);
}
 
Example 11
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    final HorizontalLayout headerLayout = new HorizontalLayout();
    headerLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    headerLayout.setSpacing(false);
    headerLayout.setMargin(false);
    headerLayout.setSizeFull();
    headerLayout.addComponent(headerCaption);
    if (hasCreatePermission()) {
        headerLayout.addComponents(addIcon);
        headerLayout.setComponentAlignment(addIcon, Alignment.MIDDLE_RIGHT);
    }
    headerLayout.setExpandRatio(headerCaption, 1.0F);

    final HorizontalLayout headerWrapperLayout = new HorizontalLayout();
    headerWrapperLayout.addStyleName("bordered-layout" + " " + "no-border-bottom" + " " + "metadata-table-margin");
    headerWrapperLayout.addComponent(headerLayout);
    headerWrapperLayout.setWidth("100%");
    headerLayout.setHeight("30px");

    final VerticalLayout tableLayout = new VerticalLayout();
    tableLayout.setSizeFull();
    tableLayout.setHeight("100%");
    tableLayout.addComponent(headerWrapperLayout);
    tableLayout.addComponent(metaDataGrid);
    tableLayout.addStyleName("table-layout");
    tableLayout.setExpandRatio(metaDataGrid, 1.0F);

    final VerticalLayout metadataFieldsLayout = createMetadataFieldsLayout();

    mainLayout = new HorizontalLayout();
    mainLayout.addComponent(tableLayout);
    mainLayout.addComponent(metadataFieldsLayout);
    mainLayout.setExpandRatio(tableLayout, 0.5F);
    mainLayout.setExpandRatio(metadataFieldsLayout, 0.5F);
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    setCompositionRoot(mainLayout);
    setSizeFull();
}
 
Example 12
Source File: SignInViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
@Override
public void postConstruct() {	
	super.postConstruct();		
	setSizeFull();
	layout = new VerticalLayout();
	layout.setSizeFull();
	layout.setSpacing(true);
	setCompositionRoot(layout);
	
	caption = new Label("Sign in to Vaadin4Spring Security Demo");
	caption.addStyleName(ValoTheme.LABEL_H2);
	caption.setSizeUndefined();		
	layout.addComponent(caption);
	layout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);
	
	loginPanel = new VerticalLayout();
	loginPanel.setSizeUndefined();
	loginPanel.setSpacing(true);
	loginPanel.setMargin(true);
	layout.addComponent(loginPanel);
	layout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
	layout.setExpandRatio(loginPanel, 1);
	
	errorMessage = new Label();
	errorMessage.setWidth("300px");
	errorMessage.addStyleName(ValoTheme.LABEL_FAILURE);		
	errorMessage.setVisible(false);
	loginPanel.addComponent(errorMessage);
	
	username = new TextField("Username");
	username.setImmediate(true);
	username.setWidth("300px");
	username.setNullRepresentation("");
	username.setInputPrompt("Enter your username");
	loginPanel.addComponent(username);
	
	password = new PasswordField("Password");
	password.setImmediate(true);
	password.setWidth("300px");
	password.setNullRepresentation("");
	loginPanel.addComponent(password);
	
	rememberMe = new CheckBox("Remember me");
	rememberMe.setValue(false);
	rememberMe.addStyleName(ValoTheme.CHECKBOX_LARGE);
	loginPanel.addComponent(rememberMe);
	
	btnLogin = new Button("Signin", FontAwesome.UNLOCK);
	btnLogin.addStyleName(ValoTheme.BUTTON_PRIMARY);
	btnLogin.addClickListener(this);
	btnLogin.setWidth("100%");
	loginPanel.addComponent(btnLogin);							
	
	final Label infoLabel = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " You can sign in as: <br/>\"user\" with password \"user\" <br/>\"admin\" with password \"admin\".", ContentMode.HTML);
	infoLabel.setWidth("300px");
	loginPanel.addComponent(infoLabel);
}
 
Example 13
Source File: LoginView.java    From gazpachoquest with GNU General Public License v3.0 4 votes vote down vote up
protected CssLayout createCompositionRoot() {
    CssLayout root = new CssLayout();
    root.setSizeFull();
    root.addStyleName(Reindeer.LAYOUT_BLUE);

    VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSizeFull();
    loginLayout.addStyleName("login-layout");
    root.addComponent(loginLayout);

    final CssLayout loginPanel = new CssLayout();
    loginPanel.addStyleName("login-panel");
    loginLayout.addComponent(loginPanel);

    HorizontalLayout labels = new HorizontalLayout();
    labels.setWidth("100%");
    labels.setMargin(true);
    labels.addStyleName("labels");
    loginPanel.addComponent(labels);

    Label welcome = new Label("Welcome");
    welcome.setSizeUndefined();
    welcome.addStyleName(Reindeer.LABEL_H2);
    labels.addComponent(welcome);
    labels.setComponentAlignment(welcome, Alignment.MIDDLE_LEFT);

    Label title = new Label("Gazpacho Quest");
    title.setSizeUndefined();
    title.addStyleName(Reindeer.LABEL_H1);
    labels.addComponent(title);
    labels.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);

    HorizontalLayout fields = new HorizontalLayout();

    fields.setWidth("100%");
    fields.setSpacing(true);
    fields.setMargin(true);
    fields.addStyleName("fields");

    invitation = new TextField("Invitation");
    invitation.setSizeUndefined();
    invitation.focus();
    // invitation.setValue("YAS5ICHRBE");
    fields.addComponent(invitation);

    login = new Button("Start");
    login.addClickListener(createLoginButtonListener());
    fields.addComponent(login);
    fields.setComponentAlignment(login, Alignment.BOTTOM_LEFT);

    loginPanel.addComponent(fields);

    return root;
}
 
Example 14
Source File: MainViewLoginPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout content = createPanelContent();
	final String pageId = getPageId(parameters);

	panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	final VerticalLayout loginLayout = new VerticalLayout();
	loginLayout.setSizeFull();

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();

	loginLayout.addComponent(formPanel);

	final FormLayout formContent = new FormLayout();
	formContent.setIcon(VaadinIcons.SIGN_IN);
	formPanel.setContent(formContent);

	final LoginRequest loginRequest = new LoginRequest();
	loginRequest.setOtpCode("");
	loginRequest.setEmail("");
	loginRequest.setUserpassword("");
	
	loginRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	final ClickListener loginListener = new ApplicationLoginListener(loginRequest);
	getFormFactory().addRequestInputFormFields(formContent, loginRequest,
			LoginRequest.class,
			AS_LIST, LOGIN,
			loginListener);

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	content.addComponent(overviewLayout);
	content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);		
	RowUtil.createRowComponent(grid,loginLayout,LOGIN_USER);
	
	panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER,
			CommonsViews.MAIN_VIEW_NAME, parameters, pageId);


	return content;

}
 
Example 15
Source File: AdminApplicationSessionPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@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);
	final int pageNr= getPageNr(parameters);

	getMenuItemFactory().createMainPageMenuBar(menuBar);

	LabelFactory.createHeader2Label(content,ADMIN_APPLICATION_SESSION);

	final DataContainer<ApplicationSession, Long> dataContainer = getApplicationManager()
			.getDataContainer(ApplicationSession.class);

	final List<ApplicationSession> pageOrderBy = dataContainer.getPageOrderBy(pageNr,DEFAULT_RESULTS_PER_PAGE, ApplicationSession_.createdDate);

	getPagingUtil().createPagingControls(content,NAME,pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);

	getGridFactory().createBasicBeanItemGrid(content, ApplicationSession.class, pageOrderBy,
			APPLICATION_SESSION,
			COLUMN_ORDER, HIDE_COLUMNS,
			new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_SESSION_VIEW_NAME, "hjid"), null, new ListPropertyConverter[] { new ListPropertyConverter("page", "events", "actionName")});

	if (pageId != null && !pageId.isEmpty()) {

		final ApplicationSession applicationSession = dataContainer.load(Long.valueOf(pageId));

		if (applicationSession != null) {

			final VerticalLayout rightLayout = new VerticalLayout();
			rightLayout.setSizeFull();
			final HorizontalLayout horizontalLayout = new HorizontalLayout();
			horizontalLayout.setWidth(ContentSize.FULL_SIZE);
			content.addComponent(horizontalLayout);
			content.setExpandRatio(horizontalLayout, ContentRatio.GRID);


			getFormFactory().addFormPanelTextFields(horizontalLayout, applicationSession,
					ApplicationSession.class,
					AS_LIST);

			horizontalLayout.addComponent(rightLayout);
			horizontalLayout.setExpandRatio(rightLayout, ContentRatio.GRID);

			getGridFactory().createBasicBeanItemGrid(rightLayout,
					ApplicationActionEvent.class,applicationSession.getEvents(),
					APPLICATION_ACTION_EVENT,
					COLUMN_ORDER2, HIDE_COLUMNS2,
					new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, "hjid"),
					null, null);
		}

	}

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_APPLICATION_SESSION_VIEW, ApplicationEventGroup.ADMIN,
			NAME, null, pageId);

	return content;

}
 
Example 16
Source File: DataSummaryOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@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<ViewAuditDataSummary, Long> dataContainer = getApplicationManager()
			.getDataContainer(ViewAuditDataSummary.class);

	getGridFactory().createBasicBeanItemNestedPropertiesGrid(horizontalLayout, ViewAuditDataSummary.class,
			dataContainer.getAll(), ADMIN_DATA_SUMMARY, null, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	content.addComponent(overviewLayout);
	content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);

	final RefreshDataViewsRequest refreshRequest = new RefreshDataViewsRequest();
	refreshRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());

	final Button refreshViewsButton = new Button(REFRESH_VIEWS, VaadinIcons.REFRESH);
	refreshViewsButton.addClickListener(new RefreshDataViewsClickListener(refreshRequest));
	RowUtil.createRowItem(grid, refreshViewsButton, REFRESH_ALL_VIEWS);

	final Button updateSearchIndexButton = new Button(UPDATE_SEARCH_INDEX, VaadinIcons.REFRESH);

	final UpdateSearchIndexRequest updateIndexRequest = new UpdateSearchIndexRequest();
	updateIndexRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());

	updateSearchIndexButton.addClickListener(new UpdateSearchIndexClickListener(updateIndexRequest));
	RowUtil.createRowItem(grid, updateSearchIndexButton, UPDATE_DOCUMENT_SEARCH_INDEX);

	final Button removeDataButton = new Button(REMOVE_POLITICIANS, VaadinIcons.DEL);

	final RemoveDataRequest removePoliticianRequest = new RemoveDataRequest();
	removePoliticianRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	removePoliticianRequest.setDataType(RemoveDataRequest.DataType.POLITICIAN);

	removeDataButton.addClickListener(new RemoveDataClickListener(removePoliticianRequest));
	RowUtil.createRowItem(grid, removeDataButton, REMOVE_POLITICIANS);

	final RemoveDataRequest removeDocumentsRequest = new RemoveDataRequest();
	removeDocumentsRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	removeDocumentsRequest.setDataType(RemoveDataRequest.DataType.DOCUMENTS);

	final Button removeDocumentsButton = new Button(REMOVE_DOCUMENTS, VaadinIcons.DEL);
	removeDocumentsButton.addClickListener(new RemoveDataClickListener(removeDocumentsRequest));
	RowUtil.createRowItem(grid, removeDocumentsButton, REMOVE_DOCUMENTS);

	final RemoveDataRequest removeApplicationHistoryRequest = new RemoveDataRequest();
	removeApplicationHistoryRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
	removeApplicationHistoryRequest.setDataType(RemoveDataRequest.DataType.APPLICATION_HISTORY);

	final Button removeApplicationHistoryButton = new Button(REMOVE_APPLICATION_HISTORY, VaadinIcons.DEL);
	removeApplicationHistoryButton.addClickListener(new RemoveDataClickListener(removeApplicationHistoryRequest));
	RowUtil.createRowItem(grid, removeApplicationHistoryButton, REMOVE_APPLICATION_HISTORY);

	return content;

}
 
Example 17
Source File: DocumentOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 4 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final DocumentElement documentElement = getItem(parameters);
	getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId);

	final DataContainer<DocumentStatusContainer, String> documentStatusContainerDataContainer = getApplicationManager()
			.getDataContainer(DocumentStatusContainer.class);

	final DocumentStatusContainer documentStatusContainer = documentStatusContainerDataContainer
			.findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document,
					DocumentData.class, DocumentData_.id, pageId);

	LabelFactory.createHeader2Label(panelContent, OVERVIEW);

	getFormFactory().addFormPanelTextFields(panelContent, documentElement, DocumentElement.class, AS_LIST);

	if (documentStatusContainer != null) {
		getFormFactory().addFormPanelTextFields(panelContent, documentStatusContainer,
				DocumentStatusContainer.class, AS_LIST3);

		getFormFactory().addFormPanelTextFields(panelContent, documentStatusContainer.getDocument(),
				DocumentData.class, AS_LIST2);
	}

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();

	panelContent.addComponent(overviewLayout);
	panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);

	getDocumentMenuItemFactory().createOverviewPage(overviewLayout, pageId);

	panel.setContent(panelContent);
	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_DOCUMENT_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);

	return panelContent;

}
 
Example 18
Source File: RepositoryConfigurationView.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void init() {

        final Panel rootPanel = new Panel();
        rootPanel.setSizeFull();

        rootPanel.addStyleName("config-panel");

        final VerticalLayout vLayout = new VerticalLayout();
        vLayout.setMargin(true);
        vLayout.setSizeFull();

        final Label header = new Label(i18n.getMessage("configuration.repository.title"));
        header.addStyleName("config-panel-header");
        vLayout.addComponent(header);

        final GridLayout gridLayout = new GridLayout(3, 3);
        gridLayout.setSpacing(true);
        gridLayout.setImmediate(true);
        gridLayout.setColumnExpandRatio(1, 1.0F);
        gridLayout.setSizeFull();

        final boolean isMultiAssignmentsEnabled = multiAssignmentsConfigurationItem.isConfigEnabled();

        actionAutocloseCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        actionAutocloseCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLOSE_CHECKBOX);
        actionAutocloseCheckBox.setEnabled(!isMultiAssignmentsEnabled);
        actionAutocloseConfigurationItem.setEnabled(!isMultiAssignmentsEnabled);
        actionAutocloseCheckBox.setValue(actionAutocloseConfigurationItem.isConfigEnabled());
        actionAutocloseCheckBox.addValueChangeListener(this);
        actionAutocloseConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(actionAutocloseCheckBox, 0, 0);
        gridLayout.addComponent(actionAutocloseConfigurationItem, 1, 0);

        multiAssignmentsCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        multiAssignmentsCheckBox.setId(UIComponentIdProvider.REPOSITORY_MULTI_ASSIGNMENTS_CHECKBOX);
        multiAssignmentsCheckBox.setValue(multiAssignmentsConfigurationItem.isConfigEnabled());
        multiAssignmentsCheckBox.addValueChangeListener(this);
        multiAssignmentsCheckBox.setEnabled(!isMultiAssignmentsEnabled);
        multiAssignmentsConfigurationItem.setEnabled(!isMultiAssignmentsEnabled);
        multiAssignmentsConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(multiAssignmentsCheckBox, 0, 1);
        gridLayout.addComponent(multiAssignmentsConfigurationItem, 1, 1);

        actionAutocleanupCheckBox = SPUIComponentProvider.getCheckBox("", DIST_CHECKBOX_STYLE, null, false, "");
        actionAutocleanupCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLEANUP_CHECKBOX);
        actionAutocleanupCheckBox.setValue(actionAutocleanupConfigurationItem.isConfigEnabled());
        actionAutocleanupCheckBox.addValueChangeListener(this);
        actionAutocleanupConfigurationItem.addChangeListener(this);
        gridLayout.addComponent(actionAutocleanupCheckBox, 0, 2);
        gridLayout.addComponent(actionAutocleanupConfigurationItem, 1, 2);

        final Link linkToProvisioningHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getProvisioningStateMachine());
        gridLayout.addComponent(linkToProvisioningHelp, 2, 2);
        gridLayout.setComponentAlignment(linkToProvisioningHelp, Alignment.BOTTOM_RIGHT);

        vLayout.addComponent(gridLayout);
        rootPanel.setContent(vLayout);
        setCompositionRoot(rootPanel);
    }
 
Example 19
Source File: UserHomeSecuritySettingsPageModContentFactoryImpl.java    From cia with Apache License 2.0 3 votes vote down vote up
@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, SECURITY_SETTINGS);

	final VerticalLayout overviewLayout = new VerticalLayout();
	overviewLayout.setSizeFull();
	panelContent.addComponent(overviewLayout);
	panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE);

	final ResponsiveRow grid = RowUtil.createGridLayout(overviewLayout);

	RowUtil.createRowComponent(grid, createChangePasswordButton(), "Change password");
	RowUtil.createRowComponent(grid, createEnableGoogleAuthButton(), "Enable MFA using google authenticator");
	RowUtil.createRowComponent(grid, createDisableGoogleAuthButton(), "Disable MFA using google authenticator");

	panel.setCaption(NAME + "::" + USERHOME + SECURITY_SETTINGS);

	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, pageId);

	return panelContent;

}
 
Example 20
Source File: GovernmentBodyOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 3 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();

	final String pageId = getPageId(parameters);

	final List<GovernmentBodyAnnualSummary> item = getItem(parameters);
	
	if (item != null && !item.isEmpty()) {
		getGovernmentBodyMenuItemFactory().createGovernmentBodyMenuBar(menuBar, pageId);

		LabelFactory.createHeader2Label(panelContent, OVERVIEW);

		panel.setCaption(NAME + "::" + GOVERNMENT_BODY + pageId);

		final VerticalLayout overviewLayout = new VerticalLayout();
		overviewLayout.setSizeFull();

		panelContent.addComponent(overviewLayout);
		panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);
		getGovernmentBodyMenuItemFactory().createOverviewPage(overviewLayout, pageId);

		getPageActionEventHelper().createPageEvent(ViewAction.VISIT_GOVERNMENT_BODY_VIEW,
				ApplicationEventGroup.USER, NAME, parameters, pageId);
	}

	return panelContent;

}