use of com.haulmont.cuba.gui.screen.event.ScreenClosedEvent in project cuba by cuba-platform.
the class WebScreens method remove.
@Override
public void remove(Screen screen) {
checkNotNullArgument(screen);
checkOpened(screen);
WindowImplementation windowImpl = (WindowImplementation) screen.getWindow();
if (windowImpl instanceof Disposable) {
((Disposable) windowImpl).dispose();
}
LaunchMode launchMode = windowImpl.getContext().getLaunchMode();
if (launchMode instanceof OpenMode) {
OpenMode openMode = (OpenMode) launchMode;
switch(openMode) {
case DIALOG:
removeDialogWindow(screen);
break;
case NEW_TAB:
case NEW_WINDOW:
removeNewTabWindow(screen);
break;
case ROOT:
removeRootWindow(screen);
break;
case THIS_TAB:
removeThisTabWindow(screen);
break;
default:
throw new UnsupportedOperationException("Unsupported OpenMode");
}
}
fireEvent(screen, AfterDetachEvent.class, new AfterDetachEvent(screen));
events.publish(new ScreenClosedEvent(screen));
afterScreenRemove(screen);
}
Aggregations