@AssistedInject public SubPanelPresenter( SubPanelFactory subPanelFactory, SubPanelViewFactory subPanelViewFactory, @Assisted @Nullable SubPanel parentPanel) { this.subPanelFactory = subPanelFactory; widgets = new ArrayList<>(); this.view = subPanelViewFactory.createView( new ClosePaneAction(this), new RemoveAllWidgetsInPaneAction(this), new SplitHorizontallyAction(this), new SplitVerticallyAction(this)); removingListeners = new HashMap<>(); view.setDelegate(this); if (parentPanel != null) { view.setParentPanel(parentPanel.getView()); } else { view.setParentPanel(null); } }