Example usage for com.vaadin.ui VerticalLayout setCaption

List of usage examples for com.vaadin.ui VerticalLayout setCaption

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setCaption.

Prototype

@Override
    public void setCaption(String caption) 

Source Link

Usage

From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.promote.ArticlePromotionViewImpl.java

License:Open Source License

private void createAlert() {
    VerticalLayout alertTextLayout = new VerticalLayout();
    alertTextLayout.setSpacing(true);/*from ww w .  j a  va  2 s .c  o m*/
    alertTextLayout.setCaption("Alert Text");

    MagnoliaRichTextField textField = (MagnoliaRichTextField) listener.createRichTextField();
    textField.setSizeFull();

    HorizontalLayout periodLayout = new HorizontalLayout();
    periodLayout.setSpacing(true);
    // periodLayout.setWidth("100%");
    DateField startDate = new DateField();
    // startDate.setWidth("100%");
    DateField endDate = new DateField();
    // endDate.setWidth("100%");

    periodLayout.addComponent(new Label("START"));
    periodLayout.addComponent(startDate);
    periodLayout.addComponent(new Label("END"));
    periodLayout.addComponent(endDate);

    alertTextLayout.addComponent(textField);
    alertTextLayout.addComponent(periodLayout);

    HorizontalLayout alertLayout = new HorizontalLayout();
    alertLayout.setSpacing(true);
    alertLayout.setWidth("100%");
    alertLayout.addComponent(alertTextLayout);

    final Label alertPreview = new Label("", ContentMode.HTML);
    alertPreview.setCaption("Alert Preview");
    alertPreview.addStyleName("preview-label");
    textField.addValueChangeListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            alertPreview.setValue(String.valueOf(event.getProperty().getValue()));
        }
    });
    alertPreview.setSizeUndefined();
    alertLayout.addComponent(alertPreview);
    alert.setContent(alertLayout);

    textField.setValue(
            "<b>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</b>");
}

From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.tagging.TaggingViewImpl.java

License:Open Source License

private void buildRecommendedTagsLayout() {
    VerticalLayout recommendedTagsLayout = new VerticalLayout();
    personsTagLayout.setCaption("PERSONS");
    teamTagLayout.setCaption("TEAM/GEOGRAPHY");
    scheduleTagLayout.setCaption("SCHEDULE");

    recommendedTagsLayout.setCaption("RECOMMENDED TAGS");
    recommendedTagsLayout.addComponent(personsTagLayout);
    recommendedTagsLayout.addComponent(teamTagLayout);
    recommendedTagsLayout.addComponent(scheduleTagLayout);

    tagLayout.addComponent(recommendedTagsLayout);
    tagLayout.setExpandRatio(recommendedTagsLayout, 1f);
}

From source file:com.nfl.dm.clubsites.cms.articles.subapp.articleeditor.tagging.TaggingViewImpl.java

License:Open Source License

private void buildCustomTagsLayout() {

    final VerticalLayout customTags = new VerticalLayout();
    customTags.setCaption("Custom Tags");

    final HorizontalLayout newTagLayout = new HorizontalLayout();
    newTagLayout.setSizeUndefined();// w w  w.  ja  v a  2  s  . c o  m

    final TextField newTagTextField = new TextField();
    newTagTextField.addStyleName("new-tag-textfield");
    newTagTextField.setHeight("52px");
    newTagTextField.setWidth("320px");
    newTagTextField.setNullRepresentation("");
    newTagTextField.setInputPrompt("Add new tag");
    NativeButton addTagButton = new NativeButton("", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            addCustomTag(newTagTextField);
        }
    });
    addTagButton.addStyleName("add-tag-button");

    newTagLayout.addComponent(newTagTextField);
    newTagLayout.addComponent(addTagButton);
    newTagLayout.setExpandRatio(newTagTextField, 1f);

    /*
    NativeButton addGenerateTagsButton = new NativeButton("", new Button.ClickListener() {
    @Override
    public void buttonClick(Button.ClickEvent event) {
        // Generate Tags
    }
    });
    addGenerateTagsButton.addStyleName("generate-tags-button");
    addGenerateTagsButton.setCaption("Generate Tags");
    newTagLayout.addComponent(addGenerateTagsButton);
    */

    customTags.addComponent(newTagLayout);
    customTags.addComponent(customTagLayout);

    this.tagLayout.addComponent(customTags);
}

From source file:com.openhris.employee.EmployeeInformationUI.java

public ComponentContainer employeeInformationWindow() {
    TabSheet ts = new TabSheet();
    ts.setSizeFull();// w  w w  .j ava 2  s  . c  om
    ts.addStyleName("bar");

    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setCaption("Personal Information");
    vlayout.addComponent(employeePersonalInformation);
    vlayout.setComponentAlignment(employeePersonalInformation, Alignment.MIDDLE_LEFT);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Address");
    vlayout.addComponent(employeeAddress);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Character Reference");
    vlayout.addComponent(characterReference);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Dependent(s)");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Educational Background");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Post Employment Info");
    vlayout.addComponent(postEmploymentInfomation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Work History");
    //   vlayout.addComponent(employeePersonalInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Salary Information");
    vlayout.addComponent(employeeSalaryInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Allowance Information");
    vlayout.addComponent(employeeAllowanceInformation);
    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setCaption("Other Information");
    vlayout.addComponent(otherInformation);
    ts.addComponent(vlayout);

    return ts;
}

From source file:com.openhris.payroll.AdjustmentWindow.java

public AdjustmentWindow(int payrollId, double amountToBeReceive, double amountReceived, double adjustment) {
    this.payrollId = payrollId;
    this.amountToBeReceive = amountToBeReceive;
    this.amountReceived = amountReceived;
    this.adjustment = adjustment;

    setCaption("ADJUSTMENTS");
    setWidth("400px");

    TabSheet ts = new TabSheet();
    ts.addStyleName("bar");

    VerticalLayout vlayout = new VerticalLayout();
    vlayout.setMargin(true);/* w w w . j  a va 2 s .  c  om*/
    vlayout.setSpacing(true);
    vlayout.setCaption("Post Adjustments");

    final TextField amount = new TextField("Amount: ");
    amount.setWidth("100%");
    vlayout.addComponent(amount);

    final TextField remarks = new TextField("Remarks");
    remarks.setWidth("100%");
    vlayout.addComponent(remarks);

    Button saveAdjustments = new Button("POST ADJUSTMENTS");
    saveAdjustments.setWidth("100%");
    saveAdjustments.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (amount.getValue() == null || amount.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Enter Amount for adjustment.",
                        Window.Notification.TYPE_WARNING_MESSAGE);
                return;
            } else {
                if (!utilities.checkInputIfDouble(amount.getValue().toString().trim())) {
                    getWindow().showNotification("Enter a numeric value for amount.",
                            Window.Notification.TYPE_ERROR_MESSAGE);
                    return;
                }
            }

            if (remarks.getValue() == null || remarks.getValue().toString().trim().isEmpty()) {
                getWindow().showNotification("Add remarks for adjustment.",
                        Window.Notification.TYPE_ERROR_MESSAGE);
                return;
            }

            double amountForAdjustment = utilities.convertStringToDouble(amount.getValue().toString().trim());
            String remarksForAdjustment = remarks.getValue().toString().trim().toLowerCase();
            boolean result = payrollService.insertAdjustmentToPayroll(getPayrollId(), getAmountToBeReceive(),
                    getAmountReceived(), amountForAdjustment, remarksForAdjustment);
            if (result) {
                adjustmentTable();
                close();
                getWindow().showNotification("Successfully added adjustment.",
                        Window.Notification.TYPE_HUMANIZED_MESSAGE);
            }
        }
    });
    vlayout.addComponent(saveAdjustments);

    ts.addComponent(vlayout);

    vlayout = new VerticalLayout();
    vlayout.setMargin(true);
    vlayout.setSpacing(true);
    vlayout.setCaption("Adjustments Table");

    Label label = new Label("Remarks: Click ID Column to delete Adjustment");
    vlayout.addComponent(label);

    vlayout.addComponent(adjustmentTable());

    Button closeBtn = new Button("CLOSE");
    closeBtn.setWidth("100%");
    closeBtn.addListener(closeBtnListener);
    vlayout.addComponent(closeBtn);

    ts.addComponent(vlayout);
    addComponent(ts);
}

From source file:com.peergreen.webconsole.scope.deployment.internal.components.DeployableWindow.java

License:Open Source License

public Component getContent() {
    FormLayout content = new FormLayout();
    content.setSpacing(true);/*  w  w w. j a  v  a2  s.  c om*/
    content.setMargin(true);

    Label name = new Label(deployableEntry.getName());
    name.setCaption("Name");
    content.addComponent(name);
    Label uri = new Label(deployableEntry.getUri().toString());
    uri.setCaption("URI");
    content.addComponent(uri);
    VerticalLayout status = new VerticalLayout();
    status.setCaption("Status");
    content.addComponent(status);
    if (report == null) {
        // is not deployed yet
        status.addComponent(new Label("Ready to be deployed"));
    } else {
        if (report.getExceptions().size() == 0) {
            status.addComponent(new Label("<p style=\"color:#329932\">Deployed</p>", ContentMode.HTML));
        } else {
            for (ArtifactError artifactError : report.getExceptions()) {
                for (ArtifactErrorDetail detail : artifactError.getDetails()) {
                    ExceptionView exceptionView = new ExceptionView(detail);
                    status.addComponent(exceptionView);
                }
            }
        }
        VerticalLayout endPointsLayout = new VerticalLayout();
        for (Endpoint endpoint : report.getEndpoints()) {
            try {
                Link link = new Link(endpoint.getURI().toString(),
                        new ExternalResource(endpoint.getURI().toURL()));
                link.setTargetName("_blank");
                endPointsLayout.addComponent(link);
            } catch (MalformedURLException e) {
                endPointsLayout.addComponent(new Label(endpoint.getURI().toString()));
            }
        }

        if (endPointsLayout.getComponentCount() > 0) {
            content.addComponent(endPointsLayout);
            endPointsLayout.setCaption("End points");
        }
    }
    return content;
}

From source file:com.save.employee.EmployeeInformationTabSheet.java

public EmployeeInformationTabSheet() {
    VerticalLayout v = new VerticalLayout();
    v.setCaption("Personal Information");
    v.setWidth("100%");
    v.setMargin(true);//from  ww w .  jav a 2 s  .  c  o  m
    v.setSpacing(true);
    //        v.addComponent(new PersonalInformationForm(this, getEmployeeId(), null, null));
    addComponent(v);

    v = new VerticalLayout();
    v.setCaption("Employment Information");
    v.setWidth("100%");
    v.setMargin(true);
    v.setSpacing(true);
    //        v.addComponent(new EmploymentInformationForm(this, getEmployeeId()));
    addComponent(v);
}

From source file:com.save.employee.EmployeeInformationTabSheet.java

public EmployeeInformationTabSheet(HorizontalSplitPanel hsplit, int employeeId) {
    this.hsplit = hsplit;
    this.employeeId = employeeId;

    VerticalLayout v = new VerticalLayout();
    v.setCaption("Personal Information");
    v.setWidth("100%");
    v.setMargin(true);//from   ww w . j a  va  2  s  .co m
    v.setSpacing(true);
    v.addComponent(new PersonalInformationForm(hsplit, employeeId, null, null));
    addComponent(v);

    v = new VerticalLayout();
    v.setCaption("Employment Information");
    v.setWidth("100%");
    v.setMargin(true);
    v.setSpacing(true);
    v.addComponent(new EmploymentInformationForm(hsplit, employeeId));
    addComponent(v);
}

From source file:com.terralcode.gestion.frontend.view.widgets.appointment.AppointmentView.java

private void buildAppointmentComplaints() {
    appointmentComplaintsPanel = new AppointmentComplaintsPanel();
    appointmentComplaintsPanel.setWidth("100%");

    VerticalLayout wrapper = new VerticalLayout();
    wrapper.setCaption("Quejas");
    wrapper.addComponent(appointmentComplaintsPanel);
    wrapper.setWidth("100%");
    rootLayout.addComponent(wrapper);//from   w  ww.  j a v a  2s  . c  o m
}

From source file:com.terralcode.gestion.frontend.view.widgets.customer.CustomerView.java

private void buildCustomerSpecies() {
    customerSpeciesPanel = new SpeciesPanel("Especies con las que trabaja");
    customerSpeciesPanel.setWidth("100%");

    VerticalLayout wrapper = new VerticalLayout();
    wrapper.setCaption("Especies con las que trabaja");
    wrapper.addComponent(customerSpeciesPanel);
    wrapper.setWidth("100%");
    mainLayout.addComponent(wrapper);// ww  w  .  ja v a  2  s  .co m
}