Support MapScreenOptions for ScreenDependencyInjector

This commit is contained in:
Yuriy Artamonov 2018-08-20 11:55:40 +04:00
parent 6a34a9b640
commit 649d718d84
2 changed files with 8 additions and 4 deletions

View File

@ -17,6 +17,7 @@
package com.haulmont.cuba.gui.screen;
import java.util.Collections;
import java.util.Map;
public class MapScreenOptions implements ScreenOptions {
@ -28,6 +29,9 @@ public class MapScreenOptions implements ScreenOptions {
}
public Map<String, Object> getParams() {
if (params == null) {
return Collections.emptyMap();
}
return params;
}
}

View File

@ -74,9 +74,6 @@ public class ScreenDependencyInjector {
protected Screen screen;
protected ScreenOptions options;
// todo get rif of legacy here
protected Map<String, Object> params;
protected BeanLocator beanLocator;
protected ScreenReflectionInspector screenReflectionInspector;
@ -284,8 +281,11 @@ public class ScreenDependencyInjector {
Window window = screen.getWindow();
if (annotationClass == WindowParam.class) {
if (options instanceof MapScreenOptions) {
return ((MapScreenOptions) options).getParams().get(name);
}
//Injecting a parameter
return params.get(name);
return null;
} else if (Component.class.isAssignableFrom(type)) {
// Injecting a UI component