package com.vaadin.tests.components.select; import java.util.LinkedHashMap; import com.vaadin.ui.TwinColSelect; public class TwinColSelectTest extends AbstractSelectTestCase { private Command rowsCommand = new Command() { @Override public void execute(TwinColSelect c, Integer value, Object data) { c.setRows(value); } }; private Command colsCommand = new Command() { @Override public void execute(TwinColSelect c, Integer value, Object data) { c.setColumns(value); } }; private Command leftColumnCaptionCommand = new Command() { @Override public void execute(TwinColSelect c, String value, Object data) { c.setLeftColumnCaption(value); } }; private Command rightColumnCaptionCommand = new Command() { @Override public void execute(TwinColSelect c, String value, Object data) { c.setRightColumnCaption(value); } }; @Override protected Class getTestClass() { return TwinColSelect.class; } @Override protected void createActions() { super.createActions(); createRowsAction(CATEGORY_FEATURES); createColsAction(CATEGORY_FEATURES); createCaptionActions(CATEGORY_FEATURES); } private void createRowsAction(String category) { LinkedHashMap options = createIntegerOptions(20); createSelectAction("Rows", category, options, "0", rowsCommand); } private void createColsAction(String category) { LinkedHashMap options = createIntegerOptions(20); createSelectAction("Columns", category, options, "0", colsCommand); } private void createCaptionActions(String category) { createSelectAction("Left column caption", category, createCaptionOptions(), "-", leftColumnCaptionCommand); createSelectAction("Right column caption", category, createCaptionOptions(), "-", rightColumnCaptionCommand); } }