org.jfree.report.modules.gui.swing.common

Class AbstractExportDialog

Implemented Interfaces:
ExportDialog
Known Direct Subclasses:
HtmlFileExportDialog, HtmlZipExportDialog, PdfExportDialog

public abstract class AbstractExportDialog
extends JDialog
implements ExportDialog

======================================== JFreeReport : a free Java report library ======================================== Project Info: http://reporting.pentaho.org/ (C) Copyright 2000-2007, by Object Refinery Limited, Pentaho Corporation and Contributors. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. [Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries.] ------------ $Id: AbstractExportDialog.java 3525 2007-10-16 11:43:48Z tmorgner $ ------------ (C) Copyright 2000-2005, by Object Refinery Limited. (C) Copyright 2005-2007, by Pentaho Corporation.

Constructor Summary

AbstractExportDialog()
Creates a non-modal dialog without a title and without a specified Frame owner.
AbstractExportDialog(Dialog owner)
Creates a non-modal dialog without a title with the specified Dialog as its owner.
AbstractExportDialog(Frame owner)
Creates a non-modal dialog without a title with the specified Frame as its owner.

Method Summary

abstract void
clear()
protected Action
getCancelAction()
protected abstract String
getConfigurationPrefix()
protected abstract String
getConfigurationSuffix()
protected Action
getConfirmAction()
protected FormValidator
getFormValidator()
protected GuiContext
getGuiContext()
protected ReportJob
getReportJob()
protected abstract String
getResourceBaseName()
protected ResourceBundle
getResources()
Retrieves the resources for this dialog.
abstract JStatusBar
getStatusBar()
protected abstract Configuration
grabDialogContents(boolean full)
Returns a new (and not connected to the default config from the job) configuration containing all properties from the dialog.
protected abstract void
initializeFromJob(ReportJob job, GuiContext guiContext)
boolean
isConfirmed()
Returns true if the user confirmed the selection, and false otherwise.
protected boolean
isFullInputStorageEnabled(Configuration config)
protected boolean
isInputStorageEnabled(Configuration config)
protected boolean
performConfirm()
boolean
performQueryForExport(ReportJob reportJob, GuiContext guiContext)
Opens the dialog to query all necessary input from the user.
protected abstract boolean
performValidate()
protected File
resolvePath(String baseDirectory)
Resolves file names for the exports.
protected void
setCancelAction(Action cancelAction)
protected void
setConfirmAction(Action confirmAction)
protected void
setConfirmed(boolean confirmed)
Defines whether this dialog has been finished using the 'OK' or the 'Cancel' option.
protected abstract void
setDialogContents(Configuration properties)

Constructor Details

AbstractExportDialog

public AbstractExportDialog()
Creates a non-modal dialog without a title and without a specified Frame owner. A shared, hidden frame will be set as the owner of the dialog.

AbstractExportDialog

public AbstractExportDialog(Dialog owner)
Creates a non-modal dialog without a title with the specified Dialog as its owner.
Parameters:
owner - the non-null Dialog from which the dialog is displayed

AbstractExportDialog

public AbstractExportDialog(Frame owner)
Creates a non-modal dialog without a title with the specified Frame as its owner. If owner is null, a shared, hidden frame will be set as the owner of the dialog.
Parameters:
owner - the Frame from which the dialog is displayed

Method Details

clear

public abstract void clear()

getCancelAction

protected Action getCancelAction()

getConfigurationPrefix

protected abstract String getConfigurationPrefix()

getConfigurationSuffix

protected abstract String getConfigurationSuffix()

getConfirmAction

protected Action getConfirmAction()

getFormValidator

protected FormValidator getFormValidator()

getGuiContext

protected GuiContext getGuiContext()

getReportJob

protected ReportJob getReportJob()

getResourceBaseName

protected abstract String getResourceBaseName()

getResources

protected ResourceBundle getResources()
Retrieves the resources for this dialog. If the resources are not initialized, they get loaded on the first call to this method.
Returns:
this frames ResourceBundle.

getStatusBar

public abstract JStatusBar getStatusBar()

grabDialogContents

protected abstract Configuration grabDialogContents(boolean full)
Returns a new (and not connected to the default config from the job) configuration containing all properties from the dialog.
Parameters:
full -
Returns:

initializeFromJob

protected abstract void initializeFromJob(ReportJob job,
                                          GuiContext guiContext)

isConfirmed

public boolean isConfirmed()
Returns true if the user confirmed the selection, and false otherwise. The file should only be saved if the result is true.
Returns:
A boolean.

isFullInputStorageEnabled

protected boolean isFullInputStorageEnabled(Configuration config)

isInputStorageEnabled

protected boolean isInputStorageEnabled(Configuration config)

performConfirm

protected boolean performConfirm()

performQueryForExport

public boolean performQueryForExport(ReportJob reportJob,
                                     GuiContext guiContext)
Opens the dialog to query all necessary input from the user. This will not start the processing, as this is done elsewhere.
Specified by:
performQueryForExport in interface ExportDialog
Parameters:
Returns:
true, if the processing should continue, false otherwise.

performValidate

protected abstract boolean performValidate()

resolvePath

protected File resolvePath(String baseDirectory)
Resolves file names for the exports. An occurence of "~/" at the beginning of the name will be replaced with the users home directory.
Parameters:
baseDirectory - the base directory as specified in the configuration.
Returns:
the file object pointing to that directory.

setCancelAction

protected void setCancelAction(Action cancelAction)

setConfirmAction

protected void setConfirmAction(Action confirmAction)

setConfirmed

protected void setConfirmed(boolean confirmed)
Defines whether this dialog has been finished using the 'OK' or the 'Cancel' option.
Parameters:
confirmed - set to true, if OK was pressed, false otherwise

setDialogContents

protected abstract void setDialogContents(Configuration properties)