use of io.jmix.ui.component.Frame in project jmix by jmix-framework.
the class StandardEditor method getEditedEntityContainer.
protected InstanceContainer<T> getEditedEntityContainer() {
EditedEntityContainer annotation = getClass().getAnnotation(EditedEntityContainer.class);
if (annotation == null || Strings.isNullOrEmpty(annotation.value())) {
throw new IllegalStateException(String.format("StandardEditor %s does not declare @EditedEntityContainer", getClass()));
}
String[] parts = annotation.value().split("\\.");
ScreenData screenData;
if (parts.length == 1) {
screenData = getScreenData();
} else {
Frame frame = getWindow();
for (int i = 0; i < parts.length - 1; i++) {
String part = parts[i];
Component component = frame.getComponent(part);
if (!(component instanceof Frame)) {
throw new IllegalStateException("Path to EditedEntityContainer must include frames only");
}
frame = (Frame) component;
}
screenData = UiControllerUtils.getScreenData(frame.getFrameOwner());
}
return screenData.getContainer(parts[parts.length - 1]);
}
use of io.jmix.ui.component.Frame in project jmix by jmix-framework.
the class AbstractCollectionDatasource method getLoggingTag.
protected String getLoggingTag(String prefix) {
String windowId = "";
if (dsContext != null) {
FrameContext windowContext = dsContext.getFrameContext();
if (windowContext != null) {
Frame frame = windowContext.getFrame();
if (frame != null) {
windowId = ComponentsHelper.getFullFrameId(windowContext.getFrame());
}
}
}
String tag = prefix + " " + id;
if (StringUtils.isNotBlank(windowId))
tag = windowId + "@" + id;
return tag;
}
use of io.jmix.ui.component.Frame in project jmix by jmix-framework.
the class ScreenFacetImpl method create.
@Override
public S create() {
Frame owner = getOwner();
if (owner == null) {
throw new IllegalStateException("Screen facet is not attached to Frame");
}
screen = createScreen(owner.getFrameOwner());
initScreenListeners(screen);
injectScreenProperties(screen, properties);
applyScreenConfigurer(screen);
return screen;
}
use of io.jmix.ui.component.Frame in project jmix by jmix-framework.
the class FilterDelegateImpl method isScreenSettingsEnabled.
protected boolean isScreenSettingsEnabled() {
Frame frame = filter.getFrame();
if (frame == null) {
return false;
}
if (frame.getFrameOwner() instanceof LegacyFrame) {
return true;
}
ScreenSettingsFacet settingsFacet = UiControllerUtils.getFacet(frame, ScreenSettingsFacet.class);
return settingsFacet != null;
}
use of io.jmix.ui.component.Frame in project jmix by jmix-framework.
the class CubaComponentsHelper method getFilterComponentPath.
public static String getFilterComponentPath(Filter filter) {
StringBuilder sb = new StringBuilder(filter.getId() != null ? filter.getId() : "filterWithoutId");
Frame frame = filter.getFrame();
while (frame != null) {
sb.insert(0, ".");
String s = frame.getId() != null ? frame.getId() : "frameWithoutId";
if (s.contains(".")) {
s = "[" + s + "]";
}
sb.insert(0, s);
if (frame instanceof Window) {
break;
}
frame = frame.getFrame();
}
return sb.toString();
}
Aggregations