Example usage for com.vaadin.ui Label setSizeUndefined

List of usage examples for com.vaadin.ui Label setSizeUndefined

Introduction

In this page you can find the example usage for com.vaadin.ui Label setSizeUndefined.

Prototype

@Override
    public void setSizeUndefined() 

Source Link

Usage

From source file:de.escidoc.admintool.view.util.LayoutHelper.java

License:Open Source License

public static Component foo(final String captionForleftLabel, final String captionForRightLabel,
        final Label leftLabel, final Label rightLabel, final int widthLeft, final int widthRight,
        final boolean required) {

    final HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setHeight("30px");

    hLayout.addComponent(new Label(" "));

    final Label ll = new Label(Constants.P_ALIGN_RIGHT + captionForleftLabel + Constants.P,
            Label.CONTENT_XHTML);
    ll.setSizeUndefined();
    ll.setWidth(widthLeft + Constants.PX);

    hLayout.addComponent(ll);//from w w w  .  java 2 s.  co m
    hLayout.setComponentAlignment(ll, Alignment.MIDDLE_RIGHT);

    if (required) {
        hLayout.addComponent(new Label("&nbsp;<span style=\"color:red; position:relative; top:13px;\">*</span>",
                Label.CONTENT_XHTML));
    } else {
        hLayout.addComponent(new Label("&nbsp;&nbsp;", Label.CONTENT_XHTML));
    }

    hLayout.addComponent(leftLabel);
    hLayout.setComponentAlignment(leftLabel, Alignment.BOTTOM_RIGHT);

    hLayout.addComponent(new Label("&nbsp;", Label.CONTENT_XHTML));

    Label lr;
    hLayout.addComponent(
            lr = new Label(Constants.P_ALIGN_RIGHT + captionForRightLabel + Constants.P, Label.CONTENT_XHTML));
    lr.setSizeUndefined();
    lr.setWidth(widthRight + Constants.PX);
    hLayout.setComponentAlignment(lr, Alignment.BOTTOM_RIGHT);
    if (required) {
        hLayout.addComponent(new Label("&nbsp;<span style=\"color:red; position:relative; top:13px;\">*</span>",
                Label.CONTENT_XHTML));
    } else {
        hLayout.addComponent(new Label("&nbsp;&nbsp;", Label.CONTENT_XHTML));
    }
    hLayout.addComponent(rightLabel);
    hLayout.setComponentAlignment(rightLabel, Alignment.BOTTOM_RIGHT);
    hLayout.addComponent(new Label(" "));
    hLayout.setSpacing(false);
    return hLayout;
}

From source file:de.fatalix.bookery.AppHeader.java

License:Open Source License

private HorizontalLayout createTop() {
    Label header = new Label("Bookery");
    header.addStyleName(ValoTheme.LABEL_BOLD);
    //header.addStyleName(ValoTheme.LABEL_H3);
    header.setSizeUndefined();

    MHorizontalLayout layout = new MHorizontalLayout(header);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setExpandRatio(header, 1.0f);
    layout.setComponentAlignment(header, Alignment.MIDDLE_LEFT);
    //layout.setComponentAlignment(logoutButton, Alignment.BOTTOM_RIGHT);
    return layout;
}

From source file:de.fatalix.bookery.AppHeader.java

License:Open Source License

private MHorizontalLayout createSearchBar() {
    Label header = new Label("Bookery");
    header.addStyleName(ValoTheme.LABEL_BOLD);
    header.setSizeUndefined();
    header.addStyleName(ValoTheme.LABEL_H3);

    searchText = new TextField();
    searchText.setIcon(FontAwesome.SEARCH);
    searchText.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    searchText.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    searchText.setWidth(100, Unit.PERCENTAGE);
    searchText.setInputPrompt("hier einfach suchen..");
    Button searchButton = new Button("such!", new Button.ClickListener() {
        @Override/*from  w  ww  .java  2 s.com*/
        public void buttonClick(Button.ClickEvent event) {
            Navigator navigator = ((App) UI.getCurrent()).getNavigator();
            if (navigator.getState().contains("search")) {
                navigator.navigateTo(navigator.getState());
            } else {
                navigator.navigateTo(SearchView.id);
            }

        }
    });
    searchButton.addStyleName(ValoTheme.BUTTON_LARGE);
    searchText.addShortcutListener(new Button.ClickShortcut(searchButton, ShortcutAction.KeyCode.ENTER));

    MHorizontalLayout layout = new MHorizontalLayout(header, searchText, searchButton);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setExpandRatio(searchText, 1.0f);
    return layout;
}

From source file:de.fatalix.bookery.view.admin.AdminView.java

License:Open Source License

public HorizontalLayout createUserManagement() {
    userManagementLayout = new HorizontalLayout();
    userManagementLayout.addStyleName("wrapping");
    userManagementLayout.setSpacing(true);
    userManagementLayout.setMargin(true);

    Label label = new Label("Add new user...");
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_LARGE);
    VerticalLayout emptyLayout = new VerticalLayout(label);
    emptyLayout.addStyleName("dashed-border");
    emptyLayout.setWidth(380, Unit.PIXELS);
    emptyLayout.setHeight(220, Unit.PIXELS);
    emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override//  w ww  .  j  a v  a2  s . c o m
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            AppUser appUser = presenter.createNewUser();
            AppUserCard appUserCard = appUserCardInstances.get();
            appUserCard.loadAppUser(appUser);
            appUserCard.addAppUserCardListener(AdminView.this);
            userManagementLayout.addComponent(appUserCard, userManagementLayout.getComponentCount() - 1);
        }
    });
    userManagementLayout.addComponent(emptyLayout);
    return userManagementLayout;
}

From source file:de.fatalix.bookery.view.admin.BatchJobsLayout.java

private Layout createEmptyLayout() {
    Label label = new Label("Add new job...");
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_LARGE);

    VerticalLayout emptyLayout = new VerticalLayout(label);
    emptyLayout.addStyleName("dashed-border");
    emptyLayout.setWidth(380, Unit.PIXELS);
    emptyLayout.setHeight(220, Unit.PIXELS);
    emptyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    emptyLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override/* w  w  w .jav a 2 s  .c om*/
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            BatchJobConfiguration jobConfig = presenter.createBatchJob();
            BatchJobCard batchJobCard = batchJobCardInstances.get();
            batchJobCard.load(jobConfig);
            batchJobCard.addBatchJobCardListener(BatchJobsLayout.this);
            batchJobLayout.addComponent(batchJobCard, batchJobLayout.getComponentCount() - 1);
        }
    });
    return emptyLayout;
}

From source file:de.fatalix.bookery.view.common.SuggestLaneLayout.java

License:Open Source License

private VerticalLayout createEmptyDummy() {
    Label label = new Label("hab nix gfundn");
    label.addStyleName(ValoTheme.LABEL_H2);
    label.addStyleName(ValoTheme.LABEL_COLORED);
    label.setSizeUndefined();
    VerticalLayout dummyLayout = new VerticalLayout(label);
    dummyLayout.setHeight("150px");
    dummyLayout.setWidth("800px");
    dummyLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    return dummyLayout;
}

From source file:de.fatalix.lighty.web.component.LightyNotificationBar.java

public void showNotification(@Observes @ShowNotification final String message) {
    Label notificationLabel = new Label("");
    notificationLabel.setSizeUndefined();
    layout.removeAllComponents();/*from   ww  w. java  2 s  . co m*/
    layout.addComponents(proxy, notificationLabel);
    layout.setComponentAlignment(notificationLabel, Alignment.MIDDLE_CENTER);
    addStyleName(LightyTheme.NOTIFICATION);
    proxy.animate(notificationLabel, AnimType.FADE_IN).setDuration(500);
    notificationLabel.setValue(message);
}

From source file:de.gedoplan.webclients.vaadin.VaadinDemoUi.java

public Panel createFooter() {
    Panel footer = new Panel();
    footer.setStyleName(ValoTheme.PANEL_WELL);
    footer.setHeight(75, Unit.PIXELS);//from w  w  w  .j  a  v  a 2  s.c  o  m
    Label footerText = new Label(" 2016 gedoplan.de");
    footerText.setSizeUndefined();
    VerticalLayout footerLayout = new VerticalLayout();
    footerLayout.setSizeFull();
    footerLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    footerLayout.addComponent(footerText);
    footer.setContent(footerLayout);
    return footer;
}

From source file:de.gedoplan.webclients.vaadin.views.CustomerDetailView.java

public void init() {
    Double discount = customerService.calculateCustomerDiscount(customer.getCustomerID()).getDiscount();
    Label name = new Label(new PropertyFormatter(form.getProperty(Customer_.companyName)) {
        @Override/*from   ww  w  .ja v  a  2 s  .  co m*/
        public String format(Object value) {
            return value + " (" + customer.getCustomerID() + ")";
        }

        @Override
        public Object parse(String formattedValue) throws Exception {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
    name.setStyleName(ValoTheme.LABEL_BOLD);
    Label rabattLabel = new Label(Messages.customer_discount.value());
    rabattLabel.setStyleName(ValoTheme.LABEL_BOLD);
    rabattLabel.setSizeUndefined();
    Label rabatt = new Label(new DecimalFormat("#0.00").format(discount) + "%");
    rabatt.setSizeUndefined();
    rabatt.addStyleName(ValoTheme.LABEL_COLORED);
    rabatt.addStyleName(ValoTheme.LABEL_BOLD);
    HorizontalLayout headline = new HorizontalLayout(name, rabattLabel, rabatt);
    headline.setComponentAlignment(rabatt, Alignment.TOP_RIGHT);
    headline.setExpandRatio(name, 1);
    headline.setWidth(100, Unit.PERCENTAGE);
    headline.setSpacing(true);
    headline.setStyleName(ValoTheme.LAYOUT_WELL);
    headline.setMargin(new MMarginInfo(false, true));
    Panel panel = new Panel();
    panel.setContent(form);
    setMargin(true);
    setSpacing(true);
    addComponents(headline, panel);
}

From source file:de.gedoplan.webclients.vaadin.views.CustomerDetailView.java

public void initNoCustomer() {
    Label error = new Label("Benutzer nicht gefunden !");
    error.setSizeUndefined();
    error.setStyleName(ValoTheme.LABEL_FAILURE);
    setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
    addComponent(error);//from w  w w.ja  va2  s  . com
}