Example usage for com.vaadin.ui Label addStyleName

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

Introduction

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

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:com.foc.vaadin.gui.components.FVGISCoordinateLayout.java

License:Apache License

public FVGISCoordinateLayout(String caption, boolean longitude, FString property) {
    super(null);//from   w  w  w  .j  a  v a2s.  co m
    setSpacing(true);

    this.longitude = longitude;
    this.property = property;

    if (!ConfigInfo.isGuiRTL()) {
        Label lbl = new Label(caption);
        lbl.addStyleName("foc-bold");
        lbl.addStyleName("foc-f14");
        addComponent(lbl);
    }

    degreeField = new NumTextField(0, longitude ? 180 : 90);
    addComponent(degreeField);

    Label lbl = new Label(DEGREE);
    lbl.addStyleName("foc-bold");
    lbl.addStyleName("foc-f14");
    addComponent(lbl);

    minutesField = new NumTextField(0, 60);
    addComponent(minutesField);

    lbl = new Label(MINUTES_COMMA);
    lbl.addStyleName("foc-bold");
    lbl.addStyleName("foc-f14");
    addComponent(lbl);
    addComponent(new Label(MINUTES_COMMA));

    milliMinutesField = new NumTextField(0, 999);
    addComponent(milliMinutesField);

    lbl = new Label(MINUTES);
    lbl.addStyleName("foc-bold");
    lbl.addStyleName("foc-f14");
    addComponent(lbl);

    orientationField = new ComboBox();
    if (longitude) {
        orientationField.addItem("E");
        orientationField.addItem("W");
    } else {
        orientationField.addItem("N");
        orientationField.addItem("S");
    }
    orientationField.setWidth("70px");
    addComponent(orientationField);

    if (ConfigInfo.isGuiRTL()) {
        addComponent(new Label(caption));
    }

    copyMemoryToGui();
}

From source file:com.foc.vaadin.gui.FocCustomComponent.java

License:Apache License

private Label addLabel(String value, String style, int left, int top, int width, int heigth,
        ContentMode contentMode) {//from   ww w .j  a  va 2s  . c o m
    Label lbl = null;
    if (mainLayout != null) {
        lbl = new Label(value);
        lbl.setContentMode(contentMode);
        lbl.addStyleName(style);
        lbl.setWidth(width + "px");
        lbl.setHeight(heigth + "78px");
        mainLayout.addComponent(lbl, "top:" + top + ".0px;left:" + left + ".0px;");
    }
    return lbl;
}

From source file:com.foo01.components.ReservationComponent.java

public static Component build(final Reservation r) {
    final HorizontalLayout reservationComponentLayout = new HorizontalLayout();

    final VerticalLayout datesLayout = new VerticalLayout();
    Label beginningDate = new Label(
            (new SimpleDateFormat("E dd.MM.", Locale.getDefault())).format(r.getBeginning().getTime()));
    Label endingDate = new Label(
            (new SimpleDateFormat("E dd.MM.", Locale.getDefault())).format(r.getEnding().getTime()));
    beginningDate.addStyleName("datelabel");
    endingDate.addStyleName("datelabel");
    datesLayout.addComponent(beginningDate);
    datesLayout.addComponent(endingDate);
    datesLayout.setSpacing(true);/*  w w w .ja v  a  2s  . c  o m*/
    reservationComponentLayout.addComponent(datesLayout);

    Label reservationInfoLabel = new Label(r.getUser() + "</br></br>" + r.getDescription(), ContentMode.HTML);
    reservationInfoLabel.addStyleName("informationlabel");
    reservationComponentLayout.addComponent(reservationInfoLabel);

    Label rightArrowIconLabel = new Label("</br>" + FontAwesome.CHEVRON_RIGHT.getHtml(), ContentMode.HTML);
    rightArrowIconLabel.addStyleName("rightArrowIconLabel");
    reservationComponentLayout.addComponent(rightArrowIconLabel);

    reservationComponentLayout.setSpacing(true);
    reservationComponentLayout.setWidth("100%");
    datesLayout.setWidth("85px");
    reservationInfoLabel.setSizeFull();
    rightArrowIconLabel.setHeight("100%");
    rightArrowIconLabel.setWidth("20px");
    reservationComponentLayout.setExpandRatio(reservationInfoLabel, 1.0f);

    reservationComponentLayout.addLayoutClickListener(new LayoutClickListener() {
        @Override
        public void layoutClick(LayoutClickEvent event) {
            //System.out.println(event.getClickedComponent().getParent().getId());
            ((foo01TouchKitUI) UI.getCurrent()).NAVIGATIONMANAGER.navigateTo(new ReservationView(r));
        }
    });

    return reservationComponentLayout;
}

From source file:com.foo01.ui.ReservationDetailView.java

@Override
protected final void onBecomingVisible() {
    getNavigationBar().setCaption("Detail Rezervace");

    //buttony pod navbarem
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setStyleName("buttonToolBarLayout");
    buttonsLayout.setWidth("100%");

    Button deleteButton = new Button();
    deleteButton.setCaption("SMAZAT");
    deleteButton.setWidth(null);/*w  w  w  . j ava  2  s  .  co  m*/
    buttonsLayout.addComponent(deleteButton);

    Label plug = new Label();
    buttonsLayout.addComponent(plug);

    Button saveButton = new Button();
    saveButton.setCaption("ULOIT");
    saveButton.setWidth(null);
    buttonsLayout.addComponent(saveButton);
    buttonsLayout.setExpandRatio(plug, 1.0f);
    List<Source> sourcesList = MockSource.mockSources();

    //combobox na zdroje a jmeno uzivatele
    HorizontalLayout sourceAndNameLayout = new HorizontalLayout();
    sourceAndNameLayout.setWidth("100%");
    sourceAndNameLayout.setStyleName("sourceAndNameLayout");

    NativeSelect select = new NativeSelect();
    select.setNullSelectionAllowed(false);
    System.out.println(Page.getCurrent().getBrowserWindowWidth());
    String width = Page.getCurrent().getBrowserWindowWidth() / 2.5 + "px";
    select.setWidth(width);
    select.addItems(sourcesList);
    for (Source s : sourcesList) {
        if (reservation.getSource().equals(s)) {
            select.select(s);
            break;
        }
    }
    sourceAndNameLayout.addComponent(select);

    Label plug2 = new Label();
    sourceAndNameLayout.addComponent(plug2);

    Label name = new Label(reservation.getUser());
    name.setWidth(null);
    sourceAndNameLayout.addComponent(name);
    sourceAndNameLayout.setExpandRatio(plug2, 1.0f);

    //datepickery
    DatePicker dateFrom = new DatePicker();
    dateFrom.setStyleName("datePickerDetailView");
    dateFrom.setValue(reservation.getBeginning());
    dateFrom.setUseNative(true);
    dateFrom.setResolution(Resolution.TIME);
    dateFrom.setWidth("100%");

    DatePicker dateTo = new DatePicker();
    dateTo.setStyleName("datePickerDetailView");
    dateTo.setValue(reservation.getEnding());
    dateTo.setUseNative(true);
    dateTo.setResolution(Resolution.TIME);
    dateTo.setWidth("100%");

    //layout pro slider a popisky
    HorizontalLayout sliderLayout = new HorizontalLayout();
    sliderLayout.setStyleName("sliderLayout");
    sliderLayout.setWidth("100%");
    sliderLayout.setSpacing(true);

    Label sliderCaption = new Label("Po?et: ");
    sliderCaption.addStyleName("sliderCaption");
    sliderCaption.setWidth(null);
    sliderLayout.addComponent(sliderCaption);

    final Label horvalue = new Label();
    horvalue.setWidth("45px");
    horvalue.setStyleName("value");
    sliderLayout.addComponent(horvalue);

    final Slider horslider = new Slider(1, 10);
    horslider.setOrientation(SliderOrientation.HORIZONTAL);
    horslider.setValue(Double.valueOf(1));
    horslider.getState();
    horslider.getValue();
    horslider.setImmediate(true);
    horslider.setWidth("100%");
    sliderLayout.addComponent(horslider);
    sliderLayout.setExpandRatio(horslider, 1.0f);

    horvalue.setValue(String.valueOf(horslider.getValue().intValue()));

    horslider.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            int value = horslider.getValue().intValue();

            horvalue.setValue(String.valueOf(value));
        }
    });

    //switch schvaleno
    HorizontalLayout switchLayout = new HorizontalLayout();
    switchLayout.setStyleName("switchLayout");
    switchLayout.addComponent(new Label("Schvleno:"));
    switchLayout.setSpacing(true);
    Switch checkbox = new Switch(null, true);
    switchLayout.addComponent(checkbox);

    //popis rezervace
    TextArea description = new TextArea();
    description.setStyleName("descriptionDetailView");

    description.setWidth("100%");
    description.setImmediate(false);
    description.setCaption("Popis:");
    description.setValue(reservation.getDescription());
    //description.setRequired(true);
    description.setRequiredError("Popis mus bt zadn!");
    description.setNullRepresentation("");
    description.setReadOnly(true);
    //description.setRows(0);

    final VerticalLayout content = new VerticalLayout();
    content.setMargin(true);
    content.setSpacing(true);
    content.setStyleName(width);
    content.addComponent(buttonsLayout);
    content.addComponent(sourceAndNameLayout);
    content.addComponent(dateFrom);
    content.addComponent(dateTo);

    content.addComponent(sliderLayout);
    content.addComponent(switchLayout);
    content.addComponent(description);

    setContent(content);
}

From source file:com.foo01.ui.ReservationView.java

@Override
protected final void onBecomingVisible() {
    getNavigationBar().setCaption("Detail Rezervace");

    //buttony pod navbarem
    //        HorizontalLayout buttonsLayout = new HorizontalLayout();
    //        buttonsLayout.setStyleName("buttonToolBarLayout");
    //        buttonsLayout.setWidth("100%");
    ///*from w  w  w. j av  a2 s  . c om*/
    //        Button deleteButton = new Button();
    //        deleteButton.setCaption("SMAZAT");
    //        deleteButton.setWidth(null);
    //        buttonsLayout.addComponent(deleteButton);
    //
    //        Label plug = new Label();
    //        buttonsLayout.addComponent(plug);
    //
    //        Button saveButton = new Button();
    //        saveButton.setCaption("ULOIT");
    //        saveButton.setWidth(null);
    //        buttonsLayout.addComponent(saveButton);
    //        buttonsLayout.setExpandRatio(plug, 1.0f);  

    //combobox na zdroje a jmeno uzivatele
    List<Source> sourcesList = MockSource.mockSources();
    HorizontalLayout sourceAndNameLayout = new HorizontalLayout();
    sourceAndNameLayout.setWidth("100%");
    sourceAndNameLayout.setStyleName("sourceAndNameLayout");

    NativeSelect select = new NativeSelect();
    select.setNullSelectionAllowed(false);
    System.out.println(Page.getCurrent().getBrowserWindowWidth());
    String width = Page.getCurrent().getBrowserWindowWidth() / 2.5 + "px";
    select.setWidth(width);
    select.addItems(sourcesList);
    for (Source s : sourcesList) {
        if (reservation.getSource().equals(s)) {
            select.select(s);
            break;
        }
    }
    sourceAndNameLayout.addComponent(select);

    Label plug2 = new Label();
    sourceAndNameLayout.addComponent(plug2);

    Label name = new Label(reservation.getUser());
    name.setWidth(null);
    sourceAndNameLayout.addComponent(name);
    sourceAndNameLayout.setExpandRatio(plug2, 1.0f);

    //datepickery
    DatePicker dateFrom = new DatePicker();
    dateFrom.setStyleName("datePickerDetailView");
    dateFrom.setValue(reservation.getBeginning());
    dateFrom.setUseNative(true);
    dateFrom.setResolution(Resolution.TIME);
    dateFrom.setWidth("100%");

    DatePicker dateTo = new DatePicker();
    dateTo.setStyleName("datePickerDetailView");
    dateTo.setValue(reservation.getEnding());
    dateTo.setUseNative(true);
    dateTo.setResolution(Resolution.TIME);
    dateTo.setWidth("100%");

    //layout pro slider a popisky
    HorizontalLayout sliderLayout = new HorizontalLayout();
    sliderLayout.setStyleName("sliderLayout");
    sliderLayout.setWidth("100%");
    sliderLayout.setSpacing(true);

    Label sliderCaption = new Label("Po?et: ");
    sliderCaption.addStyleName("sliderCaption");
    sliderCaption.setWidth(null);
    sliderLayout.addComponent(sliderCaption);

    final Label horvalue = new Label();
    horvalue.setWidth("45px");
    horvalue.setStyleName("value");
    sliderLayout.addComponent(horvalue);

    final Slider horslider = new Slider(1, 10);
    horslider.setOrientation(SliderOrientation.HORIZONTAL);
    horslider.setValue(Double.valueOf(1));
    horslider.getState();
    horslider.getValue();
    horslider.setImmediate(true);
    horslider.setWidth("100%");
    sliderLayout.addComponent(horslider);
    sliderLayout.setExpandRatio(horslider, 1.0f);

    horvalue.setValue(String.valueOf(horslider.getValue().intValue()));

    horslider.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            int value = horslider.getValue().intValue();

            horvalue.setValue(String.valueOf(value));
        }
    });

    //switch schvaleno
    HorizontalLayout switchLayout = new HorizontalLayout();
    switchLayout.setStyleName("switchLayout");
    switchLayout.addComponent(new Label("Schvleno:"));
    switchLayout.setSpacing(true);
    Switch checkbox = new Switch(null, true);
    switchLayout.addComponent(checkbox);

    //popis rezervace
    TextArea description = new TextArea();
    description.setStyleName("descriptionDetailView");

    description.setWidth("100%");
    description.setImmediate(false);
    description.setCaption("Popis:");
    description.setValue(reservation.getDescription());
    //description.setRequired(true);
    description.setRequiredError("Popis mus bt zadn!");
    description.setNullRepresentation("");
    description.setReadOnly(true);
    //description.setRows(0);

    final VerticalLayout content = new VerticalLayout();
    content.setMargin(true);
    content.setSpacing(true);
    content.addComponent(new ButtonToolBarLayout(this));
    content.addComponent(sourceAndNameLayout);
    content.addComponent(dateFrom);
    content.addComponent(dateTo);

    content.addComponent(sliderLayout);
    content.addComponent(switchLayout);
    content.addComponent(description);

    setContent(content);
}

From source file:com.freebox.engeneering.application.web.layout.HeaderController.java

License:Apache License

/**
 * Loads data into the form when system enters 'loadData' state.
 *
 * @param event -  the state event./*from  ww  w. j  a v  a2  s  . c  om*/
 */
@SuppressWarnings("rawtypes")
@OnEnterState(StateConstants.PROFILE)
public void buildHeader(StateEvent event) {
    clearView(event);
    HorizontalLayout top = super.getView();
    final Label title = new Label("My Freebox Manager");
    title.setSizeUndefined();
    title.addStyleName("h1");
    top.addComponent(title);
    top.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
    top.setExpandRatio(title, 1);

    Button notify = new Button();
    notify.setDescription("Notifications");
    notify.addStyleName("notifications");
    notify.addStyleName("unread");
    notify.addStyleName("icon-only");
    notify.addStyleName("icon-bell");
    top.addComponent(notify);
    top.setComponentAlignment(notify, Alignment.MIDDLE_LEFT);

    Button edit = new Button();
    edit.addStyleName("icon-edit");
    edit.addStyleName("icon-only");
    edit.setDescription("Edit Dashboard");
    top.addComponent(edit);
    top.setComponentAlignment(edit, Alignment.MIDDLE_LEFT);

    Button downloadB = new Button();
    downloadB.addStyleName("icon-edit");
    downloadB.addStyleName("icon-only");
    downloadB.setDescription("Tlcharger un fichier");
    top.addComponent(downloadB);
    top.setComponentAlignment(downloadB, Alignment.MIDDLE_LEFT);

}

From source file:com.garyclayburg.vconsole.VConsole.java

License:Open Source License

private HorizontalLayout createTop() {
    topLayout = new HorizontalLayout();
    topLayout.setWidth("100%");
    topLayout.setSpacing(true);//from  www.  j a  v  a2s  . co m
    topLayout.addStyleName("toolbar");
    final Label title = new Label("Policy console");
    title.setSizeUndefined();
    title.addStyleName("h1");
    topLayout.addComponent(title);
    topLayout.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
    topLayout.setExpandRatio(title, 1);

    policyChangeStatus = new Label("");
    policyChangeStatus.setSizeUndefined();
    policyChangeStatus.addStyleName("policyNormal");
    topLayout.addComponent(policyChangeStatus);
    topLayout.setComponentAlignment(policyChangeStatus, Alignment.MIDDLE_LEFT);

    createNotifyButton();
    topLayout.addComponent(notify);
    topLayout.setComponentAlignment(notify, Alignment.MIDDLE_LEFT);
    return topLayout;
}

From source file:com.github.djabry.platform.vaadin.view.BannerView.java

License:Open Source License

private Component buildTitle() {

    Label t = new Label("Test Dashboard");
    t.addStyleName(ValoTheme.LABEL_H1);

    return t;//from w  ww  .  j  av a  2 s. com
}

From source file:com.github.djabry.platform.vaadin.view.BaseMainViewAbstr.java

License:Open Source License

@PostConstruct
protected void init() {
    MarginInfo marginInfo = new MarginInfo(true, true, true, true);
    this.setMargin(marginInfo);
    this.setSpacing(true);

    String titleString = this.getTitle();
    if (titleString != null) {
        Label title = new Label(getTitle());
        title.addStyleName(ValoTheme.LABEL_H2);
        this.addComponent(title);
    }/*  w  w  w . java 2  s .  c  om*/

}

From source file:com.github.djabry.platform.vaadin.view.SideBarView.java

License:Open Source License

private Component buildTitle() {

    Label t = new Label("CE");
    t.addStyleName(ValoTheme.LABEL_HUGE);
    t.addStyleName(ValoTheme.LABEL_COLORED);
    t.addStyleName(ValoTheme.LABEL_BOLD);

    //t.addStyleName(ValoTheme.TEXTFIELD_ALIGN_CENTER);
    //t.setWidth("100%");
    //t.addStyleName(ValoTheme.LABEL_BOLD);
    return t;//from   w  w  w . ja  v  a 2s.c o m
}