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() 

Source Link

Document

Constructs an empty TextArea.

Usage

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.MgrPhone2PhoneSettingView.java

/**
 * ??//from w  w  w . j a  v  a2s  .  com
 * @param panelContent
 */
private void createPhoneArea(VerticalLayout panelContent) {
    phoneAreaLayout = new HorizontalLayout();
    phoneAreaLayout.setWidth("100%");
    phoneAreaLayout.setVisible(false);
    phoneAreaLayout.setSpacing(true);
    panelContent.addComponent(phoneAreaLayout);

    Label caption = new Label("");
    caption.setWidth("-1px");
    caption.setDescription(
            "<B>'??'???</B>");
    phoneAreaLayout.addComponent(caption);

    phoneArea = new TextArea();
    phoneArea.setRows(6);
    phoneArea.setWidth("100%");
    phoneArea.setImmediate(true);
    phoneArea.setReadOnly(true);
    phoneArea.setInputPrompt(
            "???, ???(,)?");
    phoneArea.setDescription(
            "<B>'??'???</B>");
    phoneAreaLayout.addComponent(phoneArea);
    phoneAreaLayout.setExpandRatio(phoneArea, 1.0f);
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.SystemLicence.java

/**
 * added by chb 20140520/*from   w  w w .jav a2s .  c  om*/
 * @return
 */
private VerticalLayout updateLicenseComponent() {
    VerticalLayout licenseUpdateLayout = new VerticalLayout();
    final VerticalLayout textAreaPlaceHolder = new VerticalLayout();
    final HorizontalLayout buttonPlaceHolder = new HorizontalLayout();
    buttonPlaceHolder.setSpacing(true);

    //
    final Button updateButton = new Button("License");
    updateButton.setData("show");

    //
    final Button cancelButton = new Button("?");

    //
    final TextArea licenseTextArea = new TextArea();
    licenseTextArea.setColumns(30);
    licenseTextArea.setRows(5);
    licenseTextArea.setWordwrap(true);
    licenseTextArea.setInputPrompt("??");

    //Layout
    buttonPlaceHolder.addComponent(updateButton);
    licenseUpdateLayout.addComponent(textAreaPlaceHolder);
    licenseUpdateLayout.addComponent(buttonPlaceHolder);

    //
    cancelButton.addListener(new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            textAreaPlaceHolder.removeAllComponents();
            buttonPlaceHolder.removeComponent(cancelButton);
            updateButton.setData("show");
            updateButton.setCaption("License");
        }
    });

    updateButton.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            if (((String) event.getButton().getData()).equals("show")) {
                textAreaPlaceHolder.removeAllComponents();
                textAreaPlaceHolder.addComponent(licenseTextArea);
                buttonPlaceHolder.addComponent(cancelButton);
                event.getButton().setData("updateAndHide");
                event.getButton().setCaption("??");
            } else if (((String) event.getButton().getData()).equals("updateAndHide")) {
                StringReader stringReader = new StringReader(
                        StringUtils.trimToEmpty((String) licenseTextArea.getValue()));
                Properties props = new Properties();
                try {
                    props.load(stringReader);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                stringReader.close();
                //               Boolean isValidvalidateLicense(licenseTextArea.getValue());
                String license_date = props.getProperty(LicenseManager.LICENSE_DATE);
                String license_count = props.getProperty(LicenseManager.LICENSE_COUNT);
                String license_localmd5 = props.getProperty(LicenseManager.LICENSE_LOCALMD5);
                //
                Boolean isMatch = regexMatchCheck(license_date, license_count, license_localmd5);
                if (isMatch) {

                    Map<String, String> licenseMap = new HashMap<String, String>();
                    //??
                    //                  String license_count = (String)props.get(LicenseManager.LICENSE_COUNT);
                    license_count = license_count == null ? "" : license_count;
                    licenseMap.put(LicenseManager.LICENSE_COUNT, license_count);

                    //?
                    //                  String license_date = (String)props.get(LicenseManager.LICENSE_DATE);
                    license_date = license_date == null ? "" : license_date;
                    licenseMap.put(LicenseManager.LICENSE_DATE, license_date);

                    //???
                    //                  String license_localmd5 = (String)props.get(LicenseManager.LICENSE_LOCALMD5);
                    license_localmd5 = license_localmd5 == null ? "" : license_localmd5;
                    licenseMap.put(LicenseManager.LICENSE_LOCALMD5, license_localmd5);

                    //?License
                    Map<String, String> resultMap = LicenseManager.licenseValidate(licenseMap);

                    String validateResult = resultMap.get(LicenseManager.LICENSE_VALIDATE_RESULT);
                    if (LicenseManager.LICENSE_VALID.equals(validateResult)) {
                        //continue
                    } else {
                        NotificationUtil.showWarningNotification(SystemLicence.this,
                                "License ?License");
                        return;
                    }

                    try {
                        URL resourceurl = SystemLicence.class.getResource(LicenseManager.LICENSE_FILE);
                        //System.err.println("chb: SystemLicense"+resourceurl.getPath());
                        OutputStream fos = new FileOutputStream(resourceurl.getPath());
                        props.store(fos, "license");
                    } catch (Exception e) {
                        e.printStackTrace();
                        NotificationUtil.showWarningNotification(SystemLicence.this, "License ");
                        return;
                    }
                    textAreaPlaceHolder.removeAllComponents();
                    buttonPlaceHolder.removeComponent(cancelButton);
                    updateButton.setData("show");
                    updateButton.setCaption("License");
                    LicenseManager.loadLicenseFile(LicenseManager.LICENSE_FILE.substring(1));
                    //                  LicenseManager.loadLicenseFile(licenseFilename)
                    refreshLicenseInfo();
                    NotificationUtil.showWarningNotification(SystemLicence.this,
                            "License ?,?");
                } else {
                    NotificationUtil.showWarningNotification(SystemLicence.this,
                            "License ??");
                }
            }
        }

        /**
         * license ?
         * @param license_date
         * @param license_count
         * @param license_localmd5
         * @return
         */
        private Boolean regexMatchCheck(String license_date, String license_count, String license_localmd5) {
            if (StringUtils.isEmpty(license_date) || StringUtils.isEmpty(license_count)
                    || StringUtils.isEmpty(license_localmd5)) {
                return false;
            }
            String date_regex = "^\\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2}$"; //?
            String count_regex = "^\\d+$"; //?
            String md5_32_regex = "^\\w{32}$"; //?
            return license_localmd5.matches(md5_32_regex) && license_date.matches(date_regex)
                    && license_count.matches(count_regex);
        }
    });

    return licenseUpdateLayout;
}

From source file:com.klwork.explorer.ui.task.TaskDetailPanel.java

License:Apache License

protected void initDescription(HorizontalLayout layout) {
    final CssLayout descriptionLayout = new CssLayout();
    descriptionLayout.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(descriptionLayout);
    layout.setExpandRatio(descriptionLayout, 1.0f);
    layout.setComponentAlignment(descriptionLayout, Alignment.MIDDLE_LEFT);

    String descriptionText = null;
    if (task.getDescription() != null && !"".equals(task.getDescription())) {
        descriptionText = task.getDescription();
    } else {//??
        descriptionText = i18nManager.getMessage(Messages.TASK_NO_DESCRIPTION);
    }/*from   www .j  a  v  a  2  s  .c  o  m*/
    final Label descriptionLabel = new Label(descriptionText);
    descriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
    descriptionLayout.addComponent(descriptionLabel);

    descriptionLayout.addLayoutClickListener(new LayoutClickListener() {
        public void layoutClick(LayoutClickEvent event) {
            if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
                // layout for textarea + ok button
                final VerticalLayout editLayout = new VerticalLayout();
                editLayout.setSpacing(true);

                // textarea
                final TextArea descriptionTextArea = new TextArea();
                //
                descriptionTextArea.setNullRepresentation("");
                descriptionTextArea.setWidth(100, Unit.PERCENTAGE);
                descriptionTextArea.setValue(task.getDescription());
                editLayout.addComponent(descriptionTextArea);

                // ok button
                Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
                editLayout.addComponent(okButton);
                editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);

                // replace
                descriptionLayout.replaceComponent(descriptionLabel, editLayout);

                // When OK is clicked -> update task data + ui
                okButton.addClickListener(new ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        // Update data
                        task.setDescription(descriptionTextArea.getValue().toString());
                        taskService.saveTask(task);

                        // Update UI
                        descriptionLabel.setValue(task.getDescription());
                        descriptionLayout.replaceComponent(editLayout, descriptionLabel);
                    }
                });
            }
        }
    });
}

From source file:com.kohmiho.mpsr.Form_1_2_1.java

@AutoGenerated
private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);//from w w  w  .ja  v a2  s .com
    mainLayout.setWidth("800px");
    mainLayout.setHeight("540px");

    // top-level component properties
    setWidth("800px");
    setHeight("540px");

    // labelPrototype
    labelPrototype = new Label();
    labelPrototype.setStyleName("prototype2");
    labelPrototype.setImmediate(false);
    labelPrototype.setWidth("-1px");
    labelPrototype.setHeight("-1px");
    labelPrototype.setValue("Label");
    mainLayout.addComponent(labelPrototype, "top:0.0px;right:29.0px;");

    // projLabel
    projLabel = new Label();
    projLabel.setImmediate(false);
    projLabel.setWidth("210px");
    projLabel.setHeight("-1px");
    projLabel.setValue("Project");
    mainLayout.addComponent(projLabel, "top:40.0px;left:0.0px;");

    // projStatus
    projStatus = new ComboBox();
    projStatus.setCaption("Current Status");
    projStatus.setImmediate(false);
    projStatus.setWidth("80px");
    projStatus.setHeight("24px");
    mainLayout.addComponent(projStatus, "top:40.0px;left:220.0px;");

    // projTrend
    projTrend = new ComboBox();
    projTrend.setCaption("Trend");
    projTrend.setImmediate(false);
    projTrend.setWidth("90px");
    projTrend.setHeight("24px");
    mainLayout.addComponent(projTrend, "top:40.0px;left:310.0px;");

    // projComment
    projComment = new TextArea();
    projComment.setCaption("Comments");
    projComment.setImmediate(false);
    projComment.setWidth("240px");
    projComment.setHeight("40px");
    mainLayout.addComponent(projComment, "top:40.0px;left:410.0px;");

    // projPercentComplete
    projPercentComplete = new PercentCompleteSlider();
    projPercentComplete.setCaption("% Completed");
    projPercentComplete.setImmediate(false);
    projPercentComplete.setWidth("120px");
    projPercentComplete.setHeight("40px");
    mainLayout.addComponent(projPercentComplete, "top:40.0px;left:660.0px;");

    // targetBudgetLabel
    targetBudgetLabel = new Label();
    targetBudgetLabel.setImmediate(false);
    targetBudgetLabel.setWidth("210px");
    targetBudgetLabel.setHeight("-1px");
    targetBudgetLabel.setValue("Target Budget");
    mainLayout.addComponent(targetBudgetLabel, "top:80.0px;left:0.0px;");

    // targetBudgetStatus
    targetBudgetStatus = new ComboBox();
    targetBudgetStatus.setImmediate(false);
    targetBudgetStatus.setWidth("80px");
    targetBudgetStatus.setHeight("24px");
    mainLayout.addComponent(targetBudgetStatus, "top:80.0px;left:220.0px;");

    // targetBudgetTrend
    targetBudgetTrend = new ComboBox();
    targetBudgetTrend.setImmediate(false);
    targetBudgetTrend.setWidth("90px");
    targetBudgetTrend.setHeight("24px");
    mainLayout.addComponent(targetBudgetTrend, "top:80.0px;left:310.0px;");

    // targetBudgetComment
    targetBudgetComment = new TextArea();
    targetBudgetComment.setImmediate(false);
    targetBudgetComment.setWidth("240px");
    targetBudgetComment.setHeight("40px");
    mainLayout.addComponent(targetBudgetComment, "top:80.0px;left:410.0px;");

    // targetBudgetPercentComplete
    targetBudgetPercentComplete = new PercentCompleteSlider();
    targetBudgetPercentComplete.setEnabled(false);
    targetBudgetPercentComplete.setImmediate(false);
    targetBudgetPercentComplete.setVisible(false);
    targetBudgetPercentComplete.setWidth("120px");
    targetBudgetPercentComplete.setHeight("40px");
    mainLayout.addComponent(targetBudgetPercentComplete, "top:80.0px;left:660.0px;");

    // safetyLabel
    safetyLabel = new Label();
    safetyLabel.setImmediate(false);
    safetyLabel.setWidth("210px");
    safetyLabel.setHeight("-1px");
    safetyLabel.setValue("Safety");
    mainLayout.addComponent(safetyLabel, "top:120.0px;left:0.0px;");

    // safetyStatus
    safetyStatus = new ComboBox();
    safetyStatus.setImmediate(false);
    safetyStatus.setWidth("80px");
    safetyStatus.setHeight("24px");
    mainLayout.addComponent(safetyStatus, "top:120.0px;left:220.0px;");

    // safetyTrend
    safetyTrend = new ComboBox();
    safetyTrend.setImmediate(false);
    safetyTrend.setWidth("90px");
    safetyTrend.setHeight("24px");
    mainLayout.addComponent(safetyTrend, "top:120.0px;left:310.0px;");

    // safetyComment
    safetyComment = new TextArea();
    safetyComment.setImmediate(false);
    safetyComment.setWidth("240px");
    safetyComment.setHeight("40px");
    mainLayout.addComponent(safetyComment, "top:120.0px;left:410.0px;");

    // safetyPercentComplete
    safetyPercentComplete = new PercentCompleteSlider();
    safetyPercentComplete.setImmediate(false);
    safetyPercentComplete.setWidth("120px");
    safetyPercentComplete.setHeight("40px");
    mainLayout.addComponent(safetyPercentComplete, "top:120.0px;left:660.0px;");

    // licenseLabel
    licenseLabel = new Label();
    licenseLabel.setImmediate(false);
    licenseLabel.setWidth("210px");
    licenseLabel.setHeight("-1px");
    licenseLabel.setValue("Licensing & Permitting");
    mainLayout.addComponent(licenseLabel, "top:160.0px;left:0.0px;");

    // licenseStatus
    licenseStatus = new ComboBox();
    licenseStatus.setImmediate(false);
    licenseStatus.setWidth("80px");
    licenseStatus.setHeight("24px");
    mainLayout.addComponent(licenseStatus, "top:160.0px;left:220.0px;");

    // licenseTrend
    licenseTrend = new ComboBox();
    licenseTrend.setImmediate(false);
    licenseTrend.setWidth("90px");
    licenseTrend.setHeight("24px");
    mainLayout.addComponent(licenseTrend, "top:160.0px;left:310.0px;");

    // licenseComment
    licenseComment = new TextArea();
    licenseComment.setImmediate(false);
    licenseComment.setWidth("240px");
    licenseComment.setHeight("40px");
    mainLayout.addComponent(licenseComment, "top:160.0px;left:410.0px;");

    // licensePercentComplete
    licensePercentComplete = new PercentCompleteSlider();
    licensePercentComplete.setImmediate(false);
    licensePercentComplete.setWidth("120px");
    licensePercentComplete.setHeight("40px");
    mainLayout.addComponent(licensePercentComplete, "top:160.0px;left:660.0px;");

    // corpLabel
    corpLabel = new Label();
    corpLabel.setImmediate(false);
    corpLabel.setWidth("210px");
    corpLabel.setHeight("-1px");
    corpLabel.setValue("Corporate Properties");
    mainLayout.addComponent(corpLabel, "top:200.0px;left:0.0px;");

    // corpStatus
    corpStatus = new ComboBox();
    corpStatus.setImmediate(false);
    corpStatus.setWidth("80px");
    corpStatus.setHeight("24px");
    mainLayout.addComponent(corpStatus, "top:200.0px;left:220.0px;");

    // corpTrend
    corpTrend = new ComboBox();
    corpTrend.setImmediate(false);
    corpTrend.setWidth("90px");
    corpTrend.setHeight("24px");
    mainLayout.addComponent(corpTrend, "top:200.0px;left:310.0px;");

    // corpComment
    corpComment = new TextArea();
    corpComment.setImmediate(false);
    corpComment.setWidth("240px");
    corpComment.setHeight("40px");
    mainLayout.addComponent(corpComment, "top:200.0px;left:410.0px;");

    // corpPercentComplete
    corpPercentComplete = new PercentCompleteSlider();
    corpPercentComplete.setImmediate(false);
    corpPercentComplete.setWidth("120px");
    corpPercentComplete.setHeight("40px");
    mainLayout.addComponent(corpPercentComplete, "top:200.0px;left:660.0px;");

    // ipdeLabel
    ipdeLabel = new Label();
    ipdeLabel.setImmediate(false);
    ipdeLabel.setWidth("210px");
    ipdeLabel.setHeight("-1px");
    ipdeLabel.setValue("Inside Plant Design & Engineering");
    mainLayout.addComponent(ipdeLabel, "top:240.0px;left:0.0px;");

    // ipdeStatus
    ipdeStatus = new ComboBox();
    ipdeStatus.setImmediate(false);
    ipdeStatus.setWidth("80px");
    ipdeStatus.setHeight("24px");
    mainLayout.addComponent(ipdeStatus, "top:240.0px;left:220.0px;");

    // ipdeTrend
    ipdeTrend = new ComboBox();
    ipdeTrend.setImmediate(false);
    ipdeTrend.setWidth("90px");
    ipdeTrend.setHeight("24px");
    mainLayout.addComponent(ipdeTrend, "top:240.0px;left:310.0px;");

    // ipdeComment
    ipdeComment = new TextArea();
    ipdeComment.setImmediate(false);
    ipdeComment.setWidth("240px");
    ipdeComment.setHeight("40px");
    mainLayout.addComponent(ipdeComment, "top:240.0px;left:410.0px;");

    // ipdePercentComplete
    ipdePercentComplete = new PercentCompleteSlider();
    ipdePercentComplete.setImmediate(false);
    ipdePercentComplete.setWidth("120px");
    ipdePercentComplete.setHeight("40px");
    mainLayout.addComponent(ipdePercentComplete, "top:240.0px;left:660.0px;");

    // outreachLabel
    outreachLabel = new Label();
    outreachLabel.setImmediate(false);
    outreachLabel.setWidth("210px");
    outreachLabel.setHeight("-1px");
    outreachLabel.setValue("Public Outreach");
    mainLayout.addComponent(outreachLabel, "top:280.0px;left:0.0px;");

    // outreachStatus
    outreachStatus = new ComboBox();
    outreachStatus.setImmediate(false);
    outreachStatus.setWidth("80px");
    outreachStatus.setHeight("24px");
    mainLayout.addComponent(outreachStatus, "top:280.0px;left:220.0px;");

    // outreachTrend
    outreachTrend = new ComboBox();
    outreachTrend.setImmediate(false);
    outreachTrend.setWidth("90px");
    outreachTrend.setHeight("24px");
    mainLayout.addComponent(outreachTrend, "top:280.0px;left:310.0px;");

    // outreachComment
    outreachComment = new TextArea();
    outreachComment.setImmediate(false);
    outreachComment.setWidth("240px");
    outreachComment.setHeight("40px");
    mainLayout.addComponent(outreachComment, "top:280.0px;left:410.0px;");

    // outreachPercentComplete
    outreachPercentComplete = new PercentCompleteSlider();
    outreachPercentComplete.setImmediate(false);
    outreachPercentComplete.setWidth("120px");
    outreachPercentComplete.setHeight("40px");
    mainLayout.addComponent(outreachPercentComplete, "top:280.0px;left:660.0px;");

    // procureLabel
    procureLabel = new Label();
    procureLabel.setImmediate(false);
    procureLabel.setWidth("210px");
    procureLabel.setHeight("-1px");
    procureLabel.setValue("Procurement");
    mainLayout.addComponent(procureLabel, "top:320.0px;left:0.0px;");

    // procureStatus
    procureStatus = new ComboBox();
    procureStatus.setImmediate(false);
    procureStatus.setWidth("80px");
    procureStatus.setHeight("24px");
    mainLayout.addComponent(procureStatus, "top:320.0px;left:220.0px;");

    // procureTrend
    procureTrend = new ComboBox();
    procureTrend.setImmediate(false);
    procureTrend.setWidth("90px");
    procureTrend.setHeight("24px");
    mainLayout.addComponent(procureTrend, "top:320.0px;left:310.0px;");

    // procureComment
    procureComment = new TextArea();
    procureComment.setImmediate(false);
    procureComment.setWidth("240px");
    procureComment.setHeight("40px");
    mainLayout.addComponent(procureComment, "top:320.0px;left:410.0px;");

    // procurePercentComplete
    procurePercentComplete = new PercentCompleteSlider();
    procurePercentComplete.setImmediate(false);
    procurePercentComplete.setWidth("120px");
    procurePercentComplete.setHeight("40px");
    mainLayout.addComponent(procurePercentComplete, "top:320.0px;left:660.0px;");

    // constructLabel
    constructLabel = new Label();
    constructLabel.setImmediate(false);
    constructLabel.setWidth("210px");
    constructLabel.setHeight("-1px");
    constructLabel.setValue("Construction");
    mainLayout.addComponent(constructLabel, "top:360.0px;left:0.0px;");

    // constructStatus
    constructStatus = new ComboBox();
    constructStatus.setImmediate(false);
    constructStatus.setWidth("80px");
    constructStatus.setHeight("24px");
    mainLayout.addComponent(constructStatus, "top:360.0px;left:220.0px;");

    // constructTrend
    constructTrend = new ComboBox();
    constructTrend.setImmediate(false);
    constructTrend.setWidth("90px");
    constructTrend.setHeight("24px");
    mainLayout.addComponent(constructTrend, "top:360.0px;left:310.0px;");

    // constructComment
    constructComment = new TextArea();
    constructComment.setImmediate(false);
    constructComment.setWidth("240px");
    constructComment.setHeight("40px");
    mainLayout.addComponent(constructComment, "top:360.0px;left:410.0px;");

    // constructPercentComplete
    constructPercentComplete = new PercentCompleteSlider();
    constructPercentComplete.setImmediate(false);
    constructPercentComplete.setWidth("120px");
    constructPercentComplete.setHeight("40px");
    mainLayout.addComponent(constructPercentComplete, "top:360.0px;left:660.0px;");

    // envLabel
    envLabel = new Label();
    envLabel.setImmediate(false);
    envLabel.setWidth("210px");
    envLabel.setHeight("-1px");
    envLabel.setValue("Environmental - Resource Recovery");
    mainLayout.addComponent(envLabel, "top:400.0px;left:0.0px;");

    // envStatus
    envStatus = new ComboBox();
    envStatus.setImmediate(false);
    envStatus.setWidth("80px");
    envStatus.setHeight("24px");
    mainLayout.addComponent(envStatus, "top:400.0px;left:220.0px;");

    // envTrend
    envTrend = new ComboBox();
    envTrend.setImmediate(false);
    envTrend.setWidth("90px");
    envTrend.setHeight("24px");
    mainLayout.addComponent(envTrend, "top:400.0px;left:310.0px;");

    // envComment
    envComment = new TextArea();
    envComment.setImmediate(false);
    envComment.setWidth("240px");
    envComment.setHeight("40px");
    mainLayout.addComponent(envComment, "top:400.0px;left:410.0px;");

    // envPercentComplete
    envPercentComplete = new PercentCompleteSlider();
    envPercentComplete.setImmediate(false);
    envPercentComplete.setWidth("120px");
    envPercentComplete.setHeight("40px");
    mainLayout.addComponent(envPercentComplete, "top:400.0px;left:660.0px;");

    // salvLabel
    salvLabel = new Label();
    salvLabel.setImmediate(false);
    salvLabel.setWidth("210px");
    salvLabel.setHeight("-1px");
    salvLabel.setValue("Salvage");
    mainLayout.addComponent(salvLabel, "top:440.0px;left:0.0px;");

    // salvStatus
    salvStatus = new ComboBox();
    salvStatus.setImmediate(false);
    salvStatus.setWidth("80px");
    salvStatus.setHeight("24px");
    mainLayout.addComponent(salvStatus, "top:440.0px;left:220.0px;");

    // salvTrend
    salvTrend = new ComboBox();
    salvTrend.setImmediate(false);
    salvTrend.setWidth("90px");
    salvTrend.setHeight("24px");
    mainLayout.addComponent(salvTrend, "top:440.0px;left:310.0px;");

    // salvComment
    salvComment = new TextArea();
    salvComment.setImmediate(false);
    salvComment.setWidth("240px");
    salvComment.setHeight("40px");
    mainLayout.addComponent(salvComment, "top:440.0px;left:410.0px;");

    // salvPercentComplete
    salvPercentComplete = new PercentCompleteSlider();
    salvPercentComplete.setImmediate(false);
    salvPercentComplete.setWidth("120px");
    salvPercentComplete.setHeight("40px");
    mainLayout.addComponent(salvPercentComplete, "top:440.0px;left:660.0px;");

    // withdrawLabel
    withdrawLabel = new Label();
    withdrawLabel.setImmediate(false);
    withdrawLabel.setWidth("210px");
    withdrawLabel.setHeight("-1px");
    withdrawLabel.setValue("Withdrawal");
    mainLayout.addComponent(withdrawLabel, "top:480.0px;left:0.0px;");

    // withdrawStatus
    withdrawStatus = new ComboBox();
    withdrawStatus.setImmediate(false);
    withdrawStatus.setWidth("80px");
    withdrawStatus.setHeight("24px");
    mainLayout.addComponent(withdrawStatus, "top:480.0px;left:220.0px;");

    // withdrawTrend
    withdrawTrend = new ComboBox();
    withdrawTrend.setImmediate(false);
    withdrawTrend.setWidth("90px");
    withdrawTrend.setHeight("24px");
    mainLayout.addComponent(withdrawTrend, "top:480.0px;left:310.0px;");

    // withdrawComment
    withdrawComment = new TextArea();
    withdrawComment.setImmediate(false);
    withdrawComment.setWidth("240px");
    withdrawComment.setHeight("40px");
    mainLayout.addComponent(withdrawComment, "top:480.0px;left:410.0px;");

    // withdrawPercentComplete
    withdrawPercentComplete = new PercentCompleteSlider();
    withdrawPercentComplete.setImmediate(false);
    withdrawPercentComplete.setWidth("120px");
    withdrawPercentComplete.setHeight("40px");
    mainLayout.addComponent(withdrawPercentComplete, "top:480.0px;left:660.0px;");

    return mainLayout;
}

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

public void createCustomMessage() {
    final TextArea textArea = new TextArea();
    textArea.setImmediate(true);//from   w ww .j  ava2 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.mycollab.mobile.module.crm.view.activity.AssignmentEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("startdate")) {
        return new DatePicker();
    } else if (propertyId.equals("duedate")) {
        return new DatePicker();
    } else if (propertyId.equals("status")) {
        return new TaskStatusListSelect();
    } else if (propertyId.equals("priority")) {
        return new TaskPriorityListSelect();
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea();
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("contactid")) {
        return new ContactSelectionField();
    } else if (propertyId.equals("subject")) {
        TextField tf = new TextField();

        if (isValidateForm) {
            tf.setRequired(true);/* w w  w  .j av a  2  s.c  om*/
            tf.setRequiredError("Subject must not be null");
            tf.setNullRepresentation("");
        }

        return tf;
    } else if (propertyId.equals("typeid")) {
        return new RelatedItemSelectionField(attachForm.getBean());
    } else if (propertyId.equals("type")) {
        return new DummyCustomField<String>();
    } else if (propertyId.equals("assignuser")) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    }
    return null;
}

From source file:com.mycollab.mobile.module.crm.view.activity.MeetingEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("subject")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);/* ww  w .java 2  s .  co m*/
            tf.setRequiredError("Subject must not be null");
        }

        return tf;
    } else if (propertyId.equals("status")) {
        return new MeetingStatusListSelect();
    } else if (propertyId.equals("startdate")) {
        return new DatePicker();
    } else if (propertyId.equals("enddate")) {
        return new DatePicker();
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea();
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("typeid")) {
        return new RelatedItemSelectionField(attachForm.getBean());
    } else if (propertyId.equals("type")) {
        return new DummyCustomField<String>();
    } else if (propertyId.equals("isrecurrence")) {
        return null;
    }
    return null;
}

From source file:com.mycollab.mobile.module.crm.view.campaign.CampaignEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {

    if ("type".equals(propertyId)) {
        CampaignTypeListSelect typeCombo = new CampaignTypeListSelect();
        typeCombo.setWidth("100%");
        return typeCombo;
    } else if ("status".equals(propertyId)) {
        CampaignStatusListSelect statusCombo = new CampaignStatusListSelect();
        statusCombo.setWidth("100%");
        return statusCombo;
    } else if ("campaignname".equals(propertyId)) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);/*  w  w w  .  j a  va2 s . c o m*/
            tf.setRequiredError("Name must not be null");
        }
        return tf;
    } else if ("description".equals(propertyId)) {
        TextArea descArea = new TextArea();
        descArea.setNullRepresentation("");
        return descArea;
    } else if ("assignuser".equals(propertyId)) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    } else if (propertyId.equals("currencyid")) {
        return new CurrencyComboBoxField();
    }
    return null;
}

From source file:com.mycollab.mobile.module.crm.view.contact.ContactEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("firstname") || propertyId.equals("prefix")) {
        return firstNamePrefixField;
    } else if (propertyId.equals("leadsource")) {
        return new LeadSourceListSelect();
    } else if (propertyId.equals("accountid")) {
        return new AccountSelectionField();
    } else if (propertyId.equals("lastname")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);/*from www .  java 2s  .c  om*/
            tf.setRequiredError("Last name must not be null");
        }
        return tf;
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea();
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("assignuser")) {
        ActiveUserComboBox userBox = new ActiveUserComboBox();
        userBox.select(attachForm.getBean().getAssignuser());
        return userBox;
    } else if (propertyId.equals("primcountry") || propertyId.equals("othercountry")) {
        return new CountryListSelect();
    } else if (propertyId.equals("birthday")) {
        return new BirthdayPickerField();
    }
    return null;
}

From source file:com.mycollab.mobile.module.crm.view.lead.LeadEditFormFieldFactory.java

License:Open Source License

@Override
protected Field<?> onCreateField(Object propertyId) {
    if (propertyId.equals("firstname") || propertyId.equals("prefixname")) {
        return firstNamePrefixField;
    } else if (propertyId.equals("primcountry") || propertyId.equals("othercountry")) {
        return new CountryListSelect();
    } else if (propertyId.equals("status")) {
        return new LeadStatusListSelect();
    } else if (propertyId.equals("industry")) {
        return new IndustryListSelect();
    } else if (propertyId.equals("assignuser")) {
        return new ActiveUserComboBox();
    } else if (propertyId.equals("source")) {
        return new LeadSourceListSelect();
    } else if (propertyId.equals("lastname")) {
        TextField tf = new TextField();
        if (isValidateForm) {
            tf.setNullRepresentation("");
            tf.setRequired(true);/*w ww. j ava2s .  co  m*/
            tf.setRequiredError("Last name must not be null");
        }

        return tf;
    } else if (propertyId.equals("description")) {
        TextArea descArea = new TextArea();
        descArea.setNullRepresentation("");
        return descArea;
    } else if (propertyId.equals("accountname")) {
        MTextField txtField = new MTextField();
        if (isValidateForm) {
            txtField.withNullRepresentation("").withRequired(true)
                    .withRequiredError(UserUIContext.getMessage(ErrorI18nEnum.FIELD_MUST_NOT_NULL,
                            UserUIContext.getMessage(AccountI18nEnum.FORM_ACCOUNT_NAME)));
        }

        return txtField;
    }

    return null;
}