Example usage for com.vaadin.ui.themes ValoTheme TEXTAREA_SMALL

List of usage examples for com.vaadin.ui.themes ValoTheme TEXTAREA_SMALL

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme TEXTAREA_SMALL.

Prototype

String TEXTAREA_SMALL

To view the source code for com.vaadin.ui.themes ValoTheme TEXTAREA_SMALL.

Click Source Link

Document

Small size text area.

Usage

From source file:com.etest.view.systemadministration.syllabus.SyllabusFormWindow.java

Component buildSyllabusForms() {
    FormLayout form = new FormLayout();
    form.setWidth("100%");
    form.setMargin(true);// w ww .  j  av  a  2 s.  co  m

    subjects.setCaption("Subject: ");
    subjects.setWidth("50%");
    subjects.setIcon(FontAwesome.BOOK);
    subjects.addStyleName(ValoTheme.COMBOBOX_SMALL);
    form.addComponent(subjects);

    topicNo.setCaption("Topic No: ");
    topicNo.setWidth("50%");
    topicNo.setIcon(FontAwesome.TAG);
    topicNo.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    form.addComponent(topicNo);

    topic.setCaption("Topic: ");
    topic.setWidth("100%");
    topic.setIcon(FontAwesome.TAG);
    topic.setInputPrompt("Enter Topic..");
    topic.setRows(3);
    topic.addStyleName(ValoTheme.TEXTAREA_SMALL);
    form.addComponent(topic);

    estimatedTime.setCaption("Estimated Time: ");
    estimatedTime.setWidth("50%");
    estimatedTime.setIcon(FontAwesome.TAG);
    estimatedTime.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    form.addComponent(estimatedTime);

    Button save = new Button("SAVE");
    save.setWidth("50%");
    save.setIcon(FontAwesome.SAVE);
    save.addStyleName(ValoTheme.BUTTON_PRIMARY);
    save.addStyleName(ValoTheme.BUTTON_SMALL);
    save.addClickListener(buttonClickListener);

    Button update = new Button("UPDATE");
    update.setWidth("60%");
    update.setIcon(FontAwesome.PENCIL);
    update.addStyleName(ValoTheme.BUTTON_PRIMARY);
    update.addStyleName(ValoTheme.BUTTON_SMALL);
    update.addClickListener(buttonClickListener);

    Button remove = new Button("REMOVE");
    remove.setWidth("60%");
    remove.setIcon(FontAwesome.TRASH_O);
    remove.addStyleName(ValoTheme.BUTTON_PRIMARY);
    remove.addStyleName(ValoTheme.BUTTON_SMALL);
    remove.addClickListener(buttonClickListener);

    if (getSyllabusId() != 0) {
        s = ss.getSyllabusById(syllabusId);
        subjects.setValue(s.getCurriculumId());
        topicNo.setValue(String.valueOf(s.getTopicNo()));
        estimatedTime.setValue(String.valueOf(s.getEstimatedTime()));
        topic.setValue(s.getTopic());

        if (getButtonCaption().equals("edit")) {
            form.addComponent(update);
        } else {
            form.addComponent(remove);
        }
    } else {
        form.addComponent(save);
    }

    return form;
}

From source file:com.mechanicshop.components.TableLayout.java

public void createCustomMessage() {
    final TextArea textArea = new TextArea();
    textArea.setImmediate(true);/*from w ww .  j a  v  a2 s  .  c o m*/
    textArea.setColumns(30);
    textArea.setRows(10);
    textArea.addStyleName(ValoTheme.TEXTAREA_SMALL);
    textArea.setRequired(true);
    final Window subWindow = new Window();
    subWindow.setModal(true);
    subWindow.setHeight("350px");
    subWindow.setWidth("500px");
    subWindow.setCaption("Insert Message");
    subWindow.setStyleName(ValoTheme.WINDOW_TOP_TOOLBAR);
    subWindow.setClosable(false);
    subWindow.setResizable(false);

    HorizontalLayout layoutButtons = new HorizontalLayout();
    layoutButtons.setMargin(false);
    Button sendBtn = new Button("Send");
    sendBtn.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                textArea.validate();
                String message = textArea.getValue();
                smsSenderService.sendMessageMassive(message);
                subWindow.close();
                Notification.show("Message Sent");
            } catch (Exception e) {

            }
        }
    });
    sendBtn.setImmediate(true);
    sendBtn.setStyleName(ValoTheme.BUTTON_TINY);
    sendBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    Button cancelBtn = new Button("Cancel");
    cancelBtn.setStyleName(ValoTheme.BUTTON_TINY);
    cancelBtn.addStyleName(ValoTheme.BUTTON_DANGER);
    cancelBtn.setImmediate(true);
    cancelBtn.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            subWindow.close();

        }
    });

    layoutButtons.setSizeUndefined();
    layoutButtons.setSpacing(true);
    layoutButtons.addComponents(cancelBtn, sendBtn);

    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addComponent(textArea);
    layout.addComponent(layoutButtons);
    layout.setComponentAlignment(textArea, Alignment.MIDDLE_CENTER);
    layout.setComponentAlignment(layoutButtons, Alignment.MIDDLE_RIGHT);
    layout.setExpandRatio(textArea, 3);

    layout.setSizeFull();

    subWindow.setContent(layout);
    subWindow.center();

    getUI().addWindow(subWindow);
}

From source file:com.save.employee.request.RequestFormWindow.java

Component buildRequestForm() {
    GridLayout glayout = new GridLayout(4, 7);
    glayout.setSizeFull();//from w  w w  .j  a  v  a 2  s  .  c  o  m
    glayout.setSpacing(true);
    glayout.setMargin(true);

    controlNo = new TextField("Control No.");
    controlNo.setWidth("100%");
    controlNo.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    glayout.addComponent(controlNo, 0, 0);

    dateOfActivity = new DateField("Date of Activity: ");
    dateOfActivity.setWidth("100%");
    dateOfActivity.addStyleName(ValoTheme.DATEFIELD_SMALL);
    glayout.addComponent(dateOfActivity, 1, 0);

    area = CommonComboBox.areas();
    area.setWidth("100%");
    glayout.addComponent(area, 2, 0);

    activity = new TextField("Activity: ");
    activity.setWidth("100%");
    activity.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    glayout.addComponent(activity, 0, 1, 1, 1);

    venue = new TextField("Venue: ");
    venue.setWidth("100%");
    venue.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    glayout.addComponent(venue, 0, 2, 1, 2);

    requirements = new TextArea("Requirements: ");
    requirements.setWidth("100%");
    requirements.addStyleName(ValoTheme.TEXTAREA_SMALL);
    glayout.addComponent(requirements, 2, 1, 3, 2);

    Label lodging = new Label("Lodging: ");
    lodging.setWidthUndefined();
    glayout.addComponent(lodging, 0, 3);
    glayout.setComponentAlignment(lodging, Alignment.MIDDLE_CENTER);

    lodgingPax = new TextField("Pax: ");
    lodgingPax.setWidth("100%");
    lodgingPax.setValue("0");
    lodgingPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    lodgingPax.addStyleName("align-right");
    glayout.addComponent(lodgingPax, 1, 3);

    lodgingAmount = new TextField("Amount: ");
    lodgingAmount.setWidth("100%");
    lodgingAmount.setValue("0.00");
    lodgingAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    lodgingAmount.addStyleName("align-right");
    lodgingAmount.setEnabled(false);
    lodgingAmount.setImmediate(true);
    glayout.addComponent(lodgingAmount, 3, 3);

    lodgingBudget = new TextField("Budget: ");
    lodgingBudget.setWidth("100%");
    lodgingBudget.setValue("0.00");
    lodgingBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    lodgingBudget.addStyleName("align-right");
    lodgingBudget.addValueChangeListener((ValueChangeEvent event) -> {
        if (!CommonUtilities.checkInputIfInteger(lodgingPax.getValue().trim())) {
            Notification.show("Enter a numeric value for Pax", Notification.Type.ERROR_MESSAGE);
            return;
        }

        if (!CommonUtilities.checkInputIfDouble(lodgingBudget.getValue().trim())) {
            Notification.show("Enter a numeric value for Budget", Notification.Type.ERROR_MESSAGE);
            return;
        }

        lodgingAmount.setValue(String.valueOf(CommonUtilities.convertStringToInt(lodgingPax.getValue().trim())
                * CommonUtilities.convertStringToDouble(lodgingBudget.getValue().trim())));
    });
    lodgingBudget.setImmediate(true);
    glayout.addComponent(lodgingBudget, 2, 3);

    Label meals = new Label("Meals: ");
    meals.setWidthUndefined();
    glayout.addComponent(meals, 0, 4);
    glayout.setComponentAlignment(meals, Alignment.MIDDLE_CENTER);

    mealsPax = new TextField("Pax: ");
    mealsPax.setWidth("100%");
    mealsPax.setValue("0");
    mealsPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    mealsPax.addStyleName("align-right");
    glayout.addComponent(mealsPax, 1, 4);

    mealsAmount = new TextField("Amount: ");
    mealsAmount.setWidth("100%");
    mealsAmount.setValue("0.00");
    mealsAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    mealsAmount.addStyleName("align-right");
    mealsAmount.setEnabled(false);
    mealsAmount.setImmediate(liquidated);
    glayout.addComponent(mealsAmount, 3, 4);

    mealsBudget = new TextField("Budget: ");
    mealsBudget.setWidth("100%");
    mealsBudget.setValue("0.00");
    mealsBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    mealsBudget.addStyleName("align-right");
    mealsBudget.addValueChangeListener((ValueChangeEvent event) -> {
        if (!CommonUtilities.checkInputIfInteger(mealsPax.getValue().trim())) {
            Notification.show("Enter a numeric value for Pax", Notification.Type.ERROR_MESSAGE);
            return;
        }

        if (!CommonUtilities.checkInputIfDouble(mealsBudget.getValue().trim())) {
            Notification.show("Enter a numeric value for Budget", Notification.Type.ERROR_MESSAGE);
            return;
        }

        mealsAmount.setValue(String.valueOf(CommonUtilities.convertStringToInt(mealsPax.getValue().trim())
                * CommonUtilities.convertStringToDouble(mealsBudget.getValue().trim())));
    });
    mealsAmount.setImmediate(true);
    glayout.addComponent(mealsBudget, 2, 4);

    others = new TextArea("Others: ");
    others.setWidth("100%");
    others.setRows(3);
    others.addStyleName(ValoTheme.TEXTAREA_SMALL);
    glayout.addComponent(others, 0, 5, 2, 6);

    othersAmount = new TextField("Amount: ");
    othersAmount.setWidth("100%");
    othersAmount.setValue("0.00");
    othersAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    othersAmount.addStyleName("align-right");
    glayout.addComponent(othersAmount, 3, 5);
    glayout.setComponentAlignment(othersAmount, Alignment.TOP_CENTER);

    Button rlButton = new Button();
    rlButton.setCaption("SAVE");
    rlButton.setWidth("100%");
    rlButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    rlButton.addStyleName(ValoTheme.BUTTON_SMALL);
    rlButton.addClickListener(buttonClickListener);
    glayout.addComponent(rlButton, 3, 6);
    glayout.setComponentAlignment(rlButton, Alignment.TOP_CENTER);

    if (getRequestId() != 0) {
        LiquidationForm lf = rls.getRLById(getRequestId());
        controlNo.setValue(String.valueOf(lf.getControlNo()));
        dateOfActivity.setValue(lf.getDateOfActivity());
        area.setValue(lf.getAreaId());
        activity.setValue(lf.getActivity());
        requirements.setValue(lf.getRequirements());
        venue.setValue(lf.getVenue());
        others.setValue(lf.getOthersRemarks());
        othersAmount.setValue(String.valueOf(lf.getOthersAmount()));
        lodgingAmount.setValue(String.valueOf(lf.getLodgingAmount()));
        mealsAmount.setValue(String.valueOf(lf.getMealsAmount()));
        if (getLiquidated() == true) {
            setCaption("LIQUIDATE FROM");
            rlButton.setCaption("LIQUIDATE");
            controlNo.setReadOnly(liquidated);
            dateOfActivity.setReadOnly(liquidated);
            area.setReadOnly(liquidated);
            activity.setReadOnly(liquidated);
            requirements.setReadOnly(liquidated);
            venue.setReadOnly(liquidated);
        } else {
            rlButton.setCaption("EDIT");
            lodgingPax.setValue(String.valueOf(lf.getLodgingPax()));
            lodgingBudget.setValue(String.valueOf(lf.getLodgingBudget()));
            mealsPax.setValue(String.valueOf(lf.getMealsPax()));
            mealsBudget.setValue(String.valueOf(lf.getMealsBudget()));
            rlButton.setEnabled(rls.getRLById(getRequestId()).getLiquidated() == 0);
        }
        //            delete.setVisible(true);
    }

    return glayout;
}

From source file:com.save.employee.request.ViewRLWindow.java

FormLayout buildFormLayout() {
    FormLayout f = new FormLayout();
    f.setWidth("100%");
    f.setMargin(true);/* w w  w  .ja va2 s.c  o m*/

    LiquidationForm lf = rls.getRLById(getRequestId());

    controlNo = new TextField("Control No.");
    controlNo.setWidth("100%");
    controlNo.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    controlNo.setValue(String.valueOf(lf.getControlNo()));
    controlNo.setEnabled(false);
    f.addComponent(controlNo);

    dateOfActivity = new DateField("Date of Activity: ");
    dateOfActivity.setWidth("100%");
    dateOfActivity.addStyleName(ValoTheme.DATEFIELD_SMALL);
    dateOfActivity.setValue(lf.getDateOfActivity());
    dateOfActivity.setEnabled(false);
    f.addComponent(dateOfActivity);

    area = CommonComboBox.areas();
    area.setWidth("100%");
    area.setValue(lf.getAreaId());
    area.setEnabled(false);
    f.addComponent(area);

    activity = new TextField("Activity: ");
    activity.setWidth("100%");
    activity.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    activity.setValue(lf.getActivity());
    activity.setEnabled(false);
    f.addComponent(activity);

    venue = new TextField("Venue: ");
    venue.setWidth("100%");
    venue.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    venue.setValue(lf.getVenue());
    venue.setEnabled(false);
    f.addComponent(venue);

    requirements = new TextArea("Requirements: ");
    requirements.setWidth("100%");
    requirements.addStyleName(ValoTheme.TEXTAREA_SMALL);
    requirements.setValue(lf.getRequirements());
    requirements.setEnabled(false);
    f.addComponent(requirements);

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setWidth("100%");
    h1.setCaption("Request Lodging");
    h1.addStyleName("light");
    //        h1.setReadOnly(true);

    requestLodgingPax = new TextField();
    requestLodgingPax.setWidth("100%");
    requestLodgingPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestLodgingPax.addStyleName("align-right");
    requestLodgingPax.setValue("Pax: " + String.valueOf(lf.getLodgingPax()));
    requestLodgingPax.setEnabled(false);
    h1.addComponent(requestLodgingPax);

    requestLodgingBudget = new TextField();
    requestLodgingBudget.setWidth("100%");
    requestLodgingBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestLodgingBudget.addStyleName("align-right");
    requestLodgingBudget.setValue("Budget: " + String.valueOf(lf.getLodgingBudget()));
    requestLodgingBudget.setEnabled(false);
    h1.addComponent(requestLodgingBudget);

    requestLodgingAmount = new TextField();
    requestLodgingAmount.setWidth("100%");
    requestLodgingAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestLodgingAmount.addStyleName("align-right");
    requestLodgingAmount.setValue("Amount: " + String.valueOf(lf.getLodgingAmount()));
    requestLodgingAmount.setEnabled(false);
    h1.addComponent(requestLodgingAmount);

    f.addComponent(h1);
    f.setComponentAlignment(h1, Alignment.MIDDLE_LEFT);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setWidth("100%");
    h2.setCaption("Request Meals");
    //        h2.setReadOnly(true);

    requestMealsPax = new TextField();
    requestMealsPax.setWidth("100%");
    requestMealsPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestMealsPax.addStyleName("align-right");
    requestMealsPax.setValue("Pax: " + String.valueOf(lf.getMealsPax()));
    requestMealsPax.setEnabled(false);
    h2.addComponent(requestMealsPax);

    requestMealsBudget = new TextField();
    requestMealsBudget.setWidth("100%");
    requestMealsBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestMealsBudget.addStyleName("align-right");
    requestMealsBudget.setValue("Budget: " + String.valueOf(lf.getMealsBudget()));
    requestMealsBudget.setEnabled(false);
    h2.addComponent(requestMealsBudget);

    requestMealsAmount = new TextField();
    requestMealsAmount.setWidth("100%");
    requestMealsAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    requestMealsAmount.addStyleName("align-right");
    requestMealsAmount.setValue("Amount: " + String.valueOf(lf.getMealsAmount()));
    requestMealsAmount.setEnabled(false);
    h2.addComponent(requestMealsAmount);

    f.addComponent(h2);
    f.setComponentAlignment(h2, Alignment.MIDDLE_LEFT);

    HorizontalLayout h3 = new HorizontalLayout();
    h3.setWidth("100%");
    h3.setCaption("Liquidated Lodging");
    //        h3.setReadOnly(true);

    liquidateLodgingPax = new TextField();
    liquidateLodgingPax.setWidth("100%");
    liquidateLodgingPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateLodgingPax.addStyleName("align-right");
    liquidateLodgingPax.setValue("Pax: " + String.valueOf(lf.getLiquidationLodgingPax()));
    liquidateLodgingPax.setEnabled(false);
    h3.addComponent(liquidateLodgingPax);

    liquidateLodgingBudget = new TextField();
    liquidateLodgingBudget.setWidth("100%");
    liquidateLodgingBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateLodgingBudget.addStyleName("align-right");
    liquidateLodgingBudget.setValue("Budget: " + String.valueOf(lf.getLiquidationLodgingBudget()));
    liquidateLodgingBudget.setEnabled(false);
    h3.addComponent(liquidateLodgingBudget);

    liquidateLodgingAmount = new TextField();
    liquidateLodgingAmount.setWidth("100%");
    liquidateLodgingAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateLodgingAmount.addStyleName("align-right");
    liquidateLodgingAmount.setValue("Amount: " + String.valueOf(lf.getLiquidationLodgingAmount()));
    liquidateLodgingAmount.setEnabled(false);
    h3.addComponent(liquidateLodgingAmount);

    f.addComponent(h3);
    f.setComponentAlignment(h3, Alignment.MIDDLE_LEFT);

    HorizontalLayout h4 = new HorizontalLayout();
    h4.setWidth("100%");
    h4.setCaption("Liquidated Meals");
    h4.setReadOnly(true);

    liquidateMealsPax = new TextField();
    liquidateMealsPax.setWidth("100%");
    liquidateMealsPax.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateMealsPax.addStyleName("align-right");
    liquidateMealsPax.setValue("Pax: " + String.valueOf(lf.getLiquidationMealsPax()));
    liquidateMealsPax.setEnabled(false);
    h4.addComponent(liquidateMealsPax);

    liquidateMealsBudget = new TextField();
    liquidateMealsBudget.setWidth("100%");
    liquidateMealsBudget.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateMealsBudget.addStyleName("align-right");
    liquidateMealsBudget.setValue("Budget: " + String.valueOf(lf.getLiquidationMealsBudget()));
    liquidateMealsBudget.setEnabled(false);
    h4.addComponent(liquidateMealsBudget);

    liquidateMealsAmount = new TextField();
    liquidateMealsAmount.setWidth("100%");
    liquidateMealsAmount.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    liquidateMealsAmount.addStyleName("align-right");
    liquidateMealsAmount.setValue("Amount: " + String.valueOf(lf.getLiquidationMealsAmount()));
    liquidateMealsAmount.setEnabled(false);
    h4.addComponent(liquidateMealsAmount);

    f.addComponent(h4);
    f.setComponentAlignment(h4, Alignment.MIDDLE_LEFT);

    reimbursement = new TextField("Reimbursement: ");
    reimbursement.setWidth("50%");
    reimbursement.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    reimbursement.setValue(String.valueOf(lf.getReimbursedAmount()));
    reimbursement.setEnabled(false);
    f.addComponent(reimbursement);

    f.addStyleName("light");
    f.setReadOnly(true);

    return f;
}

From source file:org.eclipse.hawkbit.ui.common.builder.TextAreaBuilder.java

License:Open Source License

/**
 * Constructor.//  w w  w.j  av  a 2s  . c om
 * 
 * @param maxLengthAllowed
 *            for the text area
 */
public TextAreaBuilder(final int maxLengthAllowed) {
    super(maxLengthAllowed);
    styleName(ValoTheme.TEXTAREA_SMALL);
}

From source file:org.eclipse.hawkbit.ui.common.builder.TextAreaBuilder.java

License:Open Source License

@Override
protected TextArea createTextComponent() {
    final TextArea textArea = new TextArea();
    textArea.addStyleName(ValoTheme.TEXTAREA_SMALL);
    return textArea;
}