Java Code Examples for com.vaadin.ui.Panel#setHeight()

The following examples show how to use com.vaadin.ui.Panel#setHeight() . 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: AbstractTableLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout tableHeaderLayout = new VerticalLayout();
    tableHeaderLayout.setSizeFull();
    tableHeaderLayout.setSpacing(false);
    tableHeaderLayout.setMargin(false);

    tableHeaderLayout.setStyleName("table-layout");
    tableHeaderLayout.addComponent(tableHeader);

    tableHeaderLayout.setComponentAlignment(tableHeader, Alignment.TOP_CENTER);
    if (isShortCutKeysRequired()) {
        final Panel tablePanel = new Panel();
        tablePanel.setStyleName("table-panel");
        tablePanel.setHeight(100.0F, Unit.PERCENTAGE);
        tablePanel.setContent(table);
        tablePanel.addActionHandler(getShortCutKeysHandler(i18n));
        tablePanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        tableHeaderLayout.addComponent(tablePanel);
        tableHeaderLayout.setComponentAlignment(tablePanel, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(tablePanel, 1.0F);
    } else {
        tableHeaderLayout.addComponent(table);
        tableHeaderLayout.setComponentAlignment(table, Alignment.TOP_CENTER);
        tableHeaderLayout.setExpandRatio(table, 1.0F);
    }

    addComponent(tableHeaderLayout);
    addComponent(detailsLayout);
    setComponentAlignment(tableHeaderLayout, Alignment.TOP_CENTER);
    setComponentAlignment(detailsLayout, Alignment.TOP_CENTER);
    setExpandRatio(tableHeaderLayout, 1.0F);
}
 
Example 2
Source File: RegexpEditorComponent.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private Panel buildPanelTester() {
	// common part: create layout
	panelTester = new Panel();
	panelTester.setCaption("Test The Expression");
	panelTester.setImmediate(false);
	panelTester.setWidth("-1px");
	panelTester.setHeight("-1px");
	
	// verticalLayout_2
	verticalLayout_2 = buildVerticalLayout_2();
	panelTester.setContent(verticalLayout_2);
	
	return panelTester;
}
 
Example 3
Source File: RangeEditorComponent.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private Panel buildPanelTester() {
	// common part: create layout
	panelTester = new Panel();
	panelTester.setCaption("Test Range Values");
	panelTester.setImmediate(true);
	panelTester.setWidth("-1px");
	panelTester.setHeight("-1px");
	
	// verticalLayout_2
	verticalLayout_2 = buildVerticalLayout_2();
	panelTester.setContent(verticalLayout_2);
	
	return panelTester;
}
 
Example 4
Source File: MeetingCalendar.java    From calendar-component with Apache License 2.0 4 votes vote down vote up
public MeetingCalendar() {

        setId("meeting-meetings");
        setSizeFull();

        initCalendar();

        VerticalLayout layout = new VerticalLayout();
        layout.setMargin(false);
        layout.setSpacing(false);
        layout.setSizeFull();

        panel = new Panel(calendar);
        panel.setHeight(100, Unit.PERCENTAGE);
        layout.addComponent(panel);

        setCompositionRoot(layout);

    }
 
Example 5
Source File: MyCloudAdd.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    // myCloud名
    cloudNameField = new TextField(ViewProperties.getCaption("field.cloudName"));
    getLayout().addComponent(cloudNameField);

    // コメント
    commentField = new TextField(ViewProperties.getCaption("field.comment"));
    commentField.setWidth("100%");
    getLayout().addComponent(commentField);

    // テンプレート選択テーブル
    templateTable = new SelectTemplateTable();
    getLayout().addComponent(templateTable);

    // テンプレート説明欄
    final Label nameLabel = new Label();
    final Label descriptionLabel = new Label();

    Panel descriptionPanel = new Panel();
    CssLayout layout = new CssLayout();
    layout.addStyleName("template-desc");
    descriptionPanel.setHeight("80px");
    descriptionPanel.setContent(layout);
    layout.setSizeFull();
    layout.addComponent(nameLabel);
    layout.addComponent(descriptionLabel);
    getLayout().addComponent(descriptionPanel);

    templateTable.addListener(new ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            if (templateTable.getValue() == null) {
                return;
            }

            TemplateDto template = findTemplate(templateTable.getValue());
            nameLabel.setValue(template.getTemplate().getTemplateNameDisp() + ":");
            descriptionLabel.setValue(template.getTemplate().getTemplateDescriptionDisp());
        }
    });

    cloudNameField.focus();

    initValidation();
}
 
Example 6
Source File: StorageView.java    From chipster with MIT License 4 votes vote down vote up
public StorageView(ChipsterAdminUI app) {
	super(app);

	this.addComponent(getToolbar());
	
	this.addComponent(super.getProggressIndicator());
	
	entryTable = new StorageEntryTable(this);
	aggregateTable = new StorageAggregateTable(this);

	
	HorizontalLayout aggregatePanelLayout = new HorizontalLayout();
	HorizontalLayout entryPanelLayout = new HorizontalLayout();
	
	aggregatePanelLayout.setSizeFull();
	entryPanelLayout.setSizeFull();
	
	aggregatePanelLayout.addComponent(aggregateTable);
	entryPanelLayout.addComponent(entryTable);
	
	aggregatePanelLayout.setExpandRatio(aggregateTable, 1);
	entryPanelLayout.setExpandRatio(entryTable, 1);
	
	Panel aggregatePanel = new Panel("Disk usage by user");
	Panel entryPanel = new Panel("Stored sessions");
	
	aggregatePanel.setWidth(300, Unit.PIXELS);
	aggregatePanel.setHeight(100, Unit.PERCENTAGE);
	entryPanel.setSizeFull();
	
	aggregatePanel.setContent(aggregatePanelLayout);
	entryPanel.setContent(entryPanelLayout);
	
	storagePanels = new HorizontalLayout();
	storagePanels.setSizeFull();
				
	storagePanels.addComponent(aggregatePanel);
	storagePanels.addComponent(entryPanel);
	
	storagePanels.setExpandRatio(entryPanel, 1);
	
	this.setSizeFull();
	this.addComponent(storagePanels);		
	this.setExpandRatio(storagePanels, 1);
	
	try {
		
		adminEndpoint = new StorageAdminAPI(app.getEndpoint());
		entryDataSource = new StorageEntryContainer(adminEndpoint);
		aggregateDataSource = new StorageAggregateContainer(adminEndpoint);
		
		entryTable.setContainerDataSource(entryDataSource);
		aggregateTable.setContainerDataSource(aggregateDataSource);
	} catch (JMSException | IOException | IllegalConfigurationException | MicroarrayException | InstantiationException | IllegalAccessException e) {
		logger.error(e);
	}		
}