com.vaadin.ui.HorizontalLayout Java Examples

The following examples show how to use com.vaadin.ui.HorizontalLayout. 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: TargetBulkUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildLayout() {
    mainLayout = new VerticalLayout();
    mainLayout.setSpacing(Boolean.TRUE);
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("200px");

    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();
    captionLayout.addComponents(windowCaption, minimizeButton, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");

    final HorizontalLayout uploaderLayout = new HorizontalLayout();
    uploaderLayout.addComponent(bulkUploader);
    uploaderLayout.addComponent(linkToSystemConfigHelp);
    uploaderLayout.setComponentAlignment(linkToSystemConfigHelp, Alignment.BOTTOM_RIGHT);
    uploaderLayout.setExpandRatio(bulkUploader, 1.0F);
    uploaderLayout.setSizeFull();
    mainLayout.addComponents(captionLayout, dsNamecomboBox, descTextArea, tokenVerticalLayout, descTextArea,
            progressBar, targetsCountLabel, uploaderLayout);
}
 
Example #2
Source File: AttributeSelectionWindow.java    From XACML with MIT License 6 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	
	// optionGroupAttribute
	optionGroupAttribute = new OptionGroup();
	optionGroupAttribute.setCaption("Attribute Source");
	optionGroupAttribute.setImmediate(false);
	optionGroupAttribute.setWidth("-1px");
	optionGroupAttribute.setHeight("-1px");
	optionGroupAttribute.setInvalidAllowed(false);
	horizontalLayout_1.addComponent(optionGroupAttribute);
	
	// verticalLayout_2
	verticalLayout_2 = buildVerticalLayout_2();
	horizontalLayout_1.addComponent(verticalLayout_2);
	
	return horizontalLayout_1;
}
 
Example #3
Source File: IdentifierForm.java    From doecode with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public IdentifierForm(RepositoryForm form) {
    this.parent = form;
    
    setSizeUndefined();
    setSpacing(true);
    
    setEnabled(false);
    // load the drop-down values
    identifierType.addItems(Identifier.identifierTypes);
    relationType.addItems(Identifier.relationTypes);
    
    // set up a layout for the form buttons
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    buttons.addComponents(save, delete);
    save.setStyleName(ValoTheme.BUTTON_FRIENDLY);
    save.addClickListener(e->this.save());
    delete.setStyleName(ValoTheme.BUTTON_DANGER);
    delete.addClickListener(e->this.delete());
    
    // disable functionality until needed
    save.setEnabled(false);
    delete.setEnabled(false);
    
    addComponents(value, identifierType, relationType, buttons);
}
 
Example #4
Source File: FormUtils.java    From jdal with Apache License 2.0 6 votes vote down vote up
/**
   * Create a titled separator
   * @param title title
   * @return a {@link HorizontalLayout} with title and rule.
   */
  public static Component createTitledSeparator(String title) {
  	Label titleLabel = new Label(title);
  	titleLabel.setStyleName(Reindeer.LABEL_H2);
Label rule = new Label("<hr />", ContentMode.HTML);
titleLabel.setSizeUndefined();
HorizontalLayout hl = new HorizontalLayout();
hl.addComponent(titleLabel);
Box.addHorizontalStruct(hl, 20);
hl.addComponent(rule);
hl.setComponentAlignment(rule, Alignment.BOTTOM_CENTER);
hl.setExpandRatio(rule, 1);
hl.setWidth(100, Unit.PERCENTAGE);

return hl;
  }
 
Example #5
Source File: Html5InputDemo.java    From serverside-elements with Apache License 2.0 6 votes vote down vote up
@Override
protected Component getDemoView() {
    input.bindAttribute("value", "change");
    input.addEventListener("change", arguments -> {
        Notification
                .show("Value changed to " + input.getAttribute("value"));
    });

    typeSelector.setEmptySelectionAllowed(false);
    typeSelector.addValueChangeListener(event -> {
        String type = String.valueOf(typeSelector.getValue());

        input.setAttribute("value", "");
        input.setAttribute("type", type);

        playground.setCaption("input type=" + type);
    });
    typeSelector.setValue("range");

    Root root = ElementIntegration.getRoot(playground);
    root.appendChild(input);
    HorizontalLayout layout = new HorizontalLayout(typeSelector,
            playground);
    layout.setSpacing(true);
    return layout;
}
 
Example #6
Source File: FormDialog.java    From jdal with Apache License 2.0 6 votes vote down vote up
public void init() {
	setContent(form);
	getContent().setSizeUndefined();
	center();
	 
	acceptButtonListener = new AcceptButtonListener();
	cancelButtonListener = new CancelButtonListener();
	
	HorizontalLayout buttonLayout = new HorizontalLayout();
	Button acceptButton = FormUtils.newButton(acceptButtonListener);
	Button cancelButton = FormUtils.newButton(cancelButtonListener);
	buttonLayout.setSpacing(true);
	buttonLayout.addComponent(acceptButton);
	buttonLayout.addComponent(cancelButton);
	HorizontalLayout footer = new HorizontalLayout();
	footer.addComponent(buttonLayout);
	footer.setSizeFull();
	footer.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER);
	form.setFooter(footer);
	form.setSizeFull();
	form.getLayout().setSizeFull();
}
 
Example #7
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout createApprovalLayout() {
    approveButtonsGroup = new OptionGroup();
    approveButtonsGroup.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_OPTIONGROUP_ID);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    approveButtonsGroup.addStyleName("custom-option-group");
    approveButtonsGroup.addItems(Rollout.ApprovalDecision.APPROVED, Rollout.ApprovalDecision.DENIED);

    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.APPROVED, i18n.getMessage(APPROVAL_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.APPROVED, FontAwesome.CHECK);
    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.DENIED, i18n.getMessage(DENY_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.DENIED, FontAwesome.TIMES);

    approvalRemarkField = createTextField("label.approval.remark",
            UIComponentIdProvider.ROLLOUT_APPROVAL_REMARK_FIELD_ID, Rollout.APPROVAL_REMARK_MAX_SIZE);
    approvalRemarkField.setWidth(100.0F, Unit.PERCENTAGE);

    final HorizontalLayout layout = new HorizontalLayout(approveButtonsGroup, approvalRemarkField);
    layout.setWidth(100.0F, Unit.PERCENTAGE);
    layout.setExpandRatio(approvalRemarkField, 1.0F);
    return layout;
}
 
Example #8
Source File: DefaultGridHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Builds the title layout.
 *
 * @return title-layout
 */
protected HorizontalLayout buildTitleLayout() {
    titleLayout = new HorizontalLayout();
    titleLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    titleLayout.setSpacing(false);
    titleLayout.setMargin(false);
    titleLayout.setSizeFull();
    titleLayout.addComponent(prefixWithTitle);
    titleLayout.setComponentAlignment(prefixWithTitle, Alignment.TOP_LEFT);
    titleLayout.setExpandRatio(prefixWithTitle, 0.8F);

    if (hasHeaderMaximizeSupport()) {
        titleLayout.addComponents(getHeaderMaximizeSupport().maxMinButton);
        titleLayout.setComponentAlignment(getHeaderMaximizeSupport().maxMinButton, Alignment.TOP_RIGHT);
        titleLayout.setExpandRatio(getHeaderMaximizeSupport().maxMinButton, 0.2F);
    }

    return titleLayout;
}
 
Example #9
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 #10
Source File: AbstractView.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top title header.
 *
 * @param topHeader
 *            the top header
 */
private static void createTopTitleHeader(final HorizontalLayout topHeader) {
	final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout();


	final Label titleLabel = new Label("Citizen Intelligence Agency");
	titleLabel.setStyleName("Header");
	topTitleHeadertPanel.addComponent(titleLabel);
	topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT);

	final Label sloganLabel = new Label("// Tracking politicians like bugs!");
	sloganLabel.setStyleName("HeaderSlogan");
	topTitleHeadertPanel.addComponent(sloganLabel);
	topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT);

	topHeader.addComponent(topTitleHeadertPanel);
	topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT);
	topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID);
}
 
Example #11
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
    final HorizontalLayout securityTokenLayout = new HorizontalLayout();

    final Label securityTableLbl = new Label(
            SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
            ContentMode.HTML);
    securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTableLbl.addStyleName("label-style");

    final TextField securityTokentxt = new TextField();
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
    securityTokentxt.addStyleName("targetDtls-securityToken");
    securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTokentxt.setCaption(null);
    securityTokentxt.setNullRepresentation("");
    securityTokentxt.setValue(securityToken);
    securityTokentxt.setReadOnly(true);

    securityTokenLayout.addComponent(securityTableLbl);
    securityTokenLayout.addComponent(securityTokentxt);
    return securityTokenLayout;
}
 
Example #12
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void updateDetailsLayout(final String controllerId, final URI address, final String securityToken,
        final String lastQueryDate) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.id"), controllerId == null ? "" : controllerId);
    controllerLabel.setId(UIComponentIdProvider.TARGET_CONTROLLER_ID);
    detailsTabLayout.addComponent(controllerLabel);

    final Label lastPollDtLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.lastpolldate"), lastQueryDate == null ? "" : lastQueryDate);
    lastPollDtLabel.setId(UIComponentIdProvider.TARGET_LAST_QUERY_DT);
    detailsTabLayout.addComponent(lastPollDtLabel);

    final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.ip"),
            address == null ? "" : address.toString());
    typeLabel.setId(UIComponentIdProvider.TARGET_IP_ADDRESS);
    detailsTabLayout.addComponent(typeLabel);

    final HorizontalLayout securityTokenLayout = getSecurityTokenLayout(securityToken);
    controllerLabel.setId(UIComponentIdProvider.TARGET_SECURITY_TOKEN);
    detailsTabLayout.addComponent(securityTokenLayout);
}
 
Example #13
Source File: TableComponent.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create a ButtonBox from TableAction List
 * @return HorizontalLayout with Buttons
 */
protected Component createButtonBox() {
	HorizontalLayout hl = new HorizontalLayout();
	hl.setSpacing(true);
	for (TableButtonListener a : actions) {
		a.setTable(this);
		Button b = FormUtils.newButton(a, this.nativeButtons);
		hl.addComponent(b);
	}
	
	return hl;
}
 
Example #14
Source File: AttributeSelectionWindow.java    From XACML with 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);
	
	// horizontalLayoutAttribute
	horizontalLayoutAttribute = new HorizontalLayout();
	horizontalLayoutAttribute.setImmediate(false);
	horizontalLayoutAttribute.setWidth("-1px");
	horizontalLayoutAttribute.setHeight("-1px");
	horizontalLayoutAttribute.setMargin(false);
	mainLayout.addComponent(horizontalLayoutAttribute);
	mainLayout.setExpandRatio(horizontalLayoutAttribute, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Select");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #15
Source File: SoftwareModuleDetailsTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType,
        final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) {
    final VerticalLayout verticalLayout = new VerticalLayout();
    for (final SoftwareModule sw : alreadyAssignedSwModules) {
        if (swModType.getKey().equals(sw.getType().getKey())) {
            final HorizontalLayout horizontalLayout = new HorizontalLayout();
            horizontalLayout.setSizeFull();
            final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
            final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true,
                    FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
            reassignSoftModule
                    .addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
            final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(),
                    sw.getVersion());
            softwareModule.setValue(softwareModNameVersion);
            softwareModule.setDescription(softwareModNameVersion);
            softwareModule.setId(sw.getName() + "-label");
            horizontalLayout.addComponent(softwareModule);
            horizontalLayout.setExpandRatio(softwareModule, 1F);
            if (isUnassignSoftModAllowed && permissionChecker.hasUpdateRepositoryPermission() && !isTargetAssigned
                    && (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) {
                horizontalLayout.addComponent(reassignSoftModule);
            }
            verticalLayout.addComponent(horizontalLayout);
        }

    }

    return verticalLayout;
}
 
Example #16
Source File: ListPane.java    From jdal with Apache License 2.0 5 votes vote down vote up
public MenuItem(ComponentHolder holder) {
	HorizontalLayout layout = new HorizontalLayout();
	layout.setSpacing(true);
	setContent(layout);
	Embedded e = new Embedded("", holder.getIcon());
	layout.addComponent(e);
	Label l = new Label(holder.getName());
	l.setStyleName(Reindeer.LABEL_H2);
	layout.addComponent(l);
	layout.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
	layout.setComponentAlignment(e, Alignment.BOTTOM_LEFT);
	setStyleName("menuItem");
	this.component = holder.getComponent();
}
 
Example #17
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 #18
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Method to CreateName value labels.
 *
 * @param label
 *            as string
 * @param values
 *            as string
 * @return HorizontalLayout
 */
public static HorizontalLayout createNameValueLayout(final String label, final String... values) {
    final String valueStr = StringUtils.arrayToDelimitedString(values, " ");

    final Label nameValueLabel = new Label( label );
    nameValueLabel.setContentMode(ContentMode.TEXT);
    nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    nameValueLabel.addStyleName("text-bold");
    nameValueLabel.setSizeUndefined();

    final Label valueStrLabel = new Label(valueStr);
    valueStrLabel.setWidth("100%");
    valueStrLabel.addStyleName("text-cut");
    valueStrLabel.addStyleName(SPUIDefinitions.TEXT_STYLE);
    valueStrLabel.addStyleName(LABEL_STYLE);

    final HorizontalLayout nameValueLayout = new HorizontalLayout();
    nameValueLayout.setMargin(false);
    nameValueLayout.setSpacing(true);
    nameValueLayout.setSizeFull();

    nameValueLayout.addComponent(nameValueLabel);
    nameValueLayout.setComponentAlignment(nameValueLabel, Alignment.TOP_LEFT);
    nameValueLayout.setExpandRatio(nameValueLabel, 0.0F);

    nameValueLayout.addComponent(valueStrLabel);
    nameValueLayout.setComponentAlignment(valueStrLabel, Alignment.TOP_LEFT);
    nameValueLayout.setExpandRatio(valueStrLabel, 1.0F);

    return nameValueLayout;
}
 
Example #19
Source File: DistributionSetTypeSoftwareModuleSelectLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout createTwinColumnLayout() {
    final HorizontalLayout twinColumnLayout = new HorizontalLayout();
    twinColumnLayout.setSizeFull();
    twinColumnLayout.setWidth("400px");

    buildSourceTable();
    buildSelectedTable();

    final VerticalLayout selectButtonLayout = new VerticalLayout();
    final Button selectButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SELECT_DIST_TYPE, "", "",
            "arrow-button", true, FontAwesome.FORWARD, SPUIButtonStyleNoBorder.class);
    selectButton.addClickListener(event -> addSMType());
    final Button unSelectButton = SPUIComponentProvider.getButton("unselect-dist-type", "", "", "arrow-button",
            true, FontAwesome.BACKWARD, SPUIButtonStyleNoBorder.class);
    unSelectButton.addClickListener(event -> removeSMType());
    selectButtonLayout.addComponent(selectButton);
    selectButtonLayout.addComponent(unSelectButton);
    selectButtonLayout.setComponentAlignment(selectButton, Alignment.MIDDLE_CENTER);
    selectButtonLayout.setComponentAlignment(unSelectButton, Alignment.MIDDLE_CENTER);

    twinColumnLayout.addComponent(sourceTable);
    twinColumnLayout.addComponent(selectButtonLayout);
    twinColumnLayout.addComponent(selectedTable);
    twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT);
    twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER);
    twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT);
    twinColumnLayout.setExpandRatio(sourceTable, 0.45F);
    twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F);
    twinColumnLayout.setExpandRatio(selectedTable, 0.48F);
    sourceTable.setVisibleColumns(DIST_TYPE_NAME);
    return twinColumnLayout;
}
 
Example #20
Source File: DataSummaryAuthorPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 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_AUTHOR_SUMMARY);

	final HorizontalLayout horizontalLayout = new HorizontalLayout();
	horizontalLayout.setSizeFull();

	content.addComponent(horizontalLayout);
	content.setExpandRatio(horizontalLayout, ContentRatio.LARGE);

	final DataContainer<ViewAuditAuthorSummary, Long> dataContainer = getApplicationManager()
			.getDataContainer(ViewAuditAuthorSummary.class);
	
	getGridFactory()
	.createBasicBeanItemNestedPropertiesGrid(horizontalLayout, ViewAuditAuthorSummary.class, dataContainer.getAll(),
			ADMIN_AUTHOR_SUMMARY,null,
			COLUMN_ORDER, HIDE_COLUMNS,
			null, null, null);
	
	return content;

}
 
Example #21
Source File: DistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) {
    final VerticalLayout verticalLayout = new VerticalLayout();
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();
    final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
    softwareModule.setValue(softwareModuleName);
    softwareModule.setDescription(softwareModuleName);
    softwareModule.setId(softwareModuleName + "-label");
    horizontalLayout.addComponent(softwareModule);
    horizontalLayout.setExpandRatio(softwareModule, 1F);
    verticalLayout.addComponent(horizontalLayout);
    return verticalLayout;
}
 
Example #22
Source File: RangeCellFilterComponent.java    From vaadin-grid-util with MIT License 5 votes vote down vote up
/**
 * creates the layout when not already done
 *
 * @return a HLayout with already set style
 */
public HorizontalLayout getHLayout() {
    if (this.hLayout == null) {
        this.hLayout = new HorizontalLayout();
        this.hLayout.setMargin(false);
        this.hLayout.addStyleName("filter-header");
    }
    return this.hLayout;
}
 
Example #23
Source File: BulkUploadHandler.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
void buildLayout() {
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    upload = new Upload();
    upload.setEnabled(false);
    upload.setButtonCaption(i18n.getMessage("caption.bulk.upload"));
    upload.setReceiver(this);
    upload.setImmediate(true);
    upload.setWidthUndefined();
    upload.addSucceededListener(this);
    upload.addFailedListener(this);
    upload.addStartedListener(this);
    horizontalLayout.addComponent(upload);
    horizontalLayout.setComponentAlignment(upload, Alignment.BOTTOM_RIGHT);
    setCompositionRoot(horizontalLayout);
}
 
Example #24
Source File: AttachmentPanel.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void removeAllAttachmentsDisplay() {
    if (fileStores != null) {
        fileStores.clear();
    }
    for (int i = getComponentCount() - 1; i >= 0; i--) {
        Component comp = getComponent(i);
        if (comp instanceof HorizontalLayout) {
            removeComponent(comp);
        }
    }
}
 
Example #25
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void updateAttributesLabelsList(final VerticalLayout attributesLayout,
        final Map<String, String> attributes) {
    final TreeMap<String, String> sortedAttributes = new TreeMap<>((key1, key2) -> key1.compareToIgnoreCase(key2));
    sortedAttributes.putAll(attributes);
    sortedAttributes.forEach((key, value) -> {
        final HorizontalLayout conAttributeLayout = SPUIComponentProvider.createNameValueLayout(key.concat("  :  "),
                value == null ? "" : value);
        //After Vaadin 8 migration: Enable tooltip again, currently it is set to [null] to avoid cross site scripting.
        conAttributeLayout.setDescription(null);
        conAttributeLayout.addStyleName("label-style");
        attributesLayout.addComponent(conAttributeLayout);
    });
}
 
Example #26
Source File: UserManagement.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(true);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonAdd
	buttonAdd = new Button();
	buttonAdd.setCaption("Add User");
	buttonAdd.setImmediate(false);
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonAdd);
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove User");
	buttonRemove.setImmediate(false);
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	
	return horizontalLayoutToolbar;
}
 
Example #27
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 #28
Source File: GoogleMapDemo.java    From serverside-elements with Apache License 2.0 5 votes vote down vote up
@Override
protected Component getDemoView() {
    CssLayout wrapper = new CssLayout();
    Root root = ElementIntegration.getRoot(wrapper);

    final Element googleMap = Elements.create("google-map");

    googleMap.setAttribute("style",
            "height: 500px; width: 500px; display: block");
    googleMap.setAttribute("latitude", "60.45235");
    googleMap.setAttribute("longitude", "22.299727");
    googleMap.setAttribute("zoom", "17");

    root.appendChild(googleMap);

    HorizontalLayout buttons = new HorizontalLayout(
            new Button("GWT.create US", event -> {
                googleMap.setAttribute("latitude", "37.414274");
                googleMap.setAttribute("longitude", "-122.077409");
            }), new Button("GWT.create EU", event -> {
                googleMap.setAttribute("latitude", "48.152663");
                googleMap.setAttribute("longitude", "11.598418");
            }));
    buttons.setSpacing(true);

    VerticalLayout layout = new VerticalLayout(buttons, wrapper);
    layout.setSpacing(true);
    return layout;
}
 
Example #29
Source File: ObligationAdviceEditorWindow.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// buttonAdd
	buttonAdd = new Button();
	buttonAdd.setCaption("Add Expression");
	buttonAdd.setImmediate(false);
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAdd);
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove Expression");
	buttonRemove.setImmediate(false);
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonRemove);
	
	// buttonClear
	buttonClear = new Button();
	buttonClear.setCaption("Clear Expressions");
	buttonClear.setImmediate(false);
	buttonClear.setWidth("-1px");
	buttonClear.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClear);
	
	return horizontalLayout_1;
}
 
Example #30
Source File: Dialog.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create box with accept/cancel buttons
 * @return new button box
 */
protected Component createButtonBox() {
	HorizontalLayout hl = new HorizontalLayout();
	hl.setSizeUndefined();
	Box.addHorizontalGlue(hl);
	acceptButton = FormUtils.newButton(closeAction);
	hl.addComponent(acceptButton);
	Box.addHorizontalGlue(hl);

	return hl;
}