@Test public void testActionPerformedWithInvalidConfig() { EditWizardReportAction reportActionSpy = spy( new EditWizardReportAction() ); reportActionSpy.actionPerformed( null ); verify( reportActionSpy, times( 1 ) ).getReportDesignerContext(); doReturn( reportDesignerContext ).when( reportActionSpy ).getReportDesignerContext(); reportActionSpy.actionPerformed( null ); }
public void actionPerformed( final ActionEvent e ) { final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext(); if ( reportDesignerContext1 == null ) { return; } final ReportDocumentContext activeContext = reportDesignerContext1.getActiveContext(); if ( activeContext == null ) { return; } final Component parent = reportDesignerContext1.getView().getParent(); final Window window = getWindowAncestor( parent ); final EmbeddedWizard dialog; dialog = createDialog( window, new ReportDesignerDesignTimeContext( reportDesignerContext1 ) ); try { final AbstractReportDefinition realOriginal = activeContext.getReportDefinition(); final AbstractReportDefinition original = (AbstractReportDefinition) realOriginal.derive(); final AbstractReportDefinition def = dialog.run( original ); if ( def == null ) { return; } if ( def instanceof MasterReport ) { reportDesignerContext1.addMasterReport( (MasterReport) def ); } else if ( def instanceof SubReport ) { final Section parentSection = getParentSection( realOriginal ); if ( parentSection instanceof AbstractRootLevelBand ) { final AbstractRootLevelBand rlb = (AbstractRootLevelBand) parentSection; final SubReport[] reports = rlb.getSubReports(); for ( int i = 0; i < reports.length; i++ ) { final SubReport report = reports[i]; if ( report == realOriginal ) { rlb.removeSubreport( report ); rlb.addSubReport( i, (SubReport) def ); return; } } } if ( parentSection instanceof Band ) { final Band b = (Band) parentSection; final Element[] elementArray = b.getElementArray(); for ( int i = 0; i < elementArray.length; i++ ) { final Element report = elementArray[i]; if ( report == realOriginal ) { b.removeElement( report ); b.addElement( i, def ); return; } } } } } catch ( ReportProcessingException e1 ) { UncaughtExceptionsModel.getInstance().addException( e1 ); } }
EditWizardReportAction extends AbstractReportContextAction { public void actionPerformed( final ActionEvent e ) { final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext(); if ( reportDesignerContext1 == null ) { return; } final ReportDocumentContext activeContext = reportDesignerContext1.getActiveContext(); if ( activeContext == null ) { return; } final Component parent = reportDesignerContext1.getView().getParent(); final Window window = getWindowAncestor( parent ); final EmbeddedWizard dialog; dialog = createDialog( window, new ReportDesignerDesignTimeContext( reportDesignerContext1 ) ); try { final AbstractReportDefinition realOriginal = activeContext.getReportDefinition(); final AbstractReportDefinition original = (AbstractReportDefinition) realOriginal.derive(); final AbstractReportDefinition def = dialog.run( original ); if ( def == null ) { return; } if ( def instanceof MasterReport ) { reportDesignerContext1.addMasterReport( (MasterReport) def ); } else if ( def instanceof SubReport ) { final Section parentSection = getParentSection( realOriginal ); if ( parentSection instanceof AbstractRootLevelBand ) { final AbstractRootLevelBand rlb = (AbstractRootLevelBand) parentSection; final SubReport[] reports = rlb.getSubReports(); for ( int i = 0; i < reports.length; i++ ) { final SubReport report = reports[i]; if ( report == realOriginal ) { rlb.removeSubreport( report ); rlb.addSubReport( i, (SubReport) def ); return; } } } if ( parentSection instanceof Band ) { final Band b = (Band) parentSection; final Element[] elementArray = b.getElementArray(); for ( int i = 0; i < elementArray.length; i++ ) { final Element report = elementArray[i]; if ( report == realOriginal ) { b.removeElement( report ); b.addElement( i, def ); return; } } } } } catch ( ReportProcessingException e1 ) { UncaughtExceptionsModel.getInstance().addException( e1 ); } } }
EditWizardReportAction extends AbstractReportContextAction { public void actionPerformed( final ActionEvent e ) { final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext(); if ( reportDesignerContext1 == null ) { return; } final ReportDocumentContext activeContext = reportDesignerContext1.getActiveContext(); if ( activeContext == null ) { return; } final Component parent = reportDesignerContext1.getView().getParent(); final Window window = getWindowAncestor( parent ); final EmbeddedWizard dialog; dialog = createDialog( window, new ReportDesignerDesignTimeContext( reportDesignerContext1 ) ); try { final AbstractReportDefinition realOriginal = activeContext.getReportDefinition(); final AbstractReportDefinition original = (AbstractReportDefinition) realOriginal.derive(); final AbstractReportDefinition def = dialog.run( original ); if ( def == null ) { return; } if ( def instanceof MasterReport ) { reportDesignerContext1.addMasterReport( (MasterReport) def ); } else if ( def instanceof SubReport ) { final Section parentSection = getParentSection( realOriginal ); if ( parentSection instanceof AbstractRootLevelBand ) { final AbstractRootLevelBand rlb = (AbstractRootLevelBand) parentSection; final SubReport[] reports = rlb.getSubReports(); for ( int i = 0; i < reports.length; i++ ) { final SubReport report = reports[i]; if ( report == realOriginal ) { rlb.removeSubreport( report ); rlb.addSubReport( i, (SubReport) def ); return; } } } if ( parentSection instanceof Band ) { final Band b = (Band) parentSection; final Element[] elementArray = b.getElementArray(); for ( int i = 0; i < elementArray.length; i++ ) { final Element report = elementArray[i]; if ( report == realOriginal ) { b.removeElement( report ); b.addElement( i, def ); return; } } } } } catch ( ReportProcessingException e1 ) { UncaughtExceptionsModel.getInstance().addException( e1 ); } } EditWizardReportAction(); }
EditWizardReportAction extends AbstractReportContextAction { public void actionPerformed( final ActionEvent e ) { final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext(); if ( reportDesignerContext1 == null ) { return; } final ReportDocumentContext activeContext = reportDesignerContext1.getActiveContext(); if ( activeContext == null ) { return; } final Component parent = reportDesignerContext1.getView().getParent(); final Window window = getWindowAncestor( parent ); final EmbeddedWizard dialog; dialog = createDialog( window, new ReportDesignerDesignTimeContext( reportDesignerContext1 ) ); try { final AbstractReportDefinition realOriginal = activeContext.getReportDefinition(); final AbstractReportDefinition original = (AbstractReportDefinition) realOriginal.derive(); final AbstractReportDefinition def = dialog.run( original ); if ( def == null ) { return; } if ( def instanceof MasterReport ) { reportDesignerContext1.addMasterReport( (MasterReport) def ); } else if ( def instanceof SubReport ) { final Section parentSection = getParentSection( realOriginal ); if ( parentSection instanceof AbstractRootLevelBand ) { final AbstractRootLevelBand rlb = (AbstractRootLevelBand) parentSection; final SubReport[] reports = rlb.getSubReports(); for ( int i = 0; i < reports.length; i++ ) { final SubReport report = reports[i]; if ( report == realOriginal ) { rlb.removeSubreport( report ); rlb.addSubReport( i, (SubReport) def ); return; } } } if ( parentSection instanceof Band ) { final Band b = (Band) parentSection; final Element[] elementArray = b.getElementArray(); for ( int i = 0; i < elementArray.length; i++ ) { final Element report = elementArray[i]; if ( report == realOriginal ) { b.removeElement( report ); b.addElement( i, def ); return; } } } } } catch ( ReportProcessingException e1 ) { UncaughtExceptionsModel.getInstance().addException( e1 ); } } EditWizardReportAction(); void actionPerformed( final ActionEvent e ); }
EditWizardReportAction extends AbstractReportContextAction { public void actionPerformed( final ActionEvent e ) { final ReportDesignerContext reportDesignerContext1 = getReportDesignerContext(); if ( reportDesignerContext1 == null ) { return; } final ReportDocumentContext activeContext = reportDesignerContext1.getActiveContext(); if ( activeContext == null ) { return; } final Component parent = reportDesignerContext1.getView().getParent(); final Window window = getWindowAncestor( parent ); final EmbeddedWizard dialog; dialog = createDialog( window, new ReportDesignerDesignTimeContext( reportDesignerContext1 ) ); try { final AbstractReportDefinition realOriginal = activeContext.getReportDefinition(); final AbstractReportDefinition original = (AbstractReportDefinition) realOriginal.derive(); final AbstractReportDefinition def = dialog.run( original ); if ( def == null ) { return; } if ( def instanceof MasterReport ) { reportDesignerContext1.addMasterReport( (MasterReport) def ); } else if ( def instanceof SubReport ) { final Section parentSection = getParentSection( realOriginal ); if ( parentSection instanceof AbstractRootLevelBand ) { final AbstractRootLevelBand rlb = (AbstractRootLevelBand) parentSection; final SubReport[] reports = rlb.getSubReports(); for ( int i = 0; i < reports.length; i++ ) { final SubReport report = reports[i]; if ( report == realOriginal ) { rlb.removeSubreport( report ); rlb.addSubReport( i, (SubReport) def ); return; } } } if ( parentSection instanceof Band ) { final Band b = (Band) parentSection; final Element[] elementArray = b.getElementArray(); for ( int i = 0; i < elementArray.length; i++ ) { final Element report = elementArray[i]; if ( report == realOriginal ) { b.removeElement( report ); b.addElement( i, def ); return; } } } } } catch ( ReportProcessingException e1 ) { UncaughtExceptionsModel.getInstance().addException( e1 ); } } EditWizardReportAction(); void actionPerformed( final ActionEvent e );  }