Search in sources :

Example 1 with PreviewDialog

use of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog in project pentaho-platform by pentaho.

the class JFreeReportPreviewSwingComponent method performExport.

@Override
protected boolean performExport(final MasterReport report) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final boolean progressBar = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR, "true".equals(reportConfiguration.getConfigProperty(// $NON-NLS-1$
    JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY)));
    final boolean progressDialog = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG, "true".equals(reportConfiguration.getConfigProperty(// $NON-NLS-1$
    JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY)));
    reportConfiguration.setConfigProperty(JFreeReportPreviewSwingComponent.PROGRESS_DIALOG_ENABLED_KEY, String.valueOf(progressDialog));
    reportConfiguration.setConfigProperty(JFreeReportPreviewSwingComponent.PROGRESS_BAR_ENABLED_KEY, String.valueOf(progressBar));
    final PreviewDialog dialog = createDialog(report);
    final ReportController reportController = getReportController();
    if (reportController != null) {
        dialog.setReportController(reportController);
    }
    dialog.pack();
    if (dialog.getParent() != null) {
        RefineryUtilities.centerDialogInParent(dialog);
    } else {
        RefineryUtilities.centerFrameOnScreen(dialog);
    }
    dialog.setVisible(true);
    return true;
}
Also used : ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) ReportController(org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Example 2 with PreviewDialog

use of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog in project pentaho-platform by pentaho.

the class JFreeReportPreviewSwingComponent method createDialog.

private PreviewDialog createDialog(final MasterReport report) {
    final boolean modal = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_MODAL, true);
    if (isDefinedInput(AbstractJFreeReportComponent.REPORTSWING_PARENTDIALOG)) {
        final Object parent = getInputValue(AbstractJFreeReportComponent.REPORTSWING_PARENTDIALOG);
        if (parent instanceof Dialog) {
            return new PreviewDialog(report, (Dialog) parent, modal);
        } else if (parent instanceof Frame) {
            return new PreviewDialog(report, (Frame) parent, modal);
        }
    }
    final PreviewDialog previewDialog = new PreviewDialog(report);
    previewDialog.setModal(modal);
    return previewDialog;
}
Also used : Frame(java.awt.Frame) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog) Dialog(java.awt.Dialog) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Example 3 with PreviewDialog

use of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog in project pentaho-platform by pentaho.

the class JFreeReportComponent method createDialog.

private PreviewDialog createDialog(final MasterReport report) {
    final boolean modal = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_MODAL, true);
    if (isDefinedInput(AbstractJFreeReportComponent.REPORTSWING_PARENTDIALOG)) {
        final Object parent = getInputValue(AbstractJFreeReportComponent.REPORTSWING_PARENTDIALOG);
        if (parent instanceof Dialog) {
            return new PreviewDialog(report, (Dialog) parent, modal);
        } else if (parent instanceof Frame) {
            return new PreviewDialog(report, (Frame) parent, modal);
        }
    }
    final PreviewDialog previewDialog = new PreviewDialog(report);
    previewDialog.setModal(modal);
    return previewDialog;
}
Also used : Frame(java.awt.Frame) Dialog(java.awt.Dialog) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Example 4 with PreviewDialog

use of org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog in project pentaho-platform by pentaho.

the class JFreeReportComponent method writeSwingPreview.

protected boolean writeSwingPreview(final MasterReport report) {
    final ModifiableConfiguration reportConfiguration = report.getReportConfiguration();
    final boolean progressBar = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSBAR, // $NON-NLS-1$
    "true".equals(reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY)));
    final boolean progressDialog = getInputBooleanValue(AbstractJFreeReportComponent.REPORTSWING_PROGRESSDIALOG, // $NON-NLS-1$
    "true".equals(reportConfiguration.getConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY)));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_DIALOG_ENABLED_KEY, String.valueOf(progressDialog));
    reportConfiguration.setConfigProperty(JFreeReportComponent.PROGRESS_BAR_ENABLED_KEY, String.valueOf(progressBar));
    final PreviewDialog dialog = createDialog(report);
    final ReportController reportController = getReportController();
    if (reportController != null) {
        dialog.setReportController(reportController);
    }
    dialog.pack();
    if (dialog.getParent() != null) {
        RefineryUtilities.centerDialogInParent(dialog);
    } else {
        RefineryUtilities.centerFrameOnScreen(dialog);
    }
    dialog.setVisible(true);
    return true;
}
Also used : ModifiableConfiguration(org.pentaho.reporting.libraries.base.config.ModifiableConfiguration) ReportController(org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController) PreviewDialog(org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)

Aggregations

PreviewDialog (org.pentaho.reporting.engine.classic.core.modules.gui.base.PreviewDialog)4 Dialog (java.awt.Dialog)2 Frame (java.awt.Frame)2 ReportController (org.pentaho.reporting.engine.classic.core.modules.gui.base.ReportController)2 ModifiableConfiguration (org.pentaho.reporting.libraries.base.config.ModifiableConfiguration)2