Java Code Examples for com.vaadin.ui.HorizontalLayout#setComponentAlignment()

The following examples show how to use com.vaadin.ui.HorizontalLayout#setComponentAlignment() . 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: 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 2
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
protected Component buildFields() {
    final HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);
    fields.addStyleName("fields");
    buildTenantField();
    buildUserField();
    buildPasswordField();
    buildSignInButton();
    if (multiTenancyIndicator.isMultiTenancySupported()) {
        fields.addComponents(tenant, username, password, signIn);
    } else {
        fields.addComponents(username, password, signIn);
    }
    fields.setComponentAlignment(signIn, Alignment.BOTTOM_LEFT);
    signIn.addClickListener(event -> handleLogin());

    return fields;
}
 
Example 3
Source File: AbstractFilterHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildLayout() {
    setStyleName("filter-btns-header-layout");
    typeHeaderLayout = new HorizontalLayout();
    typeHeaderLayout.setHeight(32, Unit.PIXELS);
    typeHeaderLayout.setWidth(100.0F, Unit.PERCENTAGE);
    typeHeaderLayout.addComponentAsFirst(title);
    typeHeaderLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    typeHeaderLayout.setComponentAlignment(title, Alignment.TOP_LEFT);
    if (menu != null) {
        typeHeaderLayout.addComponent(menu);
        typeHeaderLayout.setComponentAlignment(menu, Alignment.TOP_RIGHT);
    }
    typeHeaderLayout.addComponent(hideIcon);
    typeHeaderLayout.setComponentAlignment(hideIcon, Alignment.TOP_RIGHT);
    typeHeaderLayout.setExpandRatio(title, 1.0F);
    addComponent(typeHeaderLayout);
}
 
Example 4
Source File: ConfirmDialog.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
public ConfirmDialog(String caption, String message, String okButtonText, String cancelButtonText)
{
    super(caption);
    super.setModal(true);
    super.setClosable(false);
    super.setResizable(false);
    
    VerticalLayout windowLayout = new VerticalLayout();
    windowLayout.setMargin(true);
    
    // confirmation message
    windowLayout.addComponent(new Label(message, ContentMode.HTML));
    windowLayout.setSpacing(true);
    
    // buttons
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE);
    windowLayout.addComponent(buttonsLayout);
    
    okButton = new Button(okButtonText);
    buttonsLayout.addComponent(okButton);
    okButton.setTabIndex(1);
    okButton.addClickListener(this);
    buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER);
            
    cancelButton = new Button(cancelButtonText);
    buttonsLayout.addComponent(cancelButton);
    cancelButton.setTabIndex(0);
    cancelButton.setClickShortcut(KeyCode.ESCAPE, null);
    cancelButton.addClickListener(this);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER);
            
    super.setContent(windowLayout);
}
 
Example 5
Source File: AbstractView.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Adds the logo to header.
 *
 * @param topHeader
 *            the top header
 */
private static void addLogoToHeader(final HorizontalLayout topHeader) {
	final ThemeResource ciaLogoResource = new ThemeResource("cia-logo.png");
	final Image ciaLogoImage = new Image(null,ciaLogoResource);
	topHeader.addComponent(ciaLogoImage);
	ciaLogoImage.setWidth("60px");
	ciaLogoImage.setHeight("60px");
	topHeader.setComponentAlignment(ciaLogoImage, Alignment.MIDDLE_LEFT);
	topHeader.setExpandRatio(ciaLogoImage, ContentRatio.SMALL);
}
 
Example 6
Source File: AbstractHawkbitUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout buildViewTitle() {
    final HorizontalLayout viewHeadercontent = new HorizontalLayout();
    viewHeadercontent.setWidth("100%");
    viewHeadercontent.addStyleName("view-header-layout");

    viewTitle = new Label();
    viewTitle.setWidth("100%");
    viewTitle.setStyleName("header-content");
    viewHeadercontent.addComponent(viewTitle);

    viewHeadercontent.addComponent(notificationUnreadButton);
    viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT);
    return viewHeadercontent;
}
 
Example 7
Source File: LoginView.java    From gazpachoquest with 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 8
Source File: ConfirmationDialog.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout createButtonLayout(final Button cancelButton) {
    final HorizontalLayout hButtonLayout = new HorizontalLayout();
    hButtonLayout.setSpacing(true);
    hButtonLayout.addComponent(okButton);
    hButtonLayout.addComponent(cancelButton);
    hButtonLayout.setSizeUndefined();
    hButtonLayout.setComponentAlignment(okButton, Alignment.TOP_CENTER);
    hButtonLayout.setComponentAlignment(cancelButton, Alignment.TOP_CENTER);
    return hButtonLayout;
}
 
Example 9
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void buildLayout() {
    nameEditLayout = new HorizontalLayout();

    final HorizontalLayout headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.setMargin(false);
    headerCaptionLayout.setSpacing(true);
    headerCaptionLayout.setSizeFull();
    headerCaptionLayout.addStyleName("header-caption");

    headerCaptionLayout.addComponent(captionPrefix);
    headerCaptionLayout.setComponentAlignment(captionPrefix, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(captionPrefix, 0.0F);

    headerCaptionLayout.addComponent(captionNameVersion);
    headerCaptionLayout.setComponentAlignment(captionNameVersion, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(captionNameVersion, 1.0F);

    nameEditLayout.setWidth(100.0F, Unit.PERCENTAGE);
    nameEditLayout.addComponents(headerCaptionLayout);
    nameEditLayout.setComponentAlignment(headerCaptionLayout, Alignment.TOP_LEFT);
    if (hasEditPermission()) {
        nameEditLayout.addComponent(editButton);
        nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
        nameEditLayout.addComponent(manageMetadataBtn);
        nameEditLayout.setComponentAlignment(manageMetadataBtn, Alignment.TOP_RIGHT);
    }
    nameEditLayout.setExpandRatio(headerCaptionLayout, 1.0F);
    nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);

    addComponent(nameEditLayout);
    setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
    addComponent(detailsTab);
    setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);

    setSizeFull();
    setHeightUndefined();
    addStyleName(SPUIStyleDefinitions.WIDGET_STYLE);
}
 
Example 10
Source File: DefaultGridHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Builds the title HorizontalLayout containing two labels.
 *
 * @return title as HorizontalLayout
 */
protected HorizontalLayout buildTitleHorizontalLayout() {

    prefixText = new Label();
    prefixText.setValue(titleText);
    prefixText.addStyleName(ValoTheme.LABEL_SMALL);
    prefixText.addStyleName(ValoTheme.LABEL_BOLD);
    prefixText.setSizeUndefined();

    title = new Label();
    title.setSizeFull();
    title.setImmediate(true);
    title.setWidth("100%");
    title.addStyleName(ValoTheme.LABEL_SMALL);
    title.addStyleName("text-bold");
    title.addStyleName("text-cut");
    title.addStyleName("header-caption-right");

    prefixWithTitle = new HorizontalLayout();
    prefixWithTitle.setMargin(false);
    prefixWithTitle.setSpacing(true);
    prefixWithTitle.setSizeFull();
    prefixWithTitle.addStyleName("header-caption");

    prefixWithTitle.addComponent(prefixText);
    prefixWithTitle.setComponentAlignment(prefixText, Alignment.TOP_LEFT);
    prefixWithTitle.setExpandRatio(prefixText, 0.0F);

    prefixWithTitle.addComponent(title);
    prefixWithTitle.setComponentAlignment(title, Alignment.TOP_LEFT);
    prefixWithTitle.setExpandRatio(title, 1.0F);

    return prefixWithTitle;
}
 
Example 11
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 12
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 13
Source File: CreateOrUpdateFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    captionLayout = new HorizontalLayout();
    captionLayout.setDescription(i18n.getMessage("tooltip.click.to.edit"));
    captionLayout.setId(UIComponentIdProvider.TARGET_FILTER_QUERY_NAME_LAYOUT_ID);

    titleFilterIconsLayout = new HorizontalLayout();
    titleFilterIconsLayout.addComponents(headerCaption, captionLayout);
    titleFilterIconsLayout.setSpacing(true);

    final HorizontalLayout breadcrumbLayout = new HorizontalLayout();
    breadcrumbLayout.addComponent(breadcrumbButton);
    breadcrumbLayout.addComponent(new Label(">"));
    breadcrumbName = new LabelBuilder().buildCaptionLabel();
    breadcrumbLayout.addComponent(breadcrumbName);
    breadcrumbName.addStyleName("breadcrumbPaddingLeft");

    final HorizontalLayout titleFilterLayout = new HorizontalLayout();
    titleFilterLayout.setSizeFull();
    titleFilterLayout.addComponents(titleFilterIconsLayout, closeIcon);
    titleFilterLayout.setExpandRatio(titleFilterIconsLayout, 1.0F);
    titleFilterLayout.setComponentAlignment(titleFilterIconsLayout, Alignment.TOP_LEFT);
    titleFilterLayout.setComponentAlignment(closeIcon, Alignment.TOP_RIGHT);

    final HorizontalLayout iconLayout = new HorizontalLayout();
    iconLayout.setSizeUndefined();
    iconLayout.setSpacing(false);
    iconLayout.addComponents(helpLink, searchIcon, saveButton);

    final HorizontalLayout queryLayout = new HorizontalLayout();
    queryLayout.setSizeUndefined();
    queryLayout.setSpacing(true);
    queryLayout.addComponents(queryTextField, iconLayout);

    addComponent(breadcrumbLayout);
    addComponent(titleFilterLayout);
    addComponent(queryLayout);
    setSpacing(true);
    addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
    addStyleName("bordered-layout");
}
 
Example 14
Source File: EnumerationEditorComponent.java    From XACML with MIT License 4 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");
	buttonAdd.setImmediate(true);
	buttonAdd.setDescription("Add a new enumeration value.");
	buttonAdd.setWidth("-1px");
	buttonAdd.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonAdd);
	horizontalLayout_1.setComponentAlignment(buttonAdd, new Alignment(9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected enumeration value.");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonRemove);
	horizontalLayout_1.setComponentAlignment(buttonRemove,
			new Alignment(10));
	
	// buttonClearAll
	buttonClearAll = new Button();
	buttonClearAll.setCaption("Clear All");
	buttonClearAll.setImmediate(false);
	buttonClearAll.setDescription("Clears all the values out.");
	buttonClearAll.setWidth("-1px");
	buttonClearAll.setHeight("-1px");
	horizontalLayout_1.addComponent(buttonClearAll);
	
	return horizontalLayout_1;
}
 
Example 15
Source File: DemoUI.java    From gantt with Apache License 2.0 4 votes vote down vote up
private Panel createControls() {
    Panel panel = new Panel();
    panel.setWidth(100, Unit.PERCENTAGE);

    controls = new HorizontalLayout();
    controls.setSpacing(true);
    controls.setMargin(true);
    panel.setContent(controls);

    subControls = new HorizontalLayout();
    subControls.setSpacing(true);
    subControls.setVisible(false);

    start = createStartDateField();
    end = createEndDateField();

    Button createStep = new Button("Create New Step...", createStepClickListener);

    HorizontalLayout heightAndUnit = new HorizontalLayout(Util.createHeightEditor(gantt),
            Util.createHeightUnitEditor(gantt));

    HorizontalLayout widthAndUnit = new HorizontalLayout(Util.createWidthEditor(gantt),
            Util.createWidthUnitEditor(gantt));

    reso = new NativeSelect<Resolution>("Resolution");
    reso.setEmptySelectionAllowed(false);
    reso.setItems(org.tltv.gantt.client.shared.Resolution.Hour, org.tltv.gantt.client.shared.Resolution.Day,
            org.tltv.gantt.client.shared.Resolution.Week);
    reso.setValue(gantt.getResolution());
    resolutionValueChangeRegistration = Optional.of(reso.addValueChangeListener(resolutionValueChangeListener));

    localeSelect = new NativeSelect<Locale>("Locale") {
        @Override
        public void attach() {
            super.attach();

            if (getValue() == null) {
                // use default locale
                setValue(gantt.getLocale());
                addValueChangeListener(localeValueChangeListener);
            }
        }
    };
    localeSelect.setEmptySelectionAllowed(false);
    localeSelect.setItems(Locale.getAvailableLocales());
    localeSelect.setItemCaptionGenerator((l) -> l.getDisplayName(getLocale()));

    ComboBox<String> timezoneSelect = new ComboBox<String>("Timezone");
    timezoneSelect.setWidth(300, Unit.PIXELS);
    timezoneSelect.setEmptySelectionAllowed(false);
    timezoneSelect.setItemCaptionGenerator(new ItemCaptionGenerator<String>() {

        @Override
        public String apply(String item) {
            if ("Default".equals(item)) {
                return "Default (" + getDefaultTimeZone().getDisplayName() + ")";
            }
            TimeZone tz = TimeZone.getTimeZone(item);
            return tz.getID() + " (raw offset " + (tz.getRawOffset() / 60000) + "m)";
        }
    });
    List<String> items = new ArrayList<>();
    items.add("Default");
    items.addAll(Gantt.getSupportedTimeZoneIDs());
    timezoneSelect.setItems((caption, fltr) -> caption.contains(fltr), items);
    timezoneSelect.setValue("Default");
    timezoneSelect.addValueChangeListener(timezoneValueChangeListener);

    final Button toggleSubControlsBtn = new Button("Show More Settings...");
    toggleSubControlsBtn.addStyleName("link");
    toggleSubControlsBtn.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            subControls.setVisible(!subControls.isVisible());
            toggleSubControlsBtn.setCaption(subControls.isVisible() ? "Less Settings..." : "More Settings...");
        }
    });

    controls.addComponent(start);
    controls.addComponent(end);
    controls.addComponent(reso);
    controls.addComponent(subControls);
    controls.addComponent(toggleSubControlsBtn);
    controls.setComponentAlignment(toggleSubControlsBtn, Alignment.BOTTOM_CENTER);

    subControls.addComponent(localeSelect);
    subControls.addComponent(timezoneSelect);
    subControls.addComponent(heightAndUnit);
    subControls.addComponent(widthAndUnit);
    subControls.addComponent(createStep);
    subControls.setComponentAlignment(createStep, Alignment.MIDDLE_LEFT);

    return panel;
}
 
Example 16
Source File: StorageAdminPanel.java    From sensorhub with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void build(final MyBeanItem<ModuleConfig> beanItem, final IRecordStorageModule<?> storage)
{
    super.build(beanItem, storage);       
    
    if (storage != null)
    {            
        // section layout
        final GridLayout form = new GridLayout();
        form.setWidth(100.0f, Unit.PERCENTAGE);
        form.setMargin(false);
        form.setSpacing(true);
        
        // section title
        form.addComponent(new Label(""));
        HorizontalLayout titleBar = new HorizontalLayout();
        titleBar.setSpacing(true);
        Label sectionLabel = new Label("Data Store Content");
        sectionLabel.addStyleName(STYLE_H3);
        sectionLabel.addStyleName(STYLE_COLORED);
        titleBar.addComponent(sectionLabel);
        titleBar.setComponentAlignment(sectionLabel, Alignment.MIDDLE_LEFT);
        
        // refresh button to show latest record
        Button refreshButton = new Button("Refresh");
        refreshButton.setDescription("Reload data from storage");
        refreshButton.setIcon(REFRESH_ICON);
        refreshButton.addStyleName(STYLE_QUIET);
        titleBar.addComponent(refreshButton);
        titleBar.setComponentAlignment(refreshButton, Alignment.MIDDLE_LEFT);
        refreshButton.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;
            @Override
            public void buttonClick(ClickEvent event)
            {
                buildDataPanel(form, storage);
            }
        });
                
        form.addComponent(titleBar);
        
        // add I/O panel
        buildDataPanel(form, storage);
        addComponent(form);
    }
}
 
Example 17
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void createComponents() {
    prefixTitleOfArtifactDetails = new Label();
    prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL);
    prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_BOLD);
    prefixTitleOfArtifactDetails.setSizeUndefined();

    titleOfArtifactDetails = new Label();
    titleOfArtifactDetails.setId(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID);
    titleOfArtifactDetails.setSizeFull();
    titleOfArtifactDetails.setImmediate(true);
    titleOfArtifactDetails.setWidth("100%");
    titleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL);
    titleOfArtifactDetails.addStyleName("text-bold");
    titleOfArtifactDetails.addStyleName("text-cut");
    titleOfArtifactDetails.addStyleName("header-caption-right");

    headerCaptionLayout = new HorizontalLayout();
    headerCaptionLayout.setMargin(false);
    headerCaptionLayout.setSpacing(true);
    headerCaptionLayout.setSizeFull();
    headerCaptionLayout.addStyleName("header-caption");

    headerCaptionLayout.addComponent(prefixTitleOfArtifactDetails);
    headerCaptionLayout.setComponentAlignment(prefixTitleOfArtifactDetails, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(prefixTitleOfArtifactDetails, 0.0F);

    headerCaptionLayout.addComponent(titleOfArtifactDetails);
    headerCaptionLayout.setComponentAlignment(titleOfArtifactDetails, Alignment.TOP_LEFT);
    headerCaptionLayout.setExpandRatio(titleOfArtifactDetails, 1.0F);

    maxMinButton = createMaxMinButton();

    artifactDetailsTable = createArtifactDetailsTable();

    artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer());
    addGeneratedColumn(artifactDetailsTable);
    if (!readOnly) {
        addGeneratedColumnButton(artifactDetailsTable);
    }
    setTableColumnDetails(artifactDetailsTable);
}
 
Example 18
Source File: AbstractTableHeader.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private void buildLayout() {
    final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout();

    titleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon, showFilterButtonLayout);
    titleFilterIconsLayout.setComponentAlignment(headerCaption, Alignment.TOP_LEFT);
    titleFilterIconsLayout.setComponentAlignment(searchField, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setComponentAlignment(searchResetIcon, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setComponentAlignment(showFilterButtonLayout, Alignment.TOP_RIGHT);
    if (hasCreatePermission() && isAddNewItemAllowed()) {
        titleFilterIconsLayout.addComponent(addIcon);
        titleFilterIconsLayout.setComponentAlignment(addIcon, Alignment.TOP_RIGHT);
    }
    if (hasCreatePermission() && isBulkUploadAllowed()) {
        titleFilterIconsLayout.addComponent(bulkUploadIcon);
        titleFilterIconsLayout.setComponentAlignment(bulkUploadIcon, Alignment.TOP_RIGHT);
    }
    titleFilterIconsLayout.addComponent(maxMinIcon);
    titleFilterIconsLayout.setComponentAlignment(maxMinIcon, Alignment.TOP_RIGHT);
    titleFilterIconsLayout.setExpandRatio(headerCaption, 0.4F);
    titleFilterIconsLayout.setExpandRatio(searchField, 0.6F);

    addComponent(titleFilterIconsLayout);

    final HorizontalLayout dropHintDropFilterLayout = new HorizontalLayout();
    dropHintDropFilterLayout.addStyleName("filter-drop-hint-layout");
    dropHintDropFilterLayout.setWidth(100, Unit.PERCENTAGE);
    if (isDropFilterRequired()) {
        filterDroppedInfo = new HorizontalLayout();
        filterDroppedInfo.setImmediate(true);
        filterDroppedInfo.setStyleName("target-dist-filter-info");
        filterDroppedInfo.setHeightUndefined();
        filterDroppedInfo.setSizeUndefined();
        displayFilterDropedInfoOnLoad();
        final DragAndDropWrapper dropFilterLayout = new DragAndDropWrapper(filterDroppedInfo);
        dropFilterLayout.setId(getDropFilterId());
        dropFilterLayout.setDropHandler(getDropFilterHandler());

        dropHintDropFilterLayout.addComponent(dropFilterLayout);
        dropHintDropFilterLayout.setComponentAlignment(dropFilterLayout, Alignment.TOP_CENTER);
        dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0F);
    }
    addComponent(dropHintDropFilterLayout);
    setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");
}
 
Example 19
Source File: AttributeDictionary.java    From XACML with MIT License 4 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(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew.setDescription("Create a new attribute");
	buttonNew.setWidth("70px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected attribute(s)");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(9));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone an attribute.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(9));
	
	// comboBoxFilterCategory
	comboBoxFilterCategory = new ComboBox();
	comboBoxFilterCategory.setCaption("Filter By Category");
	comboBoxFilterCategory.setImmediate(false);
	comboBoxFilterCategory.setWidth("-1px");
	comboBoxFilterCategory.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterCategory);
	
	// comboBoxFilterDatatype
	comboBoxFilterDatatype = new ComboBox();
	comboBoxFilterDatatype.setCaption("Filter By Data Type");
	comboBoxFilterDatatype.setImmediate(false);
	comboBoxFilterDatatype.setWidth("-1px");
	comboBoxFilterDatatype.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterDatatype);
	
	return horizontalLayoutToolbar;
}
 
Example 20
Source File: AbstractView.java    From cia with Apache License 2.0 4 votes vote down vote up
/**
 * Creates the basic layout with panel and footer.
 *
 * @param panelName
 *            the panel name
 */
protected final void createBasicLayoutWithPanelAndFooter(final String panelName) {
	final VerticalLayout layout = createFullSizeVerticalLayout();
	final VerticalLayout pageModeContent = createFullSizeVerticalLayout(false,false);
	layout.addComponent(pageModeContent);

	final HorizontalLayout topHeader = new HorizontalLayout();

	addLogoToHeader(topHeader);
	createTopTitleHeader(topHeader);

	topHeaderRightPanel.removeAllComponents();
	topHeader.addComponent(topHeaderRightPanel);
	topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT);
	topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE);

	createTopHeaderActionsForUserContext();

	topHeaderRightPanel.setWidth("100%");
	topHeaderRightPanel.setHeight("50px");

	topHeader.setWidth("100%");
	topHeader.setHeight("50px");

	pageModeContent.addComponent(topHeader);
	pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER);

	pageModeContent.addComponent(getBarmenu());
	pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER);

	panel = new Panel(panelName);
	panel.addStyleName("v-panel-page-panel");

	panel.setSizeFull();
	pageModeContent.addComponent(panel);
	pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE);

	pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink());
	setContent(layout);

	setWidth(100, Unit.PERCENTAGE);
	setHeight(100, Unit.PERCENTAGE);
	setSizeFull();

}