Java Code Examples for com.vaadin.ui.Button#setSizeUndefined()

The following examples show how to use com.vaadin.ui.Button#setSizeUndefined() . 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: WindowBreadCrumbs.java    From cuba with Apache License 2.0 5 votes vote down vote up
public void update() {
    boolean isTestMode = ui.isTestMode();

    linksLayout.removeAllComponents();
    for (Iterator<Window> it = windows.iterator(); it.hasNext();) {
        Window window = it.next();

        Button button = new NavigationButton(window);
        button.setCaption(StringUtils.trimToEmpty(window.getCaption()));
        button.addClickListener(this::navigationButtonClicked);
        button.setSizeUndefined();
        button.setStyleName(ValoTheme.BUTTON_LINK);
        button.setTabIndex(-1);

        if (isTestMode) {
            button.setCubaId("breadCrubms_Button_" + window.getId());
        }

        if (ui.isPerformanceTestMode()) {
            button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId()));
        }

        if (it.hasNext()) {
            linksLayout.addComponent(button);

            Label separatorLab = new Label("&nbsp;&gt;&nbsp;");
            separatorLab.setStyleName("c-breadcrumbs-separator");
            separatorLab.setSizeUndefined();
            separatorLab.setContentMode(ContentMode.HTML);
            linksLayout.addComponent(separatorLab);
        } else {
            Label captionLabel = new Label(window.getCaption());
            captionLabel.setStyleName("c-breadcrumbs-win-caption");
            captionLabel.setSizeUndefined();
            linksLayout.addComponent(captionLabel);
        }
    }
}
 
Example 2
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button createAddButton() {
    final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.ROLLOUT_GROUP_ADD_ID,
            i18n.getMessage("button.rollout.add.group"), "", "", true, FontAwesome.PLUS,
            SPUIButtonStyleNoBorderWithIcon.class);
    button.setSizeUndefined();
    button.addStyleName("default-color");
    button.setEnabled(true);
    button.setVisible(true);
    button.addClickListener(event -> addGroupRowAndValidate());
    return button;

}
 
Example 3
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button createRemoveButton() {
    final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.ROLLOUT_GROUP_REMOVE_ID, "", "",
            "", true, FontAwesome.MINUS, SPUIButtonStyleNoBorderWithIcon.class);
    button.setSizeUndefined();
    button.addStyleName("default-color");
    button.setEnabled(true);
    button.setVisible(true);
    button.addClickListener(event -> onRemove());
    return button;
}
 
Example 4
Source File: TargetFilterTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button customFilterDistributionSetButton(final Long itemId) {
    final Item row1 = getItem(itemId);
    final ProxyDistribution distSet = (ProxyDistribution) row1
            .getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_DISTRIBUTION_SET).getValue();
    final ActionType actionType = (ActionType) row1.getItemProperty(SPUILabelDefinitions.AUTO_ASSIGN_ACTION_TYPE)
            .getValue();

    final String buttonId = "distSetButton";
    Button updateIcon;
    if (distSet == null) {
        updateIcon = SPUIComponentProvider.getButton(buttonId,
                i18n.getMessage(UIMessageIdProvider.BUTTON_NO_AUTO_ASSIGNMENT),
                i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false, null,
                SPUIButtonStyleNoBorder.class);
    } else {
        updateIcon = actionType == ActionType.FORCED
                ? SPUIComponentProvider.getButton(buttonId, distSet.getNameVersion(),
                        i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false,
                        FontAwesome.BOLT, SPUIButtonStyleNoBorderWithIcon.class)
                : SPUIComponentProvider.getButton(buttonId, distSet.getNameVersion(),
                        i18n.getMessage(UIMessageIdProvider.BUTTON_AUTO_ASSIGNMENT_DESCRIPTION), null, false, null,
                        SPUIButtonStyleNoBorder.class);
        updateIcon.setSizeUndefined();
    }

    updateIcon.addClickListener(this::onClickOfDistributionSetButton);
    updateIcon.setData(row1);
    updateIcon.addStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link");

    return updateIcon;
}