Java Code Examples for com.vaadin.ui.VerticalLayout

The following examples show how to use com.vaadin.ui.VerticalLayout. These examples are extracted from open source projects. 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
@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 ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, LEADER_HISTORY);

	final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPartyRoleMember.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPartyRoleMember.class,
			partyRoleMemberDataContainer.getAllBy(ViewRiksdagenPartyRoleMember_.party,
					viewRiksdagenParty.getPartyId()),
			LEADER_HISTORY2, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example 2
@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 ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, TITLE);
	chartDataManager.createPartyChart(panelContent,pageId);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example 3
/**
 * 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 4
@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 ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, CURRENT_MEMBERS);

	final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPolitician.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPolitician.class,
			politicianDataContainer.findListByProperty(
					new Object[] { viewRiksdagenParty.getPartyId(), Boolean.TRUE }, ViewRiksdagenPolitician_.party,
					ViewRiksdagenPolitician_.active),
			POLITICIANS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example 5
@Override
public void postConstruct() {	
	super.postConstruct();
	
	content = new VerticalLayout();
	content.setSpacing(true);
	content.setMargin(true);
	setCompositionRoot(content);
							
	caption = new Label("This is Home View", ContentMode.HTML);
	caption.addStyleName(ValoTheme.LABEL_H2);
	content.addComponent(caption);
	
	loginInfo = new Label("This is Home View", ContentMode.HTML);
	loginInfo.addStyleName(ValoTheme.LABEL_H2);
	content.addComponent(loginInfo);
			
}
 
Example 6
@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 ViewRiksdagenParty viewRiksdagenParty = getItem(parameters);
	getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, MEMBER_HISTORY);

	final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenPolitician.class);

	getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenPolitician.class,
			politicianDataContainer.getAllBy(ViewRiksdagenPolitician_.party, viewRiksdagenParty.getPartyId()),
			POLITICIANS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
	return panelContent;

}
 
Example 7
Source Project: XACML   Source File: PolicyWorkspace.java    License: MIT License 6 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayoutLeftPanel() {
	// common part: create layout
	verticalLayoutLeftPanel = new VerticalLayout();
	verticalLayoutLeftPanel.setImmediate(false);
	verticalLayoutLeftPanel.setWidth("100.0%");
	verticalLayoutLeftPanel.setHeight("100.0%");
	verticalLayoutLeftPanel.setMargin(true);
	verticalLayoutLeftPanel.setSpacing(true);
	
	// horizontalLayoutLeftToolbar
	horizontalLayoutLeftToolbar = buildHorizontalLayoutLeftToolbar();
	verticalLayoutLeftPanel.addComponent(horizontalLayoutLeftToolbar);
	
	// treeWorkspace
	treeWorkspace = new TreeTable();
	treeWorkspace.setImmediate(true);
	treeWorkspace.setWidth("100.0%");
	treeWorkspace.setHeight("100.0%");
	verticalLayoutLeftPanel.addComponent(treeWorkspace);
	verticalLayoutLeftPanel.setExpandRatio(treeWorkspace, 1.0f);
	
	return verticalLayoutLeftPanel;
}
 
Example 8
Source Project: sensorhub   Source File: AdminUI.java    License: Mozilla Public License 2.0 6 votes vote down vote up
protected void buildModuleList(VerticalLayout layout, final Class<?> configType)
{
    ModuleRegistry reg = SensorHub.getInstance().getModuleRegistry();
    
    // build bean items and add them to container
    MyBeanItemContainer<ModuleConfig> container = new MyBeanItemContainer<ModuleConfig>(ModuleConfig.class);
    for (IModule<?> module: reg.getLoadedModules())
    {
        ModuleConfig config = module.getConfiguration().clone();
        if (configType.isAssignableFrom(config.getClass()))
            container.addBean(config);
    }
    
    moduleConfigLists.put(configType, container);
    displayModuleList(layout, container, configType);
}
 
Example 9
Source Project: cia   Source File: GovernmentBodyChartDataManagerImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void createGovernmentBodyHeadcountSummaryChart(final VerticalLayout content) {
	final Map<Integer, List<GovernmentBodyAnnualSummary>> map = esvApi.getData();

	final DataSeries dataSeries = new DataSeries();
	final Series series = new Series();

	series.addSeries(new XYseries().setLabel(ALL_GOVERNMENT_BODIES));
	dataSeries.newSeries();

	for (final Entry<Integer, List<GovernmentBodyAnnualSummary>> entry : map.entrySet()) {
		addDataSerieValue(dataSeries, entry, entry.getValue().stream().mapToInt(GovernmentBodyAnnualSummary::getHeadCount).sum());
	}

	addChart(content, ANNUAL_HEADCOUNT_TOTAL_ALL_GOVERNMENT_BODIES,
			new DCharts().setDataSeries(dataSeries)
					.setOptions(getChartOptions().createOptionsXYDateFloatLogYAxisLegendOutside(series)).show(),
			true);

}
 
Example 10
Source Project: gantt   Source File: DemoUI.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    ganttListener = null;
    createGantt();

    MenuBar menu = controlsMenuBar();
    Panel controls = createControls();

    Component wrapper = UriFragmentWrapperFactory.wrapByUriFragment(UI.getCurrent().getPage().getUriFragment(),
            gantt);
    if (wrapper instanceof GanttListener) {
        ganttListener = (GanttListener) wrapper;
    }

    final VerticalLayout layout = new VerticalLayout();
    layout.setStyleName("demoContentLayout");
    layout.setMargin(false);
    layout.setSizeFull();
    layout.addComponent(menu);
    layout.addComponent(controls);
    layout.addComponent(wrapper);
    layout.setExpandRatio(wrapper, 1);

    setContent(layout);
}
 
Example 11
Source Project: cia   Source File: DocumentMenuItemFactoryImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void createOverviewPage(final VerticalLayout panelContent, final String pageId) {
	final ResponsiveRow grid = RowUtil.createGridLayout(panelContent);

	createButtonLink(grid,DOCUMENT_ACTIVITY_TEXT, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTACTIVITY.toString(), pageId), DOCUMENT_ACTIVITIES);

	createButtonLink(grid,PERSON_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.PERSONREFERENCES.toString(), pageId), PERSON_REFERENCES);

	createButtonLink(grid,DOCUMENT_DETAILS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDETAILS.toString(), pageId), DOCUMENT_DETAILS);

	createButtonLink(grid,DOCUMENT_DATA, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDATA.toString(), pageId), COMPLETE_DOCUMENT_AS_TEXT);

	createButtonLink(grid,DOCUMENT_REFERENCES, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTREFERENCES.toString(), pageId), DOCUMENT_REFERENCES);

	createButtonLink(grid,DOCUMENT_DECISION, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTDECISION.toString(), pageId), DOCUMENT_DECISIONS);

	createButtonLink(grid,DOCUMENT_ATTACHEMENTS, VaadinIcons.FILE, new PageModeMenuCommand(UserViews.DOCUMENT_VIEW_NAME,
			DocumentPageMode.DOCUMENTATTACHMENTS.toString(), pageId), ATTACHEMENTS);
}
 
Example 12
@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 ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters);
	getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId);

	LabelFactory.createHeader2Label(panelContent, PoliticianPageMode.VOTEHISTORY.toString());

	getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent,
			ViewRiksdagenVoteDataBallotPoliticianSummary.class,
			viewRiksdagenVoteDataBallotPoliticianSummaryChartDataManager
					.findByValue(viewRiksdagenPolitician.getPersonId()),
			BALLOTS, NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, EMBEDDED_ID_BALLOT_ID, null);

	pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
	return panelContent;

}
 
Example 13
Source Project: jdal   Source File: SimpleBoxFormBuilder.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Reset the form builder to reuse for creating a new panel
 */
public void reset() {
	columns = new ArrayList<VerticalLayout>();
	columnsWidth = new ArrayList<Integer>();
	rowsHeight = new ArrayList<Integer>();
	container = Box.createHorizontalBox();
	
	index = 0;
	rows = 0;
	
}
 
Example 14
Source Project: gazpachoquest   Source File: LoginView.java    License: GNU General Public License v3.0 5 votes vote down vote up
protected HorizontalLayout createCompositionRootx() {
    VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSpacing(true);
    loginPanel.setWidth("400px");

    Label header = new Label("Enter your invitation to start the questionnair");
    header.addStyleName(Reindeer.LABEL_H1);
    loginPanel.addComponent(header);

    invitation = new TextField("Invitation");
    invitation.setWidth("100%");
    invitation.focus();
    invitation.setValue("YAS5ICHRBE");
    loginPanel.addComponent(invitation);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    loginPanel.addComponent(buttons);
    loginPanel.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);

    login = new Button("Start");
    login.setClickShortcut(KeyCode.ENTER);
    login.addStyleName(Reindeer.BUTTON_DEFAULT);
    login.addClickListener(createLoginButtonListener());
    buttons.addComponent(login);

    HorizontalLayout viewLayout = new HorizontalLayout();
    viewLayout.addComponent(loginPanel);
    viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    viewLayout.setSizeFull();
    viewLayout.addStyleName(Reindeer.LAYOUT_BLUE);
    setSizeFull();

    return viewLayout;
}
 
Example 15
Source Project: XACML   Source File: AttributeSelectionWindow.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("-1px");
	verticalLayout_2.setHeight("-1px");
	verticalLayout_2.setMargin(true);
	verticalLayout_2.setSpacing(true);
	
	// textFieldIssuer
	textFieldIssuer = new TextField();
	textFieldIssuer.setCaption("Issuer");
	textFieldIssuer.setImmediate(false);
	textFieldIssuer.setWidth("-1px");
	textFieldIssuer.setHeight("-1px");
	verticalLayout_2.addComponent(textFieldIssuer);
	
	// checkBoxMustBePresent
	checkBoxMustBePresent = new CheckBox();
	checkBoxMustBePresent.setCaption("Attribute Must Be Present");
	checkBoxMustBePresent.setImmediate(false);
	checkBoxMustBePresent.setWidth("-1px");
	checkBoxMustBePresent.setHeight("-1px");
	verticalLayout_2.addComponent(checkBoxMustBePresent);
	
	return verticalLayout_2;
}
 
Example 16
Source Project: hawkbit   Source File: RolloutConfigurationView.java    License: 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 17
@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);

	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, DOCUMENT_REFERENCES);

	if (documentStatusContainer != null && documentStatusContainer.getDocumentReferenceContainer() != null
			&& documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList() != null) {

		getGridFactory().createBasicBeanItemGrid(panelContent, DocumentReferenceData.class,
				documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList(),
				DOCUMENT_REFERENCES2, COLUMN_ORDER, HIDE_COLUMNS, null, null, null);
	}

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

	return panelContent;

}
 
Example 18
Source Project: hawkbit   Source File: AbstractHawkbitLoginUI.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void addFooter(final VerticalLayout rootLayout) {
    final Resource resource = context
            .getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");

    try (final InputStream resourceStream = resource.getInputStream()) {
        final CustomLayout customLayout = new CustomLayout(resourceStream);
        customLayout.setSizeUndefined();
        rootLayout.addComponent(customLayout);
        rootLayout.setComponentAlignment(customLayout, Alignment.BOTTOM_LEFT);
    } catch (final IOException ex) {
        LOG.error("Footer file cannot be loaded", ex);
    }
}
 
Example 19
Source Project: XACML   Source File: AttributeStandardSelectorComponent.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(false);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// comboBoxCategories
	comboBoxCategories = new ComboBox();
	comboBoxCategories.setCaption("Select A Category");
	comboBoxCategories.setImmediate(false);
	comboBoxCategories.setWidth("-1px");
	comboBoxCategories.setHeight("-1px");
	comboBoxCategories.setInvalidAllowed(false);
	comboBoxCategories.setRequired(true);
	mainLayout.addComponent(comboBoxCategories);
	mainLayout.setExpandRatio(comboBoxCategories, 1.0f);
	
	// horizontalLayout_2
	horizontalLayout_2 = buildHorizontalLayout_2();
	mainLayout.addComponent(horizontalLayout_2);
	mainLayout.setExpandRatio(horizontalLayout_2, 1.0f);
	
	return mainLayout;
}
 
Example 20
Source Project: hawkbit   Source File: FilterManagementView.java    License: 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 21
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.serverDesc"));
    addStyleName(Reindeer.PANEL_LIGHT);
    addStyleName("server-desc-panel");

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("server-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報タブ
    serverDescBasic = new ServerDescBasic(sender);
    tab.addTab(serverDescBasic, ViewProperties.getCaption("tab.serverDescBasic"), Icons.BASIC.resource());

    // 詳細情報タブ
    serverDescDetail = new ServerDescDetail();
    tab.addTab(serverDescDetail, ViewProperties.getCaption("tab.serverDescDetail"), Icons.DETAIL.resource());

    tab.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            ServerDesc.this.selectedTabChange(event);
        }
    });
}
 
Example 22
Source Project: hawkbit   Source File: UploadArtifactView.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private VerticalLayout createDetailsAndUploadLayout() {
    detailAndUploadLayout = new VerticalLayout();
    detailAndUploadLayout.addComponent(artifactDetailsLayout);
    detailAndUploadLayout.setComponentAlignment(artifactDetailsLayout, Alignment.TOP_CENTER);
    detailAndUploadLayout.setExpandRatio(artifactDetailsLayout, 1.0F);

    if (permChecker.hasCreateRepositoryPermission()) {
        detailAndUploadLayout.addComponent(dropAreaLayout.getDropAreaWrapper());
    }

    detailAndUploadLayout.setSizeFull();
    detailAndUploadLayout.addStyleName("group");
    detailAndUploadLayout.setSpacing(true);
    return detailAndUploadLayout;
}
 
Example 23
Source Project: chipster   Source File: ReportDataSource.java    License: MIT License 5 votes vote down vote up
private static void updateCompUI(final ReportView view,
		final List<ServerStatusMessage> statuses, final ReportDataSource reportDataSource) {

	view.updateUI(new Runnable() {
		@Override
		public void run() {
			VerticalLayout layout = view.getCompLayout();

			layout.removeAllComponents();

			Collections.sort(statuses, new Comparator<ServerStatusMessage>() {
				@Override
				public int compare(ServerStatusMessage m1, ServerStatusMessage m2) {
					int hostComparison = m1.getHost().compareTo(m2.getHost());
					int idComparison = m1.getHostId().compareTo(m2.getHostId());
					if (hostComparison != 0) {
						return hostComparison;
					}
					return idComparison;
				}						
			});

			for (ServerStatusMessage serverStatus : statuses) {

				Label title = view.createReportLabel("Comp " + serverStatus.getHost() + " (" + serverStatus.getHostId() + ")" + "    ");
				Button shutdownButton = view.createReportButton("Stop gracefully");

				shutdownButton.addClickListener(new StopClickListener(view, reportDataSource, serverStatus.getHostId()));
				HorizontalLayout titleRow = new HorizontalLayout();						
				titleRow.addComponent(title);
				titleRow.addComponent(shutdownButton);
				Label reportLabel = view.createReportLabel(
						serverStatus.toString());
				layout.addComponent(titleRow);
				layout.addComponent(reportLabel);
			}
		}
	});
}
 
Example 24
Source Project: XACML   Source File: ObligationAdviceEditorWindow.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// horizontalLayout_1
	horizontalLayout_1 = buildHorizontalLayout_1();
	mainLayout.addComponent(horizontalLayout_1);
	
	// tableExpressions
	tableExpressions = new TreeTable();
	tableExpressions.setCaption("Expressions");
	tableExpressions.setImmediate(false);
	tableExpressions.setWidth("100%");
	tableExpressions.setHeight("-1px");
	mainLayout.addComponent(tableExpressions);
	mainLayout.setExpandRatio(tableExpressions, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 25
Source Project: jdal   Source File: SimpleBoxFormBuilder.java    License: Apache License 2.0 5 votes vote down vote up
public void add(Component c, String label, int width, Alignment alignment) {
	if (rows == 0 && rowsHeight.isEmpty()) {
		log.warn("You must call row() before adding components. I will add a row with default height for you");
		row();
	}
	
	if (label != null)
		c.setCaption(label);
	
	VerticalLayout column = getColumn();
	column.addComponent(c);
	index++;
	
	setWidth(width);
	
	if (alignment != null) {
		column.setComponentAlignment(c, alignment);
	}
	
	if (rowCellSpand) {
		c.setWidth(100, Unit.PERCENTAGE);
	}
	
	if (useTabIndex && c instanceof Field) {
		((Field<?>) c).setTabIndex(tabIndex++);
	}
}
 
Example 26
Source Project: cia   Source File: GovernmentBodyChartDataManagerImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void createGovernmentBodyExpenditureSummaryChart(final VerticalLayout content, final String name) {
	final Map<String, List<GovernmentBodyAnnualOutcomeSummary>> collect = esvApi.getGovernmentBodyReport().get(name)
			.stream().filter(p -> p.getDescriptionFields().get(ANSLAGSPOSTSNAMN) != null)
			.collect(Collectors.groupingBy(t -> t.getDescriptionFields().get(ANSLAGSPOSTSNAMN)));

	addAnnualData(content, name, ANNUAL_EXPENDITURE, collect);
}
 
Example 27
Source Project: XACML   Source File: RegexpEditorComponent.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldExpression
	textFieldExpression = new TextField();
	textFieldExpression.setCaption("Regular Expression");
	textFieldExpression.setImmediate(true);
	textFieldExpression
			.setDescription("Create a regular expression used to constrain attribute values.");
	textFieldExpression.setWidth("-1px");
	textFieldExpression.setHeight("-1px");
	textFieldExpression.setInvalidAllowed(false);
	textFieldExpression.setInputPrompt("eg. [a-zA-Z0-9]");
	mainLayout.addComponent(textFieldExpression);
	mainLayout.setExpandRatio(textFieldExpression, 1.0f);
	
	// panelTester
	panelTester = buildPanelTester();
	mainLayout.addComponent(panelTester);
	mainLayout.setExpandRatio(panelTester, 1.0f);
	
	return mainLayout;
}
 
Example 28
Source Project: XACML   Source File: ApplyEditorWindow.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// horizontalLayout_1
	horizontalLayout_1 = buildHorizontalLayout_1();
	mainLayout.addComponent(horizontalLayout_1);
	
	// tableFunction
	tableFunction = new Table();
	tableFunction.setCaption("Select A Function");
	tableFunction.setImmediate(false);
	tableFunction.setWidth("100.0%");
	tableFunction.setHeight("-1px");
	tableFunction.setInvalidAllowed(false);
	tableFunction.setRequired(true);
	mainLayout.addComponent(tableFunction);
	mainLayout.setExpandRatio(tableFunction, 1.0f);
	
	// buttonSelect
	buttonSelect = new Button();
	buttonSelect.setCaption("Select and Continue");
	buttonSelect.setImmediate(true);
	buttonSelect.setWidth("-1px");
	buttonSelect.setHeight("-1px");
	mainLayout.addComponent(buttonSelect);
	mainLayout.setComponentAlignment(buttonSelect, new Alignment(48));
	
	return mainLayout;
}
 
Example 29
@Override
public void attach() {
    addStyleName(Reindeer.PANEL_LIGHT);
    setHeight("100%");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName("service-desc-detail");
    setContent(layout);

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setMargin(false);
    leftLayout.setSpacing(false);
    leftLayout.setWidth("250px");
    leftLayout.setHeight("100%");

    left = new DetailInfoOpe();
    left.setWidth("250px");
    leftLayout.addComponent(left);
    leftLayout.setExpandRatio(left, 1.0f);
    layout.addComponent(leftLayout);

    right = new DetailParameters();
    right.setWidth("100%");
    right.setHeight("100%");
    layout.addComponent(right);

    layout.setExpandRatio(right, 100);
}
 
Example 30
Source Project: sensorhub   Source File: GenericConfigForm.java    License: Mozilla Public License 2.0 5 votes vote down vote up
protected void addChangeModuleButton(final ComponentContainer parentForm, final String propId, final ComplexProperty prop, final Class<?> objectType)
{
    final Button chgButton = new Button("Modify");
    //chgButton.addStyleName(STYLE_QUIET);
    chgButton.addStyleName(STYLE_SMALL);
    chgButton.addStyleName(STYLE_SECTION_BUTTONS);
    chgButton.setIcon(REFRESH_ICON);
    
    chgButton.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;
        public void buttonClick(ClickEvent event)
        {
            // show popup to select among available module types
            ModuleTypeSelectionPopup popup = new ModuleTypeSelectionPopup(objectType, new ModuleTypeSelectionCallback() {
                public void configSelected(Class<?> moduleType, ModuleConfig config)
                {
                    // regenerate form
                    config.id = null;
                    config.name = null;
                    MyBeanItem<Object> newItem = new MyBeanItem<Object>(config, propId + ".");
                    prop.setValue(newItem);
                    IModuleConfigForm newForm = AdminUI.getInstance().generateForm(config.getClass());
                    newForm.build(propId, prop);
                    ((VerticalLayout)newForm).addComponent(chgButton, 0);
                                            
                    // replace old form in UI
                    allForms.add(newForm);
                    allForms.remove((IModuleConfigForm)chgButton.getData());
                    replaceComponent((Component)chgButton.getData(), newForm);
                    chgButton.setData(newForm);
                }
            });
            popup.setModal(true);
            AdminUI.getInstance().addWindow(popup);
        }
    });
    
    chgButton.setData(parentForm);
    ((VerticalLayout)parentForm).addComponent(chgButton, 0);
}