Search in sources :

Example 1 with WebComponentsFactory

use of com.haulmont.cuba.web.gui.WebComponentsFactory in project cuba by cuba-platform.

the class WebLookupFieldTest method initExpectations.

@Override
protected void initExpectations() {
    super.initExpectations();
    new NonStrictExpectations() {

        {
            vaadinSession.getLocale();
            result = Locale.ENGLISH;
            VaadinSession.getCurrent();
            result = vaadinSession;
            vaadinSession.getConverterFactory();
            result = new DefaultConverterFactory();
            globalConfig.getAvailableLocales();
            result = ImmutableMap.of("en", Locale.ENGLISH);
            AppContext.getProperty("cuba.mainMessagePack");
            result = "com.haulmont.cuba.web";
        }
    };
    factory = new WebComponentsFactory();
}
Also used : WebComponentsFactory(com.haulmont.cuba.web.gui.WebComponentsFactory) NonStrictExpectations(mockit.NonStrictExpectations) DefaultConverterFactory(com.vaadin.data.util.converter.DefaultConverterFactory)

Example 2 with WebComponentsFactory

use of com.haulmont.cuba.web.gui.WebComponentsFactory in project cuba by cuba-platform.

the class WebOptionsListTest method initExpectations.

@Override
protected void initExpectations() {
    super.initExpectations();
    new NonStrictExpectations() {

        {
            vaadinSession.getLocale();
            result = Locale.ENGLISH;
            VaadinSession.getCurrent();
            result = vaadinSession;
            vaadinSession.getConverterFactory();
            result = new DefaultConverterFactory();
            globalConfig.getAvailableLocales();
            result = ImmutableMap.of("en", Locale.ENGLISH);
            AppContext.getProperty("cuba.mainMessagePack");
            result = "com.haulmont.cuba.web";
        }
    };
    factory = new WebComponentsFactory();
}
Also used : WebComponentsFactory(com.haulmont.cuba.web.gui.WebComponentsFactory) NonStrictExpectations(mockit.NonStrictExpectations) DefaultConverterFactory(com.vaadin.data.util.converter.DefaultConverterFactory)

Example 3 with WebComponentsFactory

use of com.haulmont.cuba.web.gui.WebComponentsFactory in project cuba by cuba-platform.

the class WebTextFieldTest method initExpectations.

@Override
protected void initExpectations() {
    super.initExpectations();
    new NonStrictExpectations() {

        {
            vaadinSession.getLocale();
            result = Locale.ENGLISH;
            VaadinSession.getCurrent();
            result = vaadinSession;
            globalConfig.getAvailableLocales();
            result = ImmutableMap.of("en", Locale.ENGLISH);
            AppContext.getProperty("cuba.mainMessagePack");
            result = "com.haulmont.cuba.web";
        }
    };
    factory = new WebComponentsFactory();
}
Also used : WebComponentsFactory(com.haulmont.cuba.web.gui.WebComponentsFactory) NonStrictExpectations(mockit.NonStrictExpectations)

Example 4 with WebComponentsFactory

use of com.haulmont.cuba.web.gui.WebComponentsFactory in project cuba by cuba-platform.

the class WebDateFieldTest method initExpectations.

@Override
protected void initExpectations() {
    super.initExpectations();
    new NonStrictExpectations() {

        {
            vaadinSession.getLocale();
            result = Locale.ENGLISH;
            VaadinSession.getCurrent();
            result = vaadinSession;
            globalConfig.getAvailableLocales();
            result = ImmutableMap.of("en", Locale.ENGLISH);
            AppContext.getProperty("cuba.mainMessagePack");
            result = "com.haulmont.cuba.web";
        }
    };
    factory = new WebComponentsFactory();
}
Also used : WebComponentsFactory(com.haulmont.cuba.web.gui.WebComponentsFactory) NonStrictExpectations(mockit.NonStrictExpectations)

Example 5 with WebComponentsFactory

use of com.haulmont.cuba.web.gui.WebComponentsFactory in project cuba by cuba-platform.

the class WebFieldGroupTest method createComponentsFactory.

@Override
protected ComponentsFactory createComponentsFactory() {
    return new WebComponentsFactory() {

        @Override
        public List<ComponentGenerationStrategy> getComponentGenerationStrategies() {
            DefaultComponentGenerationStrategy strategy = new DefaultComponentGenerationStrategy(messages);
            strategy.setComponentsFactory(this);
            return Collections.singletonList(strategy);
        }
    };
}
Also used : DefaultComponentGenerationStrategy(com.haulmont.cuba.gui.components.DefaultComponentGenerationStrategy) ComponentGenerationStrategy(com.haulmont.cuba.gui.components.ComponentGenerationStrategy) WebComponentsFactory(com.haulmont.cuba.web.gui.WebComponentsFactory) DefaultComponentGenerationStrategy(com.haulmont.cuba.gui.components.DefaultComponentGenerationStrategy)

Aggregations

WebComponentsFactory (com.haulmont.cuba.web.gui.WebComponentsFactory)8 NonStrictExpectations (mockit.NonStrictExpectations)7 DefaultConverterFactory (com.vaadin.data.util.converter.DefaultConverterFactory)5 ComponentGenerationStrategy (com.haulmont.cuba.gui.components.ComponentGenerationStrategy)1 DefaultComponentGenerationStrategy (com.haulmont.cuba.gui.components.DefaultComponentGenerationStrategy)1