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

Class AbstractExportDialog

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 6659 2008-12-02 15:35:06Z 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(Frame owner)
Creates a non-modal dialog without a title with the specified Frame as its owner.
AbstractExportDialog(Dialog owner)
Creates a non-modal dialog without a title with the specified Dialog as its owner.
Method Summary
abstract voidclear()
protected ActiongetCancelAction()
protected abstract StringgetConfigurationPrefix()
protected abstract StringgetConfigurationSuffix()
protected ActiongetConfirmAction()
protected FormValidatorgetFormValidator()
protected GuiContextgetGuiContext()
protected ReportJobgetReportJob()
protected abstract StringgetResourceBaseName()
protected ResourceBundlegetResources()
Retrieves the resources for this dialog.
abstract JStatusBargetStatusBar()
protected abstract ConfigurationgrabDialogContents(boolean full)
Returns a new (and not connected to the default config from the job) configuration containing all properties from the dialog.
protected abstract voidinitializeFromJob(ReportJob job, GuiContext guiContext)
booleanisConfirmed()
Returns true if the user confirmed the selection, and false otherwise.
protected booleanisFullInputStorageEnabled(Configuration config)
protected booleanisInputStorageEnabled(Configuration config)
protected booleanperformConfirm()
booleanperformQueryForExport(ReportJob reportJob, GuiContext guiContext)
Opens the dialog to query all necessary input from the user.
protected abstract booleanperformValidate()
protected FileresolvePath(String baseDirectory)
Resolves file names for the exports.
protected voidsetCancelAction(Action cancelAction)
protected voidsetConfirmAction(Action confirmAction)
protected voidsetConfirmed(boolean confirmed)
Defines whether this dialog has been finished using the 'OK' or the 'Cancel' option.
protected abstract voidsetDialogContents(Configuration properties)

Constructor Detail

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(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

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

Method Detail

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.

Parameters: reportJob the report that should be processed.

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.

Throws: IllegalArgumentException if the base directory is null.

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)