Example usage for com.vaadin.ui TextArea TextArea

List of usage examples for com.vaadin.ui TextArea TextArea

Introduction

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

Prototype

public TextArea(String caption, ValueChangeListener<String> valueChangeListener) 

Source Link

Document

Constructs a new TextArea with the given caption and a value change listener.

Usage

From source file:com.esofthead.mycollab.mobile.module.crm.view.account.AccountEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if ("type".equals(propertyId)) {
        AccountTypeComboBox accountTypeBox = new AccountTypeComboBox();
        return accountTypeBox;
    } else if ("industry".equals(propertyId)) {
        IndustryComboBox accountIndustryBox = new IndustryComboBox();
        return accountIndustryBox;
    } else if ("assignuser".equals(propertyId)) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    } else if ("description".equals(propertyId)) {
        TextArea textArea = new TextArea("", "");
        textArea.setNullRepresentation("");
        return textArea;
    } else if ("billingcountry".equals(propertyId) || "shippingcountry".equals(propertyId)) {
        CountryComboBox billingCountryComboBox = new CountryComboBox();
        return billingCountryComboBox;
    } else if (propertyId.equals("accountname")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);/*from   ww w .j  a v a2  s.  co m*/
            tf.setRequiredError(AppContext.getMessage(AccountI18nEnum.ERROR_ACCOUNT_NAME_IS_NULL));
        }

        return tf;
    }

    return null;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.cases.CaseEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("priority")) {
        return new CasePriorityComboBox();
    } else if (propertyId.equals("status")) {
        return new CaseStatusComboBox();
    } else if (propertyId.equals("reason")) {
        return new CaseReasonComboBox();
    } else if (propertyId.equals("origin")) {
        return new CasesOriginComboBox();
    } else if (propertyId.equals("type")) {
        return new CaseTypeComboBox();
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea("", "");
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("resolution")) {
        TextArea reArea = new TextArea("", "");
        reArea.setNullRepresentation("");
        return reArea;
    } else if (propertyId.equals("accountid")) {
        AccountSelectionField accountField = new AccountSelectionField();
        accountField.setRequired(true);/*w  w w.ja v a2  s.c  o m*/
        return accountField;
    } else if (propertyId.equals("subject")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);
            tf.setRequiredError("Subject must not be null");
        }

        return tf;
    } else if (propertyId.equals("assignuser")) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    }

    return null;
}

From source file:com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode.CommitteeRankingOverviewPageModContentFactoryImpl.java

License:Apache License

/**
 * Creates the description./*  ww w  . j a v  a2  s. c om*/
 *
 * @return the text area
 */
private static TextArea createDescription() {
    final TextArea totalCommitteeRankinglistLabel = new TextArea(COMMITTEE_RANKING_BY_TOPIC,
            COMMITTEE_RANKING_BY_TOPIC_DESCRIPTION);
    totalCommitteeRankinglistLabel.setSizeFull();
    totalCommitteeRankinglistLabel.setStyleName("Level2Header");
    return totalCommitteeRankinglistLabel;
}

From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingOverviewPageModContentFactoryImpl.java

License:Apache License

/**
 * Creates the description.// w w w . j  a  v  a 2  s . co m
 *
 * @return the text area
 */
private static TextArea createDescription() {
    final TextArea totalCommitteeRankinglistLabel = new TextArea(MINISTRY_RANKING_BY_TOPIC,
            MINISTRY_RANKING_BY_TOPIC_DESCRIPTION);
    totalCommitteeRankinglistLabel.setSizeFull();
    totalCommitteeRankinglistLabel.setStyleName("Level2Header");
    return totalCommitteeRankinglistLabel;
}

From source file:com.hack23.cia.web.impl.ui.application.views.user.party.pagemode.PartyRankingOverviewPageModContentFactoryImpl.java

License:Apache License

/**
 * Creates the description.//from   w  w  w.j a v  a2 s. c  o  m
 *
 * @return the text area
 */
private static TextArea createDescription() {
    final TextArea totalpartytoplistLabel = new TextArea("Party Ranking by topic",
            "Time served in Parliament:ALL:CURRENT:" + "\nTime served in Committees:ALL:CURRENT:"
                    + "\nTime served in Government:ALL:CURRENT:"
                    + "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType"
                    + "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType"

                    + "\nTop votes NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
                    + "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
                    + "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
                    + "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
                    + "\nSearch by name");
    totalpartytoplistLabel.setSizeFull();
    totalpartytoplistLabel.setStyleName("Level2Header");
    return totalpartytoplistLabel;
}

From source file:com.hack23.cia.web.impl.ui.application.views.user.politician.pagemode.PoliticianRankingOverviewPageModContentFactoryImpl.java

License:Apache License

/**
 * Creates the description./*w ww .  j  a  v  a 2 s.  co m*/
 *
 * @return the text area
 */
private static TextArea createDescription() {
    final TextArea totalpoliticantoplistLabel = new TextArea("Politician Ranking by topic",
            "Time served in Parliament:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
                    + "\nTime served in Committees:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
                    + "\nTime served in Government:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
                    + "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"
                    + "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"

                    + "\nTop votes:ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
                    + "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
                    + "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
                    + "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
                    + "\nSearch by name");
    totalpoliticantoplistLabel.setSizeFull();
    totalpoliticantoplistLabel.setStyleName("Level2Header");
    return totalpoliticantoplistLabel;
}

From source file:com.lst.deploymentautomation.vaadin.popup.TodoAnnotation.java

License:Open Source License

@Override
public void attach() {
    super.attach();

    LspsUI ui = (LspsUI) getUI();// ww w  .j  a va 2 s. c  om
    setCaption(ui.getMessage("todo.annotationTitle"));

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();
    setContent(layout);

    Label help = new Label(ui.getMessage("todo.annotationHelp"));
    help.setStyleName("form-help");
    layout.addComponent(help);

    priorityField = new TextField(ui.getMessage("todo.priority"), priority);
    //TODO forbid negative priorities
    priorityField.setConverter(Integer.class);
    priorityField.setConversionError(ui.getMessage("app.invalidValueMessage"));
    priorityField.setNullRepresentation("");
    priorityField.setNullSettingAllowed(true);
    layout.addComponent(priorityField);

    TextArea notesField = new TextArea(ui.getMessage("todo.notes"), notes);
    notesField.setMaxLength(1024);
    notesField.setNullRepresentation("");
    priorityField.setNullSettingAllowed(true);
    notesField.setSizeFull();
    layout.addComponent(notesField);
    layout.setExpandRatio(notesField, 1);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    layout.addComponent(buttons);

    @SuppressWarnings("serial")
    Button submitButton = new Button(ui.getMessage("action.annotate"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            annotate();
        }
    });
    buttons.addComponent(submitButton);

    @SuppressWarnings("serial")
    Button cancelButton = new Button(ui.getMessage("action.cancel"), new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            close();
        }
    });
    buttons.addComponent(cancelButton);
}

From source file:com.mycollab.mobile.module.crm.view.account.AccountEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if ("type".equals(propertyId)) {
        return new AccountTypeListSelect();
    } else if ("industry".equals(propertyId)) {
        return new IndustryListSelect();
    } else if ("assignuser".equals(propertyId)) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    } else if ("description".equals(propertyId)) {
        TextArea textArea = new TextArea("", "");
        textArea.setNullRepresentation("");
        return textArea;
    } else if ("billingcountry".equals(propertyId) || "shippingcountry".equals(propertyId)) {
        return new CountryListSelect();
    } else if (propertyId.equals("accountname")) {
        MTextField tf = new MTextField();
        if (isValidateForm) {
            tf.withNullRepresentation("").withRequired(true)
                    .withRequiredError(UserUIContext.getMessage(ErrorI18nEnum.FIELD_MUST_NOT_NULL,
                            UserUIContext.getMessage(AccountI18nEnum.FORM_ACCOUNT_NAME)));
        }/*ww w  .j a v a 2  s.c o  m*/

        return tf;
    }

    return null;
}

From source file:com.mycollab.mobile.module.crm.view.cases.CaseEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("priority")) {
        return new CasePriorityListSelect();
    } else if (propertyId.equals("status")) {
        return new CaseStatusListSelect();
    } else if (propertyId.equals("reason")) {
        return new CaseReasonListSelect();
    } else if (propertyId.equals("origin")) {
        return new CasesOriginListSelect();
    } else if (propertyId.equals("type")) {
        return new CaseTypeListSelect();
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea("", "");
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("resolution")) {
        TextArea reArea = new TextArea("", "");
        reArea.setNullRepresentation("");
        return reArea;
    } else if (propertyId.equals("accountid")) {
        AccountSelectionField accountField = new AccountSelectionField();
        accountField.setRequired(true);//  w ww .  j  av  a2 s . c om
        return accountField;
    } else if (propertyId.equals("subject")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);
            tf.setRequiredError("Subject must not be null");
        }

        return tf;
    } else if (propertyId.equals("assignuser")) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    }

    return null;
}

From source file:com.peergreen.example.webconsole.extensions.CssContributionExtension.java

License:Open Source License

@PostConstruct
public void init() {
    String css = ".custom_button_style {\n" + "   color : red !important;\n"
            + "   border : 1px green dashed !important;\n" + "}";
    final TextArea textArea = new TextArea("Css : ", css);
    textArea.setWidth("500px");
    addComponent(textArea);/*  ww  w .j a  v a 2s . c  om*/
    Button button = new Button("Change my style !");
    button.setWidth("500px");
    button.addStyleName("custom_button_style");
    button.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            String newCss = textArea.getValue();
            cssInjectorService.inject(newCss);
        }
    });
    addComponent(button);
    setExpandRatio(button, 1.5f);
}