Example usage for com.vaadin.ui ComboBox ComboBox

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

Introduction

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

Prototype

public ComboBox() 

Source Link

Document

Constructs an empty combo box without a caption.

Usage

From source file:com.jiangyifen.ec2.ui.csr.toolbar.CsrPhone2PhoneSettingWindow.java

/**
 *  (????)/*from   w ww  .j  a  va2 s .  c o  m*/
 * @param mainLayout
 */
private void createlDaysOfWeekType(VerticalLayout mainLayout) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    mainLayout.addComponent(layout);

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

    dayOfWeekTypeSelector = new ComboBox();
    dayOfWeekTypeSelector.addItem("weekday");
    dayOfWeekTypeSelector.setItemCaption("weekday", "");
    dayOfWeekTypeSelector.addItem("weekend");
    dayOfWeekTypeSelector.setItemCaption("weekend", "");
    dayOfWeekTypeSelector.addItem("custom");
    dayOfWeekTypeSelector.setItemCaption("custom", "");
    dayOfWeekTypeSelector.setWidth("200px");
    dayOfWeekTypeSelector.setImmediate(true);
    dayOfWeekTypeSelector.setReadOnly(true);
    dayOfWeekTypeSelector.setDescription("<B>?</B>");
    dayOfWeekTypeSelector.setNullSelectionAllowed(false);
    dayOfWeekTypeSelector.addListener(this);
    layout.addComponent(dayOfWeekTypeSelector);
}

From source file:com.jiangyifen.ec2.ui.csr.toolbar.CsrPhone2PhoneSettingWindow.java

/**
 * ? (18:00 - 23:59 )/* ww  w . ja v a  2  s  .  c o  m*/
 * @param mainLayout
 */
private void createRunRedirectTime(VerticalLayout mainLayout) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    mainLayout.addComponent(layout);

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

    startRedirectHour = new ComboBox();
    startRedirectHour.setImmediate(true);
    startRedirectHour.setWidth("50px");
    startRedirectHour.setNullSelectionAllowed(false);
    layout.addComponent(startRedirectHour);

    Label space1 = new Label(" ");
    space1.setWidth("-1px");
    layout.addComponent(space1);

    startRedirectMinute = new ComboBox();
    startRedirectMinute.setImmediate(true);
    startRedirectMinute.setWidth("50px");
    startRedirectMinute.setNullSelectionAllowed(false);
    layout.addComponent(startRedirectMinute);

    Label to = new Label(" - ");
    to.setWidth("-1px");
    layout.addComponent(to);

    stopRedirectHour = new ComboBox();
    stopRedirectHour.setImmediate(true);
    stopRedirectHour.setWidth("50px");
    stopRedirectHour.setNullSelectionAllowed(false);
    layout.addComponent(stopRedirectHour);

    Label space2 = new Label(" ");
    space2.setWidth("-1px");
    layout.addComponent(space2);

    stopRedirectMinute = new ComboBox();
    stopRedirectMinute.setImmediate(true);
    stopRedirectMinute.setWidth("50px");
    stopRedirectMinute.setNullSelectionAllowed(false);
    layout.addComponent(stopRedirectMinute);

    for (int hour = 0; hour < 24; hour++) {
        startRedirectHour.addItem(hour);
        stopRedirectHour.addItem(hour);
    }

    for (int minute = 0; minute < 60; minute++) {
        startRedirectMinute.addItem(minute);
        stopRedirectMinute.addItem(minute);
    }

    startRedirectHour.setValue(18);
    stopRedirectHour.setValue(23);
    startRedirectMinute.setValue(0);
    stopRedirectMinute.setValue(59);

    startRedirectHour.setReadOnly(true);
    startRedirectMinute.setReadOnly(true);
    stopRedirectHour.setReadOnly(true);
    stopRedirectMinute.setReadOnly(true);
}

From source file:com.jiangyifen.ec2.ui.csr.toolbar.CsrPhone2PhoneSettingWindow.java

/**
 * ?? /*from  w  ww .j av a  2 s  .  c om*/
 * @param mainLayout
 */
private void createNoanwserTimeout(VerticalLayout mainLayout) {
    noanswerLayout = new HorizontalLayout();
    noanswerLayout.setSpacing(true);
    noanswerLayout.setVisible(false);
    mainLayout.addComponent(noanswerLayout);

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

    noanswerTimeoutSelector = new ComboBox();
    noanswerTimeoutSelector.setImmediate(true);
    noanswerTimeoutSelector.setWidth("50px");
    noanswerTimeoutSelector.setNullSelectionAllowed(false);
    noanswerTimeoutSelector.setDescription(
            "<B>'?'??</B>");
    noanswerLayout.addComponent(noanswerTimeoutSelector);

    for (int seconds = 3; seconds < 61; seconds++) {
        noanswerTimeoutSelector.addItem(seconds);
    }
    noanswerTimeoutSelector.setValue(10);
    noanswerTimeoutSelector.setReadOnly(true);

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

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

/**
 * ?  /* w w w. j  a  va2s  .c om*/
 */
private void createQueueSelectComponents() {
    HorizontalLayout maintopLayout = new HorizontalLayout();
    maintopLayout.setSpacing(true);
    this.addComponent(maintopLayout);
    this.setComponentAlignment(maintopLayout, Alignment.MIDDLE_CENTER);

    Label caption = new Label("<B></B>", Label.CONTENT_XHTML);
    caption.setWidth("-1px");
    maintopLayout.addComponent(caption);

    queueSelector = new ComboBox();
    queueSelector.setNullSelectionAllowed(false);
    queueSelector.setImmediate(true);
    queueSelector.setContainerDataSource(queueContainer);
    queueSelector.setItemCaptionPropertyId("descriptionAndName");
    queueSelector.addListener(this);
    maintopLayout.addComponent(queueSelector);
}

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

/**
 *  (????)/*from w  w  w . ja  v  a 2s .c  om*/
 * @param panelContent
 */
private void createDaysOfWeekType(VerticalLayout panelContent) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    panelContent.addComponent(layout);

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

    dayOfWeekTypeSelector = new ComboBox();
    dayOfWeekTypeSelector.addItem("weekday");
    dayOfWeekTypeSelector.setItemCaption("weekday", "");
    dayOfWeekTypeSelector.addItem("weekend");
    dayOfWeekTypeSelector.setItemCaption("weekend", "");
    dayOfWeekTypeSelector.addItem("custom");
    dayOfWeekTypeSelector.setItemCaption("custom", "");
    dayOfWeekTypeSelector.setWidth("200px");
    dayOfWeekTypeSelector.setImmediate(true);
    dayOfWeekTypeSelector.setReadOnly(true);
    dayOfWeekTypeSelector.setDescription("<B>?</B>");
    dayOfWeekTypeSelector.setNullSelectionAllowed(false);
    dayOfWeekTypeSelector.addListener(this);
    layout.addComponent(dayOfWeekTypeSelector);
}

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

/**
 * ? (18:00 - 23:59 )/*from  ww  w . j av a2s.c  o  m*/
 * @param panelContent
 */
private void createRunRedirectTime(VerticalLayout panelContent) {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    panelContent.addComponent(layout);

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

    startRedirectHour = new ComboBox();
    startRedirectHour.setImmediate(true);
    startRedirectHour.setWidth("50px");
    startRedirectHour.setNullSelectionAllowed(false);
    layout.addComponent(startRedirectHour);

    Label space1 = new Label(" ");
    space1.setWidth("-1px");
    layout.addComponent(space1);

    startRedirectMinute = new ComboBox();
    startRedirectMinute.setImmediate(true);
    startRedirectMinute.setWidth("50px");
    startRedirectMinute.setNullSelectionAllowed(false);
    layout.addComponent(startRedirectMinute);

    Label to = new Label(" - ");
    to.setWidth("-1px");
    layout.addComponent(to);

    stopRedirectHour = new ComboBox();
    stopRedirectHour.setImmediate(true);
    stopRedirectHour.setWidth("50px");
    stopRedirectHour.setNullSelectionAllowed(false);
    layout.addComponent(stopRedirectHour);

    Label space2 = new Label(" ");
    space2.setWidth("-1px");
    layout.addComponent(space2);

    stopRedirectMinute = new ComboBox();
    stopRedirectMinute.setImmediate(true);
    stopRedirectMinute.setWidth("50px");
    stopRedirectMinute.setNullSelectionAllowed(false);
    layout.addComponent(stopRedirectMinute);

    for (int hour = 0; hour < 24; hour++) {
        startRedirectHour.addItem(hour);
        stopRedirectHour.addItem(hour);
    }

    for (int minute = 0; minute < 60; minute++) {
        startRedirectMinute.addItem(minute);
        stopRedirectMinute.addItem(minute);
    }

    startRedirectHour.setValue(18);
    stopRedirectHour.setValue(23);
    startRedirectMinute.setValue(0);
    stopRedirectMinute.setValue(59);

    startRedirectHour.setReadOnly(true);
    startRedirectMinute.setReadOnly(true);
    stopRedirectHour.setReadOnly(true);
    stopRedirectMinute.setReadOnly(true);
}

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

/**
 * ?? /*from   w ww  .  ja va 2s .  c  o m*/
 * @param panelContent
 */
private void createNoanwserTimeout(VerticalLayout panelContent) {
    noanswerLayout = new HorizontalLayout();
    noanswerLayout.setSpacing(true);
    noanswerLayout.setVisible(false);
    panelContent.addComponent(noanswerLayout);

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

    noanswerTimeoutSelector = new ComboBox();
    noanswerTimeoutSelector.setImmediate(true);
    noanswerTimeoutSelector.setWidth("50px");
    noanswerTimeoutSelector.setNullSelectionAllowed(false);
    noanswerTimeoutSelector.setDescription(
            "<B>'?'??</B>");
    noanswerLayout.addComponent(noanswerTimeoutSelector);

    for (int seconds = 3; seconds < 61; seconds++) {
        noanswerTimeoutSelector.addItem(seconds);
    }
    noanswerTimeoutSelector.setValue(10);
    noanswerTimeoutSelector.setReadOnly(true);

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

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);/* ww  w  .  ja v  a 2  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.liferay.mail.vaadin.Composer.java

License:Open Source License

private HorizontalLayout buildFromLayout() {

    // common part: create layout
    fromLayout = new HorizontalLayout();
    fromLayout.setSpacing(true);/*from   w w w  .  jav a2s.  co m*/

    Label fromLabel = new Label(Lang.get("from"));
    fromLabel.setSizeUndefined();
    fromLayout.addComponent(fromLabel);

    // from
    from = new ComboBox();
    from.setDescription(Lang.get("the-account-to-send-the-message-from"));
    from.setImmediate(true);
    from.setHeight("-1px");
    from.setWidth("100.0%");
    fromLayout.addComponent(from);
    fromLayout.setExpandRatio(from, 1.0f);

    return fromLayout;
}

From source file:com.lizardtech.expresszip.vaadin.FindLayersViewComponent.java

License:Apache License

public FindLayersViewComponent() {

    treeTable = new ExpressZipTreeTable();
    popupTable = new ExpressZipTreeTable();
    configureTable(treeTable);/*from w w w.  ja v  a  2s  .c om*/

    popupSelectionListener = new Property.ValueChangeListener() {
        private static final long serialVersionUID = 625365970493526725L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // the current popup selection
            Set<ExpressZipLayer> popupSelection = (Set<ExpressZipLayer>) event.getProperty().getValue();

            // get the tree's current selection
            HashSet<ExpressZipLayer> treeSelection = new HashSet<ExpressZipLayer>(
                    (Set<ExpressZipLayer>) treeTable.getValue());

            // remove all items in common with popup
            treeSelection.removeAll(popupTable.getItemIds());

            // set the treeTable selection to the union
            Set<ExpressZipLayer> unionSelection = new HashSet<ExpressZipLayer>();
            unionSelection.addAll(popupSelection);
            unionSelection.addAll(treeSelection);
            treeTable.setValue(unionSelection);
        }
    };
    popupTable.addListener(popupSelectionListener);

    treeTable.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 6236114836521221107L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            Set<ExpressZipLayer> highlightedLayers = (Set<ExpressZipLayer>) event.getProperty().getValue();
            for (FindLayersViewListener listener : listeners) {
                listener.layerHighlightedEvent(highlightedLayers);
            }

            // reset selection of popup table
            popupTable.removeListener(popupSelectionListener);

            // intersection of treeTable's selection and popupTable items
            Set<ExpressZipLayer> popupSelection = new HashSet<ExpressZipLayer>();
            popupSelection.addAll(highlightedLayers);
            popupSelection.retainAll(popupTable.getItemIds());
            popupTable.setValue(popupSelection);

            popupTable.addListener(popupSelectionListener);
        }
    });
    configureTable(popupTable);

    filter = new Filter(this);
    filterButtonListener = new FilterListeners();
    axisSelectedListener = new AxisSelected();
    listeners = new ArrayList<FindLayersViewListener>();
    btnNext = new ExpressZipButton("Next", Style.STEP);
    btnBack = new ExpressZipButton("Back", Style.STEP);

    btnAddFilter = new ExpressZipButton("Add Filter", Style.ACTION);
    btnAddFilter.addStyleName("filter-flow");

    hshFilterButtons = new HashMap<Button, FilterObject>();
    cssLayers = new CssLayout();

    basemapSelector = new ComboBox();
    basemapSelector.setWidth(100.0f, UNITS_PERCENTAGE);
    basemapSelector.setTextInputAllowed(false);
    basemapSelector.setImmediate(true);
    basemapSelector.setNullSelectionAllowed(false);
    basemapSelector.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = -7358667131762099215L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            ProjectedLayer l = (ProjectedLayer) basemapSelector.getValue();
            boolean enableCheckbox = false;
            if (l instanceof WebMapServiceLayer) {
                for (ExpressZipLayer local : mapModel.getLocalBaseLayers()) {
                    if (l.toString().equals(local.getName())) {
                        enableCheckbox = true;
                        break;
                    }
                }
            }
            includeBasemap.setEnabled(enableCheckbox);
            if (!enableCheckbox) {
                includeBasemap.setValue(false);
            }

            if (mapModel.getBaseLayerTerms(l) != null && !mapModel.getBaseLayerTermsAccepted(l)) {
                final Window modal = new Window("Terms of Use");
                modal.setModal(true);
                modal.setClosable(false);
                modal.setResizable(false);
                modal.getContent().setSizeUndefined(); // trick to size around content
                Button bOK = new ExpressZipButton("OK", Style.ACTION, new ClickListener() {
                    private static final long serialVersionUID = -2872178665349848542L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        ProjectedLayer l = (ProjectedLayer) basemapSelector.getValue();
                        mapModel.setBaseLayerTermsAccepted(l);
                        for (FindLayersViewListener listener : listeners)
                            listener.baseMapChanged(l);
                        ((ExpressZipWindow) getApplication().getMainWindow()).removeWindow(modal);
                    }
                });
                Button bCancel = new ExpressZipButton("Cancel", Style.ACTION, new ClickListener() {
                    private static final long serialVersionUID = -3044064554876422836L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        basemapSelector.select(mapModel.getBaseLayers().get(0));
                        ((ExpressZipWindow) getApplication().getMainWindow()).removeWindow(modal);
                    }
                });
                HorizontalLayout buttons = new HorizontalLayout();
                buttons.setSpacing(true);
                buttons.addComponent(bOK);
                buttons.addComponent(bCancel);
                Label termsText = new Label(mapModel.getBaseLayerTerms(l));
                termsText.setContentMode(Label.CONTENT_XHTML);
                VerticalLayout vlay = new VerticalLayout();
                vlay.addComponent(termsText);
                vlay.addComponent(buttons);
                vlay.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);
                vlay.setWidth(400, UNITS_PIXELS);
                modal.getContent().addComponent(vlay);
                ((ExpressZipWindow) getApplication().getMainWindow()).addWindow(modal);
            } else {
                for (FindLayersViewListener listener : listeners)
                    listener.baseMapChanged(l);
            }
        }
    });

    includeBasemap = new CheckBox();
    includeBasemap.setDescription("Include this basemap in the exported image.");
    includeBasemap.setWidth(64f, UNITS_PIXELS);

    HorizontalLayout basemapLayout = new HorizontalLayout();
    basemapLayout.setWidth(100f, UNITS_PERCENTAGE);

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

    Label step = new Label("Step 1: Select Layers");
    step.addStyleName("step");
    layout.addComponent(step);

    layout.addComponent(treeTable);
    layout.setSpacing(true);
    treeTable.setSizeFull();
    layout.setExpandRatio(treeTable, 1f);

    layout.addComponent(new Panel(BASEMAP, basemapLayout));
    basemapLayout.addComponent(basemapSelector);
    basemapLayout.setExpandRatio(basemapSelector, 1f);
    basemapLayout.addComponent(includeBasemap);

    layout.addComponent(cssLayers);
    cssLayers.addComponent(btnAddFilter);

    HorizontalLayout backSubmitLayout = new HorizontalLayout();
    backSubmitLayout.setWidth("100%");
    backSubmitLayout.addComponent(btnBack);
    backSubmitLayout.addComponent(btnNext);
    backSubmitLayout.setComponentAlignment(btnBack, Alignment.BOTTOM_LEFT);
    backSubmitLayout.setComponentAlignment(btnNext, Alignment.BOTTOM_RIGHT);

    VerticalLayout navLayout = new VerticalLayout();
    navLayout.addComponent(backSubmitLayout);
    navLayout.setSpacing(true);

    ThemeResource banner = new ThemeResource("img/ProgressBar1.png");
    navLayout.addComponent(new Embedded(null, banner));

    layout.addComponent(navLayout);
    layout.setComponentAlignment(navLayout, Alignment.BOTTOM_CENTER);

    btnNext.addListener(this);
    btnNext.setEnabled(false);
    btnBack.setEnabled(false); // always disabled
    btnAddFilter.addListener(this);

    layout.addStyleName("findlayers");
    setCompositionRoot(layout);
}