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:fr.amapj.view.engine.tools.TableBuilder.java

License:Open Source License

public Label createLabel(String msg, int taille) {
    Label l = new Label(msg);
    l.addStyleName("align-center");
    l.setWidth(taille + "px");
    return l;//from  ww w  .  j av  a  2  s . c o m
}

From source file:fr.amapj.view.engine.tools.TableBuilder.java

License:Open Source License

public void addHeaderBox(String msg, int taille) {
    Label hLabel = new Label(msg);
    hLabel.setWidth((taille + 13) + "px");
    hLabel.setHeight(height + "px");
    hLabel.addStyleName(styleName);
    header1.addComponent(hLabel);/*from   w ww .  java2 s.com*/
}

From source file:fr.amapj.view.views.advanced.devtools.DevToolsView.java

License:Open Source License

private Label addLabel(VerticalLayout layout, String str, String stylename) {
    Label tf = new Label(str);
    if (stylename != null) {
        tf.addStyleName(stylename);
    }/*from w  w  w .ja v  a2  s.  c  o m*/
    layout.addComponent(tf);
    return tf;
}

From source file:fr.amapj.view.views.advanced.devtools.DevToolsView.java

License:Open Source License

private Label addEmptyLine(VerticalLayout layout) {
    Label tf = new Label("<br/>", ContentMode.HTML);
    tf.addStyleName(ChameleonTheme.LABEL_BIG);
    layout.addComponent(tf);/*from w  w w.j av a 2 s.  c  om*/
    return tf;

}

From source file:fr.amapj.view.views.common.contratselector.ContratSelectorPart.java

License:Open Source License

public HorizontalLayout getChoixContratComponent() {
    // Partie choix du contrat
    HorizontalLayout toolbar1 = new HorizontalLayout();
    toolbar1.addStyleName("contrat-selectorpart");

    Label pLabel = new Label("Producteur");
    pLabel.addStyleName("combobox");
    pLabel.setSizeUndefined();//w  w w.j a  va2  s  . c  o m

    producteurBox = new Searcher(SearcherList.PRODUCTEUR, null, allowedProducteurs);
    producteurBox.setImmediate(true);

    producteurBox.addValueChangeListener(e -> handleProducteurChange());

    Label cLabel = new Label("Contrat");
    cLabel.addStyleName("combobox");
    cLabel.setSizeUndefined();

    contratBox = new ComboBox();

    contratBox.setImmediate(true);
    contratBox.setWidth("300px");

    contratBox.addValueChangeListener(e -> handleContratChange());

    reinitButton = new Button("Changer de contrat");
    reinitButton.addClickListener(e -> handleReinit());

    toolbar1.addComponent(pLabel);
    toolbar1.addComponent(producteurBox);
    toolbar1.addComponent(cLabel);
    toolbar1.addComponent(contratBox);
    if (onlyOneProducteur == false) {
        toolbar1.addComponent(reinitButton);
        toolbar1.setExpandRatio(reinitButton, 1);
        toolbar1.setComponentAlignment(reinitButton, Alignment.TOP_RIGHT);
        contratBox.setEnabled(false);
    } else {
        // Ceci est ncessaire pour conserver un alignement correct  
        Label tf = new Label("");
        toolbar1.addComponent(tf);
        toolbar1.setExpandRatio(tf, 1);
        toolbar1.setComponentAlignment(tf, Alignment.TOP_RIGHT);
    }

    toolbar1.setSpacing(true);
    toolbar1.setWidth("100%");

    return toolbar1;
}

From source file:fr.amapj.view.views.common.utilisateurselector.UtilisateurSelectorPart.java

License:Open Source License

private void constructMultipleUtilisateur(HorizontalLayout toolbar1) {
    if (isCompactMode == false) {
        Label pLabel = new Label("Amapien");
        pLabel.addStyleName("xutilisateurs");
        pLabel.setSizeUndefined();/*from ww w. j  a  v a2  s .  c o m*/
        toolbar1.addComponent(pLabel);
    }

    utilisateurBox = new Searcher(SearcherList.UTILISATEUR_ACTIF, null);
    utilisateurBox.setImmediate(true);
    utilisateurBox.addValueChangeListener(e -> handleUtilisateurChange());

    reinitButton = new Button("Changer d'amapien");
    reinitButton.addClickListener(e -> handleReinit());

    toolbar1.addComponent(utilisateurBox);
    toolbar1.addComponent(reinitButton);
    toolbar1.setExpandRatio(reinitButton, 1);
    toolbar1.setComponentAlignment(reinitButton, Alignment.TOP_RIGHT);

}

From source file:fr.amapj.view.views.compte.MonCompteView.java

License:Open Source License

/**
 * //from w w w . j a  v  a2  s  . com
 */
@Override
public void enter() {
    Panel p0 = new Panel();
    p0.setWidth("100%");
    p0.addStyleName(PANEL_COMPTEFORM);

    VerticalLayout vl1 = new VerticalLayout();
    vl1.setMargin(true);
    p0.setContent(vl1);
    addComponent(p0);

    // Bloc nom et prenom - Le nom et le prenom ne sont pas modifiables
    form1 = new FormLayout();
    form1.setMargin(false);
    form1.addStyleName("light");
    vl1.addComponent(form1);

    Label section = new Label("Nom et prnom");
    section.addStyleName("h2");
    section.addStyleName("colored");
    form1.addComponent(section);

    nom = addTextField("Votre nom ", form1);
    prenom = addTextField("Votre prnom ", form1);

    // Bloc Adresse mail  
    InLineFormHelper formHelper = new InLineFormHelper("Votre mail", "Modifier votre adresse mail", this,
            e -> handleSaveMail());
    mail = addTextField("Votre mail", formHelper.getForm());
    formHelper.getValidatorManager().add(mail, "Votre mail", "mail", new EmailValidator());
    formHelper.addIn(vl1);

    // Bloc mot de passe
    formHelper = new InLineFormHelper("Votre mot de passe", "Modifier votre mot de passe", this,
            e -> handleSavePassword());
    pwd = addTextField("Votre mot de passe", formHelper.getForm());
    formHelper.addIn(vl1);

    // les coordonnes
    formHelper = new InLineFormHelper("Vos coordonnes", "Modifier vos coordonnes", this,
            e -> handleSaveChangerCoordonnees());
    numTel1 = addTextField("Numro de tel 1", formHelper.getForm());
    numTel2 = addTextField("Numro de tel 2", formHelper.getForm());
    adresse = addTextField("Adresse", formHelper.getForm());
    codePostal = addTextField("Code Postal", formHelper.getForm());
    ville = addTextField("Ville", formHelper.getForm());
    formHelper.addIn(vl1);

    refresh();

}

From source file:fr.amapj.view.views.cotisation.PeriodeCotisationSelectorPart.java

License:Open Source License

public HorizontalLayout getChoixPeriodeComponent() {
    // Partie choix 
    HorizontalLayout toolbar1 = new HorizontalLayout();
    toolbar1.addStyleName("periode-selectorpart");

    Label pLabel = new Label("Priode de cotisation");
    pLabel.addStyleName("periode");
    pLabel.setSizeUndefined();/*from   w w w. j a va 2  s.  c o  m*/

    toolbar1.addComponent(pLabel);

    constructMultiplePeriode(toolbar1);

    toolbar1.setSpacing(true);
    toolbar1.setMargin(false);
    toolbar1.setWidth("100%");

    return toolbar1;
}

From source file:fr.amapj.view.views.editionspe.EditionSpeListPart.java

License:Open Source License

@Override
public void enterIn(ViewChangeEvent event) {

    // Lecture dans la base de donnes
    mcInfos = new BeanItemContainer<EditionSpeDTO>(EditionSpeDTO.class);

    // Bind it to a component
    cdesTable = createTable(mcInfos);//from w w  w  . j  ava 2  s  .c o m

    // Titre des colonnes
    cdesTable.setVisibleColumns(new String[] { "nom", "typEditionSpecifique" });
    cdesTable.setColumnHeader("nom", "Nom");
    cdesTable.setColumnHeader("typEditionSpecifique", "Type de l'dition");

    cdesTable.setSelectable(true);
    cdesTable.setImmediate(true);

    // Activation au desactivation des boutons delete et edit
    cdesTable.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            setModificationsEnabled(event.getProperty().getValue() != null);
        }

        private void setModificationsEnabled(boolean b) {
            enableButtonBar(b);
        }
    });

    cdesTable.setSizeFull();

    cdesTable.addItemClickListener(new ItemClickListener() {
        @Override
        public void itemClick(ItemClickEvent event) {
            if (event.isDoubleClick()) {
                cdesTable.select(event.getItemId());
            }
        }
    });

    HorizontalLayout toolbar = new HorizontalLayout();
    toolbar.addStyleName("stdlistpart-hlayout-button");

    Label title2 = new Label("Liste des ditions spcifiques");
    title2.setSizeUndefined();
    title2.addStyleName("stdlistpart-text-title");

    newButton = new Button("Crer une nouvelle dition spcifique");
    newButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            handleAjouter();
        }
    });

    editButton = new Button("Modifier");
    editButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            handleEditer();

        }
    });

    deleteButton = new Button("Supprimer");
    deleteButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            handleSupprimer();

        }
    });

    searchField = new TextField();
    searchField.setInputPrompt("Rechercher par nom");
    searchField.addTextChangeListener(new TextChangeListener() {

        @Override
        public void textChange(TextChangeEvent event) {
            textFilter = event.getText();
            updateFilters();
        }
    });

    toolbar.addComponent(newButton);
    toolbar.addComponent(editButton);
    toolbar.addComponent(deleteButton);

    toolbar.addComponent(searchField);
    toolbar.setWidth("100%");
    toolbar.setExpandRatio(searchField, 1);
    toolbar.setComponentAlignment(searchField, Alignment.TOP_RIGHT);

    addComponent(title2);
    addComponent(toolbar);
    addComponent(cdesTable);
    setExpandRatio(cdesTable, 1);

    refreshTable();

}

From source file:fr.amapj.view.views.importdonnees.ImportDonneesView.java

License:Open Source License

private Label addLabelH1(VerticalLayout layout, String str) {
    Label tf = new Label(str);
    tf.addStyleName("titre");
    layout.addComponent(tf);//  www  .  j a v a 2 s  .  co m
    return tf;

}