Example usage for com.vaadin.ui Label setStyleName

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

Introduction

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

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:annis.gui.HelpUsWindow.java

License:Apache License

public HelpUsWindow() {
    setSizeFull();//ww w . j av  a 2s. com
    layout = new VerticalLayout();
    setContent(layout);

    layout.setSizeFull();
    layout.setMargin(new MarginInfo(false, false, true, false));

    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSizeFull();
    hLayout.setMargin(false);

    VerticalLayout labelLayout = new VerticalLayout();
    labelLayout.setMargin(true);
    labelLayout.setSizeFull();

    Label lblOpenSource = new Label();

    lblOpenSource.setValue("<h1>ANNIS is <a href=\"http://opensource.org/osd\">Open Source</a> "
            + "software.</h1>" + "<p>This means you are free to download the source code and add new "
            + "features or make other adjustments to ANNIS on your own.<p/>"
            + "Here are some examples how you can help ANNIS:" + "<ul>"
            + "<li>Fix or report problems (bugs) you encounter when using the ANNIS software.</li>"
            + "<li>Add new features.</li>" + "<li>Enhance the documentation</li>" + "</ul>"
            + "<p>Feel free to visit our GitHub page for more information: <a href=\"https://github.com/korpling/ANNIS\" target=\"_blank\">https://github.com/korpling/ANNIS</a></p>");
    lblOpenSource.setContentMode(ContentMode.HTML);
    lblOpenSource.setStyleName("opensource");
    lblOpenSource.setWidth("100%");
    lblOpenSource.setHeight("-1px");
    labelLayout.addComponent(lblOpenSource);

    Link lnkFork = new Link();
    lnkFork.setResource(new ExternalResource("https://github.com/korpling/ANNIS"));
    lnkFork.setIcon(
            new ExternalResource("https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"));
    lnkFork.setTargetName("_blank");

    hLayout.addComponent(labelLayout);
    hLayout.addComponent(lnkFork);
    hLayout.setComponentAlignment(labelLayout, Alignment.TOP_LEFT);
    hLayout.setComponentAlignment(lnkFork, Alignment.TOP_RIGHT);
    hLayout.setExpandRatio(labelLayout, 1.0f);

    layout.addComponent(hLayout);

    final HelpUsWindow finalThis = this;

    btClose = new Button("Close");
    btClose.addClickListener(new OkClickListener(finalThis));
    layout.addComponent(btClose);

    layout.setComponentAlignment(hLayout, Alignment.MIDDLE_CENTER);
    layout.setComponentAlignment(btClose, Alignment.MIDDLE_CENTER);
    layout.setExpandRatio(hLayout, 1.0f);
}

From source file:at.peppol.webgui.app.MainWindow.java

License:Mozilla Public License

public void showInitialMainContent(UserFolder<?> userFolder) {
    // ------ START: Main Content -------
    final VerticalLayout mainContentLayout = new VerticalLayout();

    mainContentLayout.addStyleName("margin");
    final VerticalLayout topmain = new VerticalLayout();
    topmain.setSpacing(true);//ww  w  .  j  av  a2  s  .c  om
    topmain.setWidth("100%");
    final Label bigPAWGLabel = new Label("PEPPOL Post Award Web GUI");
    bigPAWGLabel.setStyleName("huge");
    topmain.addComponent(bigPAWGLabel);
    final Label blahContent = new Label(
            "This is a mockup of the GUI that is going" + " to be the PAWG. It is created by the Greek"
                    + " and Austrian teams as a fine replacement " + " of the Demo Client");
    blahContent.setWidth("80%");
    blahContent.addStyleName("big");
    //topmain.addComponent (blahContent);
    //HorizontalLayout itemsPanel = new ShowItemsPanel("Items", um, userFolder);

    final ShowItemsPanel itemsPanel = new ShowItemsPanel("Items", um, userFolder);
    this.itemsPanel = itemsPanel;
    topmain.addComponent(itemsPanel);
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    topmain.addComponent(buttonsLayout);
    Button loadButton = new Button("Load invoice");
    //topmain.addComponent(loadButton);
    buttonsLayout.addComponent(loadButton);
    loadButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            Table table = itemsPanel.getTable();
            if (table.getValue() != null) {
                //InvoiceType inv = (InvoiceType)table.getItem(table.getValue()).getItemProperty("invoice").getValue();
                //InvoiceBean invBean = (InvoiceBean)table.getItem(table.getValue());
                InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                        .getItem(table.getValue()).getBean();
                //System.out.println("Invoice is: "+invBean);
                showInvoiceForm(invBean);
            }
        }
    });

    Button sendButton = new Button("Send invoice");
    buttonsLayout.addComponent(sendButton);
    sendButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            try {
                Table table = itemsPanel.getTable();
                if (table.getValue() != null) {
                    InvoiceBean invBean = ((InvoiceBeanContainer) table.getContainerDataSource())
                            .getItem(table.getValue()).getBean();
                    String path = invBean.getFolderEntryID();
                    FileSystemResource s = new FileSystemResource(path);
                    SendInvoice.sendDocument(s);

                    //file is sent. move invoice to outbox
                    um.moveInvoice(invBean, um.getDrafts(), um.getOutbox());
                    //itemsPanel.getTable().requestRepaint();
                    itemsPanel.init(um.getDrafts());
                }
            } catch (FileNotFoundException e) {
                getWindow().showNotification("Could not find invoice file", Notification.TYPE_ERROR_MESSAGE);
            } catch (Exception e) {
                getWindow().showNotification("Could not send invoice. AP connection error",
                        Notification.TYPE_ERROR_MESSAGE);
                e.printStackTrace();
            }
        }
    });

    final Button learnMoreBtn = new Button("Learn More >>");
    learnMoreBtn.addStyleName("tall default");
    //topmain.addComponent (learnMoreBtn);

    mainContentLayout.addComponent(topmain);
    // ------ END: Main Content ---------
    mainContentLayout.setHeight("100%");
    mainContentLayout.setSizeFull();

    mainContentLayout.setSpacing(true);
    mainContentLayout.setWidth("100%");
    middleContentLayout.setWidth("100%");
    middleContentLayout.setHeight("100%");
    middleContentLayout.setMargin(true);
    // --------
    addComponent(middleContentLayout);
    addComponent(footerLayout);
    if (mainContentComponent != null) {
        middleContentLayout.replaceComponent(mainContentComponent, mainContentLayout);
    } else {
        middleContentLayout.addComponent(mainContentLayout);
    }
    middleContentLayout.setExpandRatio(mainContentLayout, 1);
    mainContentComponent = mainContentLayout;
}

From source file:at.peppol.webgui.app.MainWindow.java

License:Mozilla Public License

@SuppressWarnings("unused")
private void createTopBar() {

    topBarCSSLayout.setStyleName("toolbar");
    topBarCSSLayout.setSizeFull();/* w  w w . j  a  v a  2s .co m*/
    topBarLayout.setMargin(false, true, false, true);
    topBarLayout.setSizeFull();
    topBarLayoutLeft = new HorizontalLayout();
    topBarLayoutRight = new HorizontalLayout();

    final Label pawgLabel = new Label("PAWG");
    pawgLabel.setStyleName("h1");
    pawgLabel.setSizeUndefined();
    topBarLayoutLeft.addComponent(pawgLabel);

    final HorizontalLayout segBtns = createTopBarButtons();
    topBarLayoutLeft.addComponent(segBtns);

    // IUser user = (IUser) PawgApp.getInstance().getUser();
    final Label loggedInLabel = new Label("Test User");
    loggedInLabel.setSizeUndefined();
    topBarLayoutRight.addComponent(loggedInLabel);
    topBarLayoutRight.setComponentAlignment(loggedInLabel, Alignment.MIDDLE_RIGHT);
    topBarLayoutLeft.setComponentAlignment(segBtns, Alignment.MIDDLE_CENTER);
    topBarLayoutLeft.setSpacing(true);

    topBarLayout.addComponent(topBarLayoutLeft);
    topBarLayout.addComponent(topBarLayoutRight);
    topBarLayout.setComponentAlignment(topBarLayoutRight, Alignment.MIDDLE_RIGHT);

    topBarLayout.setExpandRatio(topBarLayoutLeft, 1);
    topBarLayout.setExpandRatio(topBarLayoutRight, 1);

    topBarCSSLayout.addComponent(topBarLayout);
    addComponent(topBarCSSLayout);

}

From source file:br.com.anteros.mobileserver.app.form.ActionForm.java

License:Apache License

public ActionForm(MobileServerApplication app, ActionSynchronism actionSynchronism, Synchronism objectOwner) {
    this.app = app;
    this.actionSynchronism = actionSynchronism;
    this.objectOwner = objectOwner;
    this.setMargin(true);
    createForm();/*from  w  w w  .j  av a2 s.com*/
    createFields();
    createButtons();

    Label lblTitle = new Label("Ao");
    lblTitle.setStyleName("h2 color");
    addComponent(lblTitle);
    addComponent(actionForm);

    fldName.focus();

    loadData();
}

From source file:br.com.anteros.mobileserver.app.form.ApplicationForm.java

License:Apache License

public ApplicationForm(MobileServerApplication app, ApplicationSynchronism applicationSynchronism) {
    this.app = app;
    this.applicationSynchronism = applicationSynchronism;
    this.setMargin(true);
    createForm();//from ww w .  j a va 2s  . co m
    createFields();
    createButtons();

    Label lblTitle = new Label("Aplicao");
    lblTitle.setStyleName("h2 color");
    addComponent(lblTitle);
    addComponent(applicationForm);
    fldName.focus();
    loadData();
}

From source file:br.com.anteros.mobileserver.app.form.ExecuteForm.java

License:Apache License

private void createForm() {
    if (actionSynchronism.getItems() != null) {

        Label lblTitle = new Label("Parmetros de execuo Ao " + actionSynchronism.getName() + " ("
                + actionSynchronism.getId() + ")");
        lblTitle.setStyleName("h2 color");
        lblTitle.setImmediate(false);/*from  w  w  w  .  ja  v a2  s.  c  o m*/
        addComponent(lblTitle);
        setComponentAlignment(lblTitle, Alignment.TOP_LEFT);

        Synchronism synchronism = actionSynchronism.getItems().iterator().next();
        executeForm = new Form();
        fields.clear();
        ParameterSynchronism[] parameters = null;
        if (synchronism instanceof TableSynchronism)
            parameters = ((TableSynchronism) synchronism).getParameters();
        if (synchronism instanceof ProcedureSynchronism)
            parameters = ((ProcedureSynchronism) synchronism).getParameters();
        for (ParameterSynchronism param : parameters) {
            if (param.getParameterType().intValue() == ParameterSynchronism.INPUT
                    || param.getParameterType().intValue() == ParameterSynchronism.SUBSTITUITION) {
                String value = FieldTypes.getFieldTypes().get(param.getParameterDataType().intValue() + "");
                if (value != null) {
                    if (FieldTypes.UNKNOW.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("400px");
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.INTEGER.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.VARCHAR.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("400px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.FLOAT.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.NUMERIC.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.DATE.equalsIgnoreCase(value)) {
                        PopupDateField field = new PopupDateField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        field.setResolution(PopupDateField.RESOLUTION_DAY);
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.TIME.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.TIMESTAMP.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    }
                }
            }
        }

        panelForm = new Panel();
        panelForm.setHeight("100%");
        panelForm.setWidth("100%");
        panelForm.setScrollable(true);
        addComponent(panelForm);
        executeForm.setImmediate(true);
        executeForm.setWidth("100%");
        panelForm.addComponent(executeForm);

        executeCommit = new CheckBox("Executar COMMIT no final do processo?");
        addComponent(executeCommit);

        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setImmediate(false);
        buttons.setWidth("600px");
        buttons.setHeight("-1px");
        buttons.setMargin(false);
        buttons.setSpacing(true);
        addComponent(buttons);

        btnExecute = new Button();
        btnExecute.setCaption("Executar");
        btnExecute.setIcon(new ThemeResource("icons/16/run.png"));
        btnExecute.addListener(clickListener);
        buttons.addComponent(btnExecute);
        buttons.setComponentAlignment(btnExecute, Alignment.MIDDLE_RIGHT);
        buttons.setExpandRatio(btnExecute, 1);

        btnClose = new Button();
        btnClose.setCaption("Fechar");
        btnClose.setIcon(new ThemeResource("icons/16/doorOut.png"));
        btnClose.addListener(clickListener);
        buttons.addComponent(btnClose);

        buttons.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);
        buttons.setMargin(true, false, true, false);
        addComponent(buttons);

        pageControl = new TabSheet();
        pageControl.setImmediate(true);
        pageControl.setWidth("100.0%");
        pageControl.setHeight("100.0%");

        textPanel = new Panel();
        textPanel.setImmediate(true);
        textPanel.setWidth("100%");
        textPanel.setHeight("100%");
        pageControl.addTab(textPanel, "Resultado", null);
        addComponent(pageControl);
        setExpandRatio(pageControl, 1.0f);
    }
}

From source file:br.com.anteros.mobileserver.app.form.FieldForm.java

License:Apache License

public FieldForm(MobileServerApplication app, FieldSynchronism fieldSynchronism, Window win,
        Synchronism objectOwner, boolean isFields) {

    this.app = app;
    this.fieldSynchronism = fieldSynchronism;
    this.objectOwner = objectOwner;
    this.win = win;
    this.isFields = isFields;
    this.setMargin(true);
    createForm();/*  w w  w  . j ava 2  s  .  co  m*/
    createFields();
    createButtons();

    Label lblTitle = new Label("Campo");
    lblTitle.setStyleName("h2 color");
    addComponent(lblTitle);
    addComponent(fieldForm);
    fldName.focus();

    loadData();
}

From source file:br.com.anteros.mobileserver.app.form.ParameterForm.java

License:Apache License

public ParameterForm(MobileServerApplication app, ParameterSynchronism parameterSynchronism, Window win,
        Synchronism objectOwner, boolean isParameters) {
    this.setMargin(true);
    this.app = app;
    this.parameterSynchronism = parameterSynchronism;
    this.win = win;
    this.isParameters = isParameters;
    this.objectOwner = objectOwner;

    createForm();/*from   ww  w.ja  va 2  s  . co  m*/
    createFields();
    createButtons();

    Label lblTitle = new Label("Parmetro");
    lblTitle.setStyleName("h2 color");
    addComponent(lblTitle);
    addComponent(parameterForm);
    fldName.focus();

    loadData();
}

From source file:br.com.anteros.mobileserver.app.form.ProcedureForm.java

License:Apache License

public ProcedureForm(MobileServerApplication app, ProcedureSynchronism procedureSynchronism,
        Synchronism objectOwner) {// ww w  .  j  a v a 2s  . c om
    this.setMargin(true);
    this.procedureSynchronism = procedureSynchronism;
    this.app = app;
    this.objectOwner = objectOwner;

    createForm();
    createFields();
    createButtons();
    createGrid();
    createPageControl();

    Label lblTitle = new Label("Procedimento");
    lblTitle.setStyleName("h2 color");

    addComponent(lblTitle);
    addComponent(procedureForm);
    addComponent(pageControl);
    addComponent(buttons);
    fldName.focus();
    enableActions();
    loadData();
}

From source file:br.com.anteros.mobileserver.app.form.TableForm.java

License:Apache License

public TableForm(MobileServerApplication app, TableSynchronism tableSynchronism, Synchronism objectOwner) {
    this.setMargin(true);
    this.app = app;
    this.tableSynchronism = tableSynchronism;
    this.objectOwner = objectOwner;
    this.itensDeleted = new ArrayList<Synchronism>();

    createForm();//from  www.j a v a 2 s .c  o  m
    createFields();
    createGrids();
    createButtons();

    createPageControl();

    Label lblTitle = new Label("Tabela");
    lblTitle.setStyleName("h2 color");
    addComponent(lblTitle);
    addComponent(tableForm);
    addComponent(pageControl);
    addComponent(buttons);
    fldName.focus();

    loadData();
    enableActions();
}