else
{
// there we verify that the screen to show is not already created and stored in the
// MainController screens map. If it is not , a new one is created.
final Screen toShow = DkMain.controller().getScreenInstance(clazz);
final SimpleContainer screenContainerPanel = DkMain.controller().getGui().getScreenContainerPanel();
if (currentScreen == null || screenContainerPanel.remove(currentScreen))
{
DkMain.controller().setCurrentScreen(null);
if (currentScreen != null)
{
BaseShowScreenAction.log.debug("[BaseShowScreenAction Screen {" + currentScreen.getClass().getName()
+ "} Closed]");
}
screenContainerPanel.add(toShow);
DkMain.controller().setPreviousScreen(currentScreen);
DkMain.controller().setCurrentScreen(toShow);
DkMain.controller().setScreenDisplayId(DkIdGenerator.generateRandomId(10));
DkMain.controller().onScreenBeforeShow(currentScreen, optionalArgs);
screenContainerPanel.forceLayout();
BaseShowScreenAction.log.debug("[BaseShowScreenAction Screen {" + toShow.getClass().getName()
+ "} Displayed (layout forced)]");
}
else
{