Search in sources :

Example 1 with PaintException

use of com.vaadin.server.PaintException in project linkki by linkki-framework.

the class UISubsetChooserTest method createSubsetChooser.

/**
 * Returns a {@code SubsetChooser} that is bound to a {@link AnnotationTestPmo} using the
 * IPM data binder. The {@code SubsetChooser} is part of a mostly mocked UI so that a
 * rudimentary Vaadin environment is in place.
 *
 * @return a {@code SubsetChooser} that is bound to a {@link AnnotationTestPmo}
 */
private SubsetChooser createSubsetChooser(Object pmo) {
    try {
        SubsetChooser subsetChooser = (SubsetChooser) TestUiUtil.createFirstComponentOf(pmo);
        // initializes the internal itemIdMapper which is needed to
        // fake selection from UI using AbstractSelect#changeVariables(...)
        subsetChooser.paintContent(mock(PaintTarget.class));
        return subsetChooser;
    } catch (PaintException e) {
        throw new RuntimeException(e);
    }
}
Also used : PaintTarget(com.vaadin.server.PaintTarget) SubsetChooser(org.linkki.core.ui.components.SubsetChooser) PaintException(com.vaadin.server.PaintException)

Aggregations

PaintException (com.vaadin.server.PaintException)1 PaintTarget (com.vaadin.server.PaintTarget)1 SubsetChooser (org.linkki.core.ui.components.SubsetChooser)1