use of com.haulmont.cuba.gui.components.data.options.OptionsBinder in project cuba by cuba-platform.
the class AbstractComponentTestCase method setupGuiInfrastructure.
protected void setupGuiInfrastructure() {
this.valueBinder = new TestValueBinder(beanLocator, messageTools, metadata.getTools(), beanValidation, security);
this.optionsBinder = new OptionsBinder();
new Expectations() {
{
AppBeans.get(BackgroundWorker.NAME);
result = backgroundWorker;
minTimes = 0;
AppBeans.get(BackgroundWorker.class);
result = backgroundWorker;
minTimes = 0;
AppBeans.get(BackgroundWorker.NAME, BackgroundWorker.class);
result = backgroundWorker;
minTimes = 0;
applicationContext.getAutowireCapableBeanFactory();
result = beanFactory;
minTimes = 0;
beanFactory.autowireBean(any);
result = new Delegate() {
@SuppressWarnings("unused")
void autowireBean(java.lang.Object o) throws org.springframework.beans.BeansException {
autowireUiComponent((Component) o);
}
};
minTimes = 0;
userSessionSource.getLocale();
result = Locale.ENGLISH;
minTimes = 0;
beanLocator.get(MetadataTools.NAME);
result = metadata.getTools();
minTimes = 0;
beanLocator.get(ValueBinder.NAME);
result = valueBinder;
minTimes = 0;
beanLocator.get(ValueBinder.class);
result = valueBinder;
minTimes = 0;
beanLocator.get(ValueBinder.NAME, ValueBinder.class);
result = valueBinder;
minTimes = 0;
beanLocator.get(OptionsBinder.NAME);
result = optionsBinder;
minTimes = 0;
beanLocator.get(OptionsBinder.NAME, OptionsBinder.class);
result = optionsBinder;
minTimes = 0;
beanLocator.get(Configuration.NAME);
result = configuration;
minTimes = 0;
beanLocator.get(FormatStringsRegistry.NAME);
result = formatStringsRegistry;
minTimes = 0;
}
};
}
use of com.haulmont.cuba.gui.components.data.options.OptionsBinder in project cuba by cuba-platform.
the class WebLookupField method setOptions.
@Override
public void setOptions(Options<V> options) {
if (this.optionsBinding != null) {
this.optionsBinding.unbind();
this.optionsBinding = null;
}
if (options != null) {
OptionsBinder optionsBinder = beanLocator.get(OptionsBinder.NAME);
this.optionsBinding = optionsBinder.bind(options, this, this::setItemsToPresentation);
this.optionsBinding.activate();
}
}
use of com.haulmont.cuba.gui.components.data.options.OptionsBinder in project cuba by cuba-platform.
the class WebTwinColumn method setOptions.
@Override
public void setOptions(Options<V> options) {
if (this.optionsBinding != null) {
this.optionsBinding.unbind();
this.optionsBinding = null;
}
if (options != null) {
OptionsBinder optionsBinder = beanLocator.get(OptionsBinder.NAME);
this.optionsBinding = optionsBinder.bind(options, this, this::setItemsToPresentation);
this.optionsBinding.activate();
}
}
use of com.haulmont.cuba.gui.components.data.options.OptionsBinder in project cuba by cuba-platform.
the class WebSearchPickerField method setOptions.
@Override
public void setOptions(Options<V> options) {
if (this.optionsBinding != null) {
this.optionsBinding.unbind();
this.optionsBinding = null;
}
if (options != null) {
OptionsBinder optionsBinder = beanLocator.get(OptionsBinder.NAME);
this.optionsBinding = optionsBinder.bind(options, this, this::setItemsToPresentation);
this.optionsBinding.activate();
if (getMetaClass() == null && options instanceof EntityOptions) {
setMetaClass(((EntityOptions<V>) options).getEntityMetaClass());
}
}
}
use of com.haulmont.cuba.gui.components.data.options.OptionsBinder in project cuba by cuba-platform.
the class WebCheckBoxGroup method setOptions.
@Override
public void setOptions(Options<V> options) {
if (this.optionsBinding != null) {
this.optionsBinding.unbind();
this.optionsBinding = null;
}
if (options != null) {
OptionsBinder optionsBinder = beanLocator.get(OptionsBinder.NAME);
this.optionsBinding = optionsBinder.bind(options, this, this::setItemsToPresentation);
this.optionsBinding.activate();
}
}
Aggregations