/** * @param wizard The wizard * @param panelName The panel name to filter events from components * @param titleKey The key for the title section text * @param backgroundIcon The icon for the content section background */ public AbstractWizardPanelView( AbstractWizard<M> wizard, String panelName, MessageKey titleKey, AwesomeIcon backgroundIcon) { Preconditions.checkNotNull(wizard, "'wizard' must be present"); Preconditions.checkNotNull(titleKey, "'title' must be present"); this.wizardModel = wizard.getWizardModel(); this.panelName = panelName; // All wizard panel views can receive UI events CoreServices.uiEventBus.register(this); // All wizard screen panels are decorated with the same theme and // layout at creation so just need a simple panel to begin with wizardScreenPanel = Panels.newRoundedPanel(); // All wizard panels require a backing model newPanelModel(); // Create a new wizard panel and apply the wizard theme PanelDecorator.applyWizardTheme(wizardScreenPanel); // Add the title to the wizard JLabel title = Labels.newTitleLabel(titleKey); wizardScreenPanel.add( title, "span 4," + MultiBitUI.WIZARD_MAX_WIDTH_MIG + ",shrink,aligny top,align center,wrap"); // Provide a basic empty content panel (allows lazy initialisation later) contentPanel = Panels.newDetailBackgroundPanel(backgroundIcon); // Add it to the wizard panel as a placeholder wizardScreenPanel.add(contentPanel, "span 4,grow,push,wrap"); // Add the buttons to the wizard initialiseButtons(wizard); }
@Override protected void initialiseButtons(AbstractWizard<WelcomeWizardModel> wizard) { PanelDecorator.addFinish(this, wizard); }