mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 11:17:40 +08:00
Support MapScreenOptions for ScreenDependencyInjector
This commit is contained in:
parent
6a34a9b640
commit
649d718d84
@ -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;
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user