use of com.haulmont.cuba.gui.components.actions.RelatedAction in project cuba by cuba-platform.
the class DesktopRelatedEntities method addNavigationAction.
protected void addNavigationAction(MetaClass metaClass, MetaProperty metaProperty) {
// check if browse screen available
PropertyOption propertyOption = propertyOptions.get(metaProperty.getName());
WindowInfo defaultScreen = screensHelper.getDefaultBrowseScreen(metaProperty.getRange().asClass());
if (defaultScreen != null || (propertyOption != null && StringUtils.isNotEmpty(propertyOption.getScreen()))) {
RelatedAction relatedAction = RelatedAction.create("related" + actionList.size(), listComponent, metaClass, metaProperty);
relatedAction.setOpenType(openType);
if (defaultScreen != null) {
relatedAction.setScreen(defaultScreen.getId());
}
if (propertyOption != null) {
if (StringUtils.isNotEmpty(propertyOption.getCaption())) {
relatedAction.setCaption(propertyOption.getCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getFilterCaption())) {
relatedAction.setFilterCaption(propertyOption.getFilterCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getScreen())) {
relatedAction.setScreen(propertyOption.getScreen());
}
}
addAction(relatedAction);
}
}
use of com.haulmont.cuba.gui.components.actions.RelatedAction in project cuba by cuba-platform.
the class DesktopRelatedEntities method setOpenType.
@Override
public void setOpenType(WindowManager.OpenType openType) {
checkNotNullArgument(openType);
this.openType = openType;
for (Action action : getActions()) {
if (action instanceof RelatedAction) {
((RelatedAction) action).setOpenType(openType);
}
}
}
use of com.haulmont.cuba.gui.components.actions.RelatedAction in project cuba by cuba-platform.
the class WebRelatedEntities method addNavigationAction.
protected void addNavigationAction(MetaClass metaClass, MetaProperty metaProperty) {
// check if browse screen available
PropertyOption propertyOption = propertyOptions.get(metaProperty.getName());
WindowInfo defaultScreen = screensHelper.getDefaultBrowseScreen(metaProperty.getRange().asClass());
if (defaultScreen != null || (propertyOption != null && StringUtils.isNotEmpty(propertyOption.getScreen()))) {
RelatedAction relatedAction = RelatedAction.create("related" + actionOrder.size(), listComponent, metaClass, metaProperty);
relatedAction.setOpenType(openType);
if (defaultScreen != null) {
relatedAction.setScreen(defaultScreen.getId());
}
if (propertyOption != null) {
if (StringUtils.isNotEmpty(propertyOption.getCaption())) {
relatedAction.setCaption(propertyOption.getCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getFilterCaption())) {
relatedAction.setFilterCaption(propertyOption.getFilterCaption());
}
if (StringUtils.isNotEmpty(propertyOption.getScreen())) {
relatedAction.setScreen(propertyOption.getScreen());
}
}
addAction(relatedAction);
}
}
use of com.haulmont.cuba.gui.components.actions.RelatedAction in project cuba by cuba-platform.
the class WebRelatedEntities method setOpenType.
@Override
public void setOpenType(WindowManager.OpenType openType) {
checkNotNullArgument(openType);
this.openType = openType;
for (Action action : getActions()) {
if (action instanceof RelatedAction) {
((RelatedAction) action).setOpenType(openType);
}
}
}
Aggregations