mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
Improve runtime attribute editor usability #PL-4815
This commit is contained in:
parent
4014484842
commit
61711a8187
@ -17,7 +17,6 @@ import com.haulmont.cuba.gui.config.WindowInfo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
@ -30,16 +29,15 @@ import static com.haulmont.bali.util.Preconditions.checkNotNullArgument;
|
||||
*/
|
||||
public class DesktopRelatedEntities extends DesktopPopupButton implements RelatedEntities {
|
||||
|
||||
@Inject
|
||||
protected ScreensHelper screensHelper;
|
||||
|
||||
protected ListComponent listComponent;
|
||||
protected WindowManager.OpenType openType = WindowManager.OpenType.THIS_TAB;
|
||||
protected Map<String, PropertyOption> propertyOptions = new HashMap<>();
|
||||
|
||||
protected String excludeRegex;
|
||||
protected ScreensHelper screensHelper;
|
||||
|
||||
public DesktopRelatedEntities() {
|
||||
screensHelper = AppBeans.get(ScreensHelper.NAME);
|
||||
Messages messages = AppBeans.get(Messages.NAME);
|
||||
setCaption(messages.getMainMessage("actions.Related"));
|
||||
}
|
||||
|
@ -39,8 +39,10 @@ public class WebRelatedEntities extends WebPopupButton implements RelatedEntitie
|
||||
protected Map<String, PropertyOption> propertyOptions = new HashMap<>();
|
||||
|
||||
protected String excludeRegex;
|
||||
protected ScreensHelper screensHelper;
|
||||
|
||||
public WebRelatedEntities() {
|
||||
screensHelper = AppBeans.get(ScreensHelper.NAME);
|
||||
Messages messages = AppBeans.get(Messages.NAME);
|
||||
setCaption(messages.getMainMessage("actions.Related"));
|
||||
}
|
||||
@ -137,7 +139,7 @@ public class WebRelatedEntities extends WebPopupButton implements RelatedEntitie
|
||||
// check if browse screen available
|
||||
PropertyOption propertyOption = propertyOptions.get(metaProperty.getName());
|
||||
|
||||
WindowInfo defaultScreen = AppBeans.get(ScreensHelper.class).getAvailableBrowseScreen(metaProperty.getRange().asClass());
|
||||
WindowInfo defaultScreen = screensHelper.getAvailableBrowseScreen(metaProperty.getRange().asClass());
|
||||
if (defaultScreen != null
|
||||
|| (propertyOption != null && StringUtils.isNotEmpty(propertyOption.getScreen()))) {
|
||||
RelatedAction relatedAction = new RelatedAction("related" + actionOrder.size(), listComponent, metaClass, metaProperty);
|
||||
|
@ -40,8 +40,10 @@ public class WebRelatedEntities extends WebPopupButton implements RelatedEntitie
|
||||
protected Map<String, PropertyOption> propertyOptions = new HashMap<>();
|
||||
|
||||
protected String excludeRegex;
|
||||
protected ScreensHelper screensHelper;
|
||||
|
||||
public WebRelatedEntities() {
|
||||
screensHelper = AppBeans.get(ScreensHelper.NAME);
|
||||
Messages messages = AppBeans.get(Messages.NAME);
|
||||
setCaption(messages.getMainMessage("actions.Related"));
|
||||
}
|
||||
@ -139,7 +141,7 @@ public class WebRelatedEntities extends WebPopupButton implements RelatedEntitie
|
||||
// check if browse screen available
|
||||
PropertyOption propertyOption = propertyOptions.get(metaProperty.getName());
|
||||
|
||||
WindowInfo defaultScreen = AppBeans.get(ScreensHelper.class).getAvailableBrowseScreen(metaProperty.getRange().asClass());
|
||||
WindowInfo defaultScreen = screensHelper.getAvailableBrowseScreen(metaProperty.getRange().asClass());
|
||||
if (defaultScreen != null
|
||||
|| (propertyOption != null && StringUtils.isNotEmpty(propertyOption.getScreen()))) {
|
||||
RelatedAction relatedAction = new RelatedAction("related" + actionOrder.size(), listComponent, metaClass, metaProperty);
|
||||
|
Loading…
Reference in New Issue
Block a user