com.jrefinery.report.preview
Class PlainTextExportDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended bycom.jrefinery.report.preview.PlainTextExportDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class PlainTextExportDialog
extends javax.swing.JDialog

A dialog that is used to export reports to plain text.

Author:
Thomas Morgner.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String BASE_RESOURCE_CLASS
          The base resource class.
static java.lang.Integer CPI_10
          10 characters per inch.
static java.lang.Integer CPI_12
          12 characters per inch.
static java.lang.Integer CPI_15
          15 characters per inch.
static java.lang.Integer CPI_17
          17 characters per inch.
static java.lang.Integer CPI_20
          20 characters per inch.
static java.lang.Integer LPI_10
          10 lines per inch.
static java.lang.Integer LPI_6
          6 lines per inch.
static int TYPE_EPSON_OUTPUT
          Epson printer output.
static int TYPE_IBM_OUTPUT
          IBM printer output.
static int TYPE_PLAIN_OUTPUT
          Plain text output.
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PlainTextExportDialog()
          Creates a non-modal dialog without a title and without a specified Frame owner.
PlainTextExportDialog(java.awt.Dialog owner)
          Creates a non-modal dialog without a title with the specifed Dialog as its owner.
PlainTextExportDialog(java.awt.Frame owner)
          Creates a non-modal dialog without a title with the specifed Frame as its owner.
 
Method Summary
 void clear()
          clears all selections, input fields and set the selected encryption level to none.
 javax.swing.KeyStroke getAcceleratorKey()
          Returns the accelerator key.
 int getCharsPerInch()
          Returns the characters-per-inch setting.
 java.lang.String getDisplayName()
          Returns the display name for the action.
 java.lang.String getEncoding()
          Returns the encoding.
 java.lang.String getFilename()
          Returns the filename.
 javax.swing.Icon getLargeIcon()
          Returns the large icon for an action.
 int getLinesPerInch()
          Returns the lines-per-inch setting.
 java.lang.Integer getMnemonicKey()
          Returns the mnemonic key.
 int getSelectedPrinter()
          Returns the selected printer.
 java.lang.String getShortDescription()
          Returns the short description for the action.
 javax.swing.Icon getSmallIcon()
          Returns the small icon for the action.
 void initFromConfiguration(ReportConfiguration config)
          Initialises the CSV export dialog from the settings in the report configuration.
 boolean isAddToToolbar()
          Returns false.
 boolean isConfirmed()
          Gets the confirmation state of the dialog.
 boolean isSeparated()
          Returns false.
static void main(java.lang.String[] args)
          For debugging.
 boolean performExport(JFreeReport report)
          Exports a report to a text file.
protected  void performSelectFile()
          Selects a file to use as target for the report processing.
 boolean performValidate()
          Validates the contents of the dialog's input fields.
 void setCharsPerInch(int i)
          Sets the characters per inch.
protected  void setConfirmed(boolean confirmed)
          Defines whether this dialog has been finished using the 'OK' or the 'Cancel' option.
 void setEncoding(java.lang.String encoding)
          Sets the encoding.
 void setFilename(java.lang.String filename)
          Defines the filename of the file.
 void setLinesPerInch(int i)
          Sets the lines per inch.
 void setSelectedPrinter(int type)
          Sets the selected printer.
 boolean writeReport(JFreeReport report)
          Writes a report.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_PLAIN_OUTPUT

public static final int TYPE_PLAIN_OUTPUT
Plain text output.

See Also:
Constant Field Values

TYPE_EPSON_OUTPUT

public static final int TYPE_EPSON_OUTPUT
Epson printer output.

See Also:
Constant Field Values

TYPE_IBM_OUTPUT

public static final int TYPE_IBM_OUTPUT
IBM printer output.

See Also:
Constant Field Values

LPI_6

public static final java.lang.Integer LPI_6
6 lines per inch.


LPI_10

public static final java.lang.Integer LPI_10
10 lines per inch.


CPI_10

public static final java.lang.Integer CPI_10
10 characters per inch.


CPI_12

public static final java.lang.Integer CPI_12
12 characters per inch.


CPI_15

public static final java.lang.Integer CPI_15
15 characters per inch.


CPI_17

public static final java.lang.Integer CPI_17
17 characters per inch.


CPI_20

public static final java.lang.Integer CPI_20
20 characters per inch.


BASE_RESOURCE_CLASS

public static final java.lang.String BASE_RESOURCE_CLASS
The base resource class.

See Also:
Constant Field Values
Constructor Detail

PlainTextExportDialog

public PlainTextExportDialog()
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.


PlainTextExportDialog

public PlainTextExportDialog(java.awt.Frame owner)
Creates a non-modal dialog without a title with the specifed Frame as its owner.

Parameters:
owner - the Frame from which the dialog is displayed

PlainTextExportDialog

public PlainTextExportDialog(java.awt.Dialog owner)
Creates a non-modal dialog without a title with the specifed Dialog as its owner.

Parameters:
owner - the Dialog from which the dialog is displayed
Method Detail

setSelectedPrinter

public void setSelectedPrinter(int type)
Sets the selected printer.

Parameters:
type - the type.

getSelectedPrinter

public int getSelectedPrinter()
Returns the selected printer.

Returns:
The printer type.

getFilename

public java.lang.String getFilename()
Returns the filename.

Returns:
the name of the file where to save the file.

setFilename

public void setFilename(java.lang.String filename)
Defines the filename of the file.

Parameters:
filename - the filename of the file

isConfirmed

public boolean isConfirmed()
Gets the confirmation state of the dialog. A confirmed dialog has no invalid settings and the user confirmed any resource conflicts.

Returns:
true, if the dialog has been confirmed and the excel file should be saved, false otherwise.

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

clear

public void clear()
clears all selections, input fields and set the selected encryption level to none.


getLinesPerInch

public int getLinesPerInch()
Returns the lines-per-inch setting.

Returns:
The lines-per-inch setting.

setLinesPerInch

public void setLinesPerInch(int i)
Sets the lines per inch.

Parameters:
i - the lines per inch.

getCharsPerInch

public int getCharsPerInch()
Returns the characters-per-inch setting.

Returns:
The characters-per-inch setting.

setCharsPerInch

public void setCharsPerInch(int i)
Sets the characters per inch.

Parameters:
i - the characters per inch.

getEncoding

public java.lang.String getEncoding()
Returns the encoding.

Returns:
The encoding.

setEncoding

public void setEncoding(java.lang.String encoding)
Sets the encoding.

Parameters:
encoding - the encoding.

initFromConfiguration

public void initFromConfiguration(ReportConfiguration config)
Initialises the CSV export dialog from the settings in the report configuration.

Parameters:
config - the report configuration.

performExport

public boolean performExport(JFreeReport report)
Exports a report to a text file.

Parameters:
report - the report.
Returns:
A boolean.

writeReport

public boolean writeReport(JFreeReport report)
Writes a report.

Parameters:
report - the report.
Returns:
true, if the report was successfully written, false otherwise.

getDisplayName

public java.lang.String getDisplayName()
Returns the display name for the action.

Returns:
The display name.

getShortDescription

public java.lang.String getShortDescription()
Returns the short description for the action.

Returns:
The short description.

getSmallIcon

public javax.swing.Icon getSmallIcon()
Returns the small icon for the action.

Returns:
The icon.

getLargeIcon

public javax.swing.Icon getLargeIcon()
Returns the large icon for an action.

Returns:
The icon.

getAcceleratorKey

public javax.swing.KeyStroke getAcceleratorKey()
Returns the accelerator key.

Returns:
The accelerator key.

getMnemonicKey

public java.lang.Integer getMnemonicKey()
Returns the mnemonic key.

Returns:
The key code.

isSeparated

public boolean isSeparated()
Returns false.

Returns:
A boolean.

isAddToToolbar

public boolean isAddToToolbar()
Returns false.

Returns:
A boolean.

performSelectFile

protected void performSelectFile()
Selects a file to use as target for the report processing.


performValidate

public boolean performValidate()
Validates the contents of the dialog's input fields. If the selected file exists, it is also checked for validity.

Returns:
true, if the input is valid, false otherwise

main

public static void main(java.lang.String[] args)
For debugging.

Parameters:
args - ignored.