Example usage for com.vaadin.ui Button setHeightUndefined

List of usage examples for com.vaadin.ui Button setHeightUndefined

Introduction

In this page you can find the example usage for com.vaadin.ui Button setHeightUndefined.

Prototype

@Override
    public void setHeightUndefined() 

Source Link

Usage

From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorderUH.java

License:Open Source License

@Override
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
    button.setHeightUndefined();
    // Set Style/*  w w  w . j a  va  2 s.  co  m*/
    if (null != style) {
        if (setStyle) {
            button.setStyleName(style);
        } else {
            button.addStyleName(style);
        }
    }
    // Set icon
    if (null != icon) {
        button.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
        button.setIcon(icon);
    }
    return button;
}

From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleSmallNoBorderUHS.java

License:Open Source License

@Override
public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) {
    button.addStyleName(ValoTheme.BUTTON_SMALL);
    button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    button.setHeightUndefined();
    button.setSizeUndefined();/*from  w  w  w  .  j  av a 2 s .c o m*/
    // Set Style
    if (null != style) {
        if (setStyle) {
            button.setStyleName(style);
        } else {
            button.addStyleName(style);
        }
    }
    // Set icon
    if (null != icon) {
        button.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
        button.setIcon(icon);
    }
    return button;
}

From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionTable.java

License:Open Source License

private Button createPinBtn(final Object itemId) {

    final Item item = getContainerDataSource().getItem(itemId);
    final String name = (String) item.getItemProperty(SPUILabelDefinitions.VAR_NAME).getValue();

    final String version = (String) item.getItemProperty(SPUILabelDefinitions.VAR_VERSION).getValue();
    final DistributionSetIdName distributionSetIdName = new DistributionSetIdName((Long) itemId, name, version);

    final Button pinBtn = new Button();
    pinBtn.setIcon(FontAwesome.THUMB_TACK);
    pinBtn.setHeightUndefined();
    pinBtn.addStyleName(getPinStyle());//from w ww . jav a  2 s. c  o m
    pinBtn.setData(distributionSetIdName);
    pinBtn.setId(getPinButtonId(name, version));
    pinBtn.setImmediate(true);
    pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_DISTRIBUTION_SET_PIN));
    return pinBtn;
}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTable.java

License:Open Source License

private Button getTagetPinButton(final Object itemId) {
    final Button pinBtn = new Button();
    final String controllerId = (String) getContainerDataSource().getItem(itemId)
            .getItemProperty(SPUILabelDefinitions.VAR_CONT_ID).getValue();
    final TargetIdName pinnedTarget = new TargetIdName((Long) itemId, controllerId);
    final StringBuilder pinBtnStyle = new StringBuilder(ValoTheme.BUTTON_BORDERLESS_COLORED);
    pinBtnStyle.append(' ');
    pinBtnStyle.append(ValoTheme.BUTTON_SMALL);
    pinBtnStyle.append(' ');
    pinBtnStyle.append(ValoTheme.BUTTON_ICON_ONLY);
    pinBtn.setStyleName(pinBtnStyle.toString());
    pinBtn.setHeightUndefined();
    pinBtn.setData(pinnedTarget);/*from  www.j  ava2  s  . com*/
    pinBtn.setId(UIComponentIdProvider.TARGET_PIN_ICON + controllerId);
    pinBtn.addClickListener(this::addPinClickListener);
    pinBtn.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_TARGET_PIN));
    if (isPinned(pinnedTarget)) {
        pinBtn.addStyleName(TARGET_PINNED);
        targetPinned = Boolean.TRUE;
        targetPinnedBtn = pinBtn;
        getEventBus().publish(this, PinUnpinEvent.PIN_TARGET);
    }
    pinBtn.addStyleName(SPUIStyleDefinitions.TARGET_STATUS_PIN_TOGGLE);
    HawkbitCommonUtil.applyStatusLblStyle(this, pinBtn, itemId);
    return pinBtn;
}