use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class DesktopWindow method removeAll.
@Override
public void removeAll() {
wrappers.clear();
getContainer().removeAll();
componentByIds.clear();
captions.clear();
List<Component> components = new ArrayList<>(ownComponents);
ownComponents.clear();
for (Component component : components) {
if (component instanceof DesktopAbstractComponent && !isEnabled()) {
((DesktopAbstractComponent) component).setParentEnabled(true);
}
if (expandedComponent == component) {
expandedComponent = null;
}
component.setParent(null);
DesktopContainerHelper.assignContainer(component, null);
}
requestRepaint();
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class DesktopAbstractBox method updateEnabled.
@Override
public void updateEnabled() {
super.updateEnabled();
boolean resultEnabled = isEnabledWithParent();
for (Component component : ownComponents) {
if (component instanceof DesktopAbstractComponent) {
((DesktopAbstractComponent) component).setParentEnabled(resultEnabled);
}
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class DesktopAbstractBox method removeAll.
@Override
public void removeAll() {
wrappers.clear();
impl.removeAll();
componentByIds.clear();
captions.clear();
List<Component> components = new ArrayList<>(ownComponents);
ownComponents.clear();
for (Component component : components) {
if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {
((DesktopAbstractComponent) component).setParentEnabled(true);
}
if (expandedComponent == component) {
expandedComponent = null;
}
component.setParent(null);
DesktopContainerHelper.assignContainer(component, null);
}
requestRepaint();
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class UserSwitchLinkHandlerProcessor method substituteUserAndOpenWindow.
protected void substituteUserAndOpenWindow(ExternalLinkContext linkContext, UUID userId) {
App app = linkContext.getApp();
UserSession userSession = app.getConnection().getSession();
assert userSession != null;
final User substitutedUser = loadUser(userId, userSession.getUser());
if (substitutedUser != null) {
app.getWindowManager().showOptionDialog(messages.getMainMessage("toSubstitutedUser.title"), getDialogMessage(substitutedUser), Frame.MessageType.CONFIRMATION_HTML, new Action[] { new ChangeSubstUserAction(substitutedUser) {
@Override
public void doAfterChangeUser() {
super.doAfterChangeUser();
screenHandler.handle(linkContext);
}
@Override
public void doRevert() {
super.doRevert();
JavaScript js = Page.getCurrent().getJavaScript();
js.execute("window.close();");
}
@Override
public String getCaption() {
return messages.getMainMessage("action.switch");
}
}, new DoNotChangeSubstUserAction() {
@Override
public void actionPerform(Component component) {
super.actionPerform(component);
JavaScript js = Page.getCurrent().getJavaScript();
js.execute("window.close();");
}
@Override
public String getCaption() {
return messages.getMainMessage("action.cancel");
}
} });
} else {
User user = loadUser(userId);
app.getWindowManager().showOptionDialog(messages.getMainMessage("warning.title"), getWarningMessage(user), Frame.MessageType.WARNING_HTML, new Action[] { new DialogAction(DialogAction.Type.OK).withHandler(event -> {
JavaScript js = Page.getCurrent().getJavaScript();
js.execute("window.close();");
}) });
}
}
use of com.haulmont.cuba.gui.components.Component in project cuba by cuba-platform.
the class WebScrollBoxLayout method removeAll.
@Override
public void removeAll() {
getContent().removeAllComponents();
Component[] components = ownComponents.toArray(new Component[ownComponents.size()]);
ownComponents.clear();
for (Component childComponent : components) {
childComponent.setParent(null);
}
}
Aggregations