Save This Page
Home » openjdk-7 » net.sourceforge » jbird » swing » [javadoc | source]
net.sourceforge.jbird.swing
public class: SavableTableDialog [javadoc | source]
java.lang.Object
   java.awt.Component
      java.awt.Container
         java.awt.Window
            java.awt.Dialog
               javax.swing.JDialog
                  net.sourceforge.jbird.swing.JTableDialog
                     net.sourceforge.jbird.swing.SavableTableDialog

All Implemented Interfaces:
    HasGetTransferHandler, Accessible, RootPaneContainer, WindowConstants, MenuContainer, Serializable, ImageObserver

Direct Known Subclasses:
    ChecklistDialog, SpeciesTableDialog

An extension of JTableDialog that provides menus for saving the table as CSV or as an HTML document.

Because SavableTableDialog is supposed to be general and autonomous, IOExceptions that occur while saving tables as CSV files or HTML documents are handled in an unusual way. The exceptions are passed to a method called handleException. That method checks to see if an object listener has been registered. If so, the exception is passed to the listener. If not, the exception is printed. Developers can also override handleException.

Custom formatters for table column classes can be provided using the methods setCSVFormatters and setHTMLFormatters.

Field Summary
protected  JMenuBar menu_bar     
protected  JMenu file_menu     
protected  JMenuItem csv_item     
protected  JMenuItem html_item     
protected  JMenuItem close_item     
protected  String csv_file_name     
protected  String csv_delimiter     
protected  String html_file_name     
protected  String accept_text     
protected  ObjectListener exception_listener    If not null, IOExceptions are passed to this listener. 
protected  Map html_map    Map of ObjectFormatters to be used for writing html.
    since: J-Bird - 0.2.0
 
protected  Map csv_map    Map of ObjectFormatters to be used for writing csv.
    since: J-Bird - 0.2.0
 
Fields inherited from net.sourceforge.jbird.swing.JTableDialog:
scroller,  table,  nullify_on_close,  to_nullify
Fields inherited from javax.swing.JDialog:
rootPane,  rootPaneCheckingEnabled,  accessibleContext
Fields inherited from java.awt.Dialog:
resizable,  undecorated,  DEFAULT_MODALITY_TYPE,  modal,  modalityType,  modalDialogs,  blockedWindows,  title,  isInHide,  isInDispose
Fields inherited from java.awt.Window:
warningString,  icons,  systemSyncLWRequests,  syncLWRequests,  beforeFirstShow,  OPENED,  state,  ownedWindowList,  showWithParent,  modalBlocker,  modalExclusionType,  windowListener,  windowStateListener,  windowFocusListener,  inputContext,  isInShow,  isTrayIconWindow,  anchor
Fields inherited from java.awt.Container:
ncomponents,  component,  layoutMgr,  containerListener,  listeningChildren,  listeningBoundsChildren,  descendantsCount,  INCLUDE_SELF,  SEARCH_HEAVYWEIGHTS,  modalComp,  modalAppContext
Fields inherited from java.awt.Component:
TOP_ALIGNMENT,  CENTER_ALIGNMENT,  BOTTOM_ALIGNMENT,  RIGHT_ALIGNMENT,  LEFT_ALIGNMENT,  treeLock,  x,  y,  width,  height,  foreground,  background,  font,  peerFont,  cursor,  locale,  ignoreRepaint,  visible,  enabled,  valid,  dropTarget,  popups,  name,  nameExplicitlySet,  focusable,  isFocusTraversableOverridden,  focusTraversalKeys,  focusTraversalKeysEnabled,  minSize,  prefSize,  newEventsOnly,  eventMask,  changeSupport,  isPacked,  componentSerializedDataVersion,  accessibleContext,  componentListener,  focusListener,  keyListener,  mouseListener,  mouseMotionListener,  mouseWheelListener,  inputMethodListener,  hierarchyListener,  hierarchyBoundsListener,  parent,  peer,  orientation,  graphicsConfig,  bufferStrategy
Constructor:
 public SavableTableDialog(Frame owner) 
 public SavableTableDialog(Dialog owner) 
 public SavableTableDialog(Frame owner,
    JTable table) 
 public SavableTableDialog(Dialog owner,
    JTable table) 
 public SavableTableDialog(Frame owner,
    TableModel model) 
 public SavableTableDialog(Dialog owner,
    TableModel model) 
 public SavableTableDialog(Frame owner,
    JScrollPane scrollpane,
    JTable table) 
    Use for tables that are already in a JScrollPane. Pass table, too, so that it can be contacted for save operation.

    This constructor should work with JRCTables and either the JTable that describes the reference column or th the JTable that combines the body columns because those JTables share the same TableModel.

    since: J-Bird - 0.1.3
 public SavableTableDialog(Dialog owner,
    JScrollPane scrollpane,
    JTable table) 
    Use for tables that are already in a JScrollPane. Pass table, too, so that it can be contacted for save operation.

    This constructor should work with JRCTables and either the JTable that describes the reference column or th the JTable that combines the body columns because those JTables share the same TableModel.

    since: J-Bird - 0.3.0
Method from net.sourceforge.jbird.swing.SavableTableDialog Summary:
buildMenus,   getCSVFile,   getHTMLFile,   handleException,   nullify,   saveAsCSV,   saveAsHTML,   setCSVFile,   setCSVFormatters,   setCSVText,   setCloseText,   setExceptionListener,   setFileButton,   setHTMLFile,   setHTMLFormatters,   setHTMLText,   setMenuText
Methods from net.sourceforge.jbird.swing.JTableDialog:
center,   center,   getModel,   getTable,   isNullifyOnClose,   nullify,   nullifyThread,   setModel,   setNullifyOnClose,   setScrollerTable,   setTable,   setToNullify,   setupContent,   setupDefaultTable
Methods from javax.swing.JDialog:
addImpl,   createRootPane,   dialogInit,   getAccessibleContext,   getContentPane,   getDefaultCloseOperation,   getGlassPane,   getGraphics,   getJMenuBar,   getLayeredPane,   getRootPane,   getTransferHandler,   isDefaultLookAndFeelDecorated,   isRootPaneCheckingEnabled,   paramString,   processWindowEvent,   remove,   repaint,   setContentPane,   setDefaultCloseOperation,   setDefaultLookAndFeelDecorated,   setGlassPane,   setJMenuBar,   setLayeredPane,   setLayout,   setRootPane,   setRootPaneCheckingEnabled,   setTransferHandler,   update
Methods from java.awt.Dialog:
addNotify,   blockWindow,   blockWindows,   checkShouldBeBlocked,   constructComponentName,   doDispose,   getAccessibleContext,   getModalityType,   getTitle,   hide,   interruptBlocking,   isModal,   isModal_NoClientCode,   isResizable,   isUndecorated,   modalHide,   modalShow,   modalityPopped,   modalityPushed,   paramString,   setModal,   setModalityType,   setResizable,   setTitle,   setUndecorated,   setVisible,   shouldBlock,   show,   toBack,   unblockWindow
Methods from java.awt.Window:
addNotify,   addOwnedWindow,   addPropertyChangeListener,   addPropertyChangeListener,   addWindowFocusListener,   addWindowListener,   addWindowStateListener,   adjustDecendantsOnParent,   adjustListeningChildrenOnParent,   applyCompoundShape,   applyCurrentShape,   applyResourceBundle,   applyResourceBundle,   canContainFocusOwner,   clearMostRecentFocusOwnerOnHide,   closeSplashScreen,   connectOwnedWindow,   constructComponentName,   createBufferStrategy,   createBufferStrategy,   deliverMouseWheelToAncestor,   dispatchEventImpl,   dispatchMouseWheelToAncestor,   dispose,   disposeImpl,   doDispose,   eventEnabled,   getAccessibleContext,   getAllUnblockedWindows,   getAllWindows,   getBufferStrategy,   getContainer,   getDocumentRoot,   getFocusCycleRootAncestor,   getFocusOwner,   getFocusTraversalKeys,   getFocusableWindowState,   getGraphicsConfiguration,   getIconImages,   getInputContext,   getListeners,   getLocale,   getLocationOnWindow,   getModalBlocker,   getModalExclusionType,   getMostRecentFocusOwner,   getOwnedWindows,   getOwnedWindows_NoClientCode,   getOwner,   getOwner_NoClientCode,   getOwnerlessWindows,   getTemporaryLostComponent,   getToolkit,   getWarningString,   getWindowFocusListeners,   getWindowListeners,   getWindowStateListeners,   getWindows,   hide,   isActive,   isAlwaysOnTop,   isAlwaysOnTopSupported,   isAutoRequestFocus,   isFocusCycleRoot,   isFocusableWindow,   isFocused,   isLocationByPlatform,   isModalBlocked,   isModalExcluded,   isRecursivelyVisible,   isShowing,   mixOnReshaping,   pack,   postEvent,   postProcessKeyEvent,   postWindowEvent,   preProcessKeyEvent,   processEvent,   processWindowEvent,   processWindowFocusEvent,   processWindowStateEvent,   removeNotify,   removeOwnedWindow,   removeWindowFocusListener,   removeWindowListener,   removeWindowStateListener,   resetGC,   reshape,   setAlwaysOnTop,   setAutoRequestFocus,   setBounds,   setBounds,   setClientSize,   setCursor,   setFocusCycleRoot,   setFocusableWindowState,   setIconImage,   setIconImages,   setLocationByPlatform,   setLocationRelativeTo,   setMinimumSize,   setModalBlocked,   setModalExclusionType,   setSize,   setSize,   setTemporaryLostComponent,   setVisible,   show,   toBack,   toBack_NoClientCode,   toFront,   toFront_NoClientCode,   updateChildFocusableWindowState,   updateChildrenBlocking
Methods from java.awt.Container:
add,   add,   add,   add,   add,   addContainerListener,   addImpl,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   adjustDecendantsOnParent,   adjustDescendants,   adjustListeningChildren,   applyComponentOrientation,   areFocusTraversalKeysSet,   canContainFocusOwner,   checkGD,   clearCurrentFocusCycleRootOnHide,   clearMostRecentFocusOwnerOnHide,   containsFocus,   countComponents,   countHierarchyMembers,   createChildHierarchyEvents,   createHierarchyEvents,   decreaseComponentCount,   deliverEvent,   dispatchEventImpl,   dispatchEventToSelf,   doLayout,   eventEnabled,   findComponentAt,   findComponentAt,   findComponentAt,   findComponentAtImpl,   getAccessibleAt,   getAccessibleChild,   getAccessibleChildrenCount,   getAlignmentX,   getAlignmentY,   getComponent,   getComponentAt,   getComponentAt,   getComponentCount,   getComponentZOrder,   getComponents,   getComponents_NoClientCode,   getContainerListeners,   getDropTargetEventTarget,   getFocusTraversalKeys,   getFocusTraversalPolicy,   getHeavyweightContainer,   getInsets,   getLayout,   getListeners,   getMaximumSize,   getMinimumSize,   getMouseEventTarget,   getMousePosition,   getPreferredSize,   getTraversalRoot,   increaseComponentCount,   initializeFocusTraversalKeys,   insets,   invalidate,   invalidateTree,   isAncestorOf,   isFocusCycleRoot,   isFocusCycleRoot,   isFocusTraversalPolicyProvider,   isFocusTraversalPolicySet,   isSameOrAncestorOf,   layout,   lightweightPaint,   lightweightPrint,   list,   list,   locate,   minimumSize,   mixOnHiding,   mixOnReshaping,   mixOnShowing,   mixOnZOrderChanging,   numListening,   paint,   paintComponents,   paintHeavyweightComponents,   paramString,   postProcessKeyEvent,   postsOldMouseEvents,   preProcessKeyEvent,   preferredSize,   print,   printComponents,   printHeavyweightComponents,   processContainerEvent,   processEvent,   proxyEnableEvents,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   remove,   remove,   removeAll,   removeContainerListener,   removeNotify,   setComponentZOrder,   setFocusCycleRoot,   setFocusTraversalKeys,   setFocusTraversalPolicy,   setFocusTraversalPolicyProvider,   setFont,   setLayout,   transferFocusDownCycle,   update,   validate,   validateTree
Methods from java.awt.Component:
action,   add,   addComponentListener,   addFocusListener,   addHierarchyBoundsListener,   addHierarchyListener,   addInputMethodListener,   addKeyListener,   addMouseListener,   addMouseMotionListener,   addMouseWheelListener,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   applyComponentOrientation,   areFocusTraversalKeysSet,   bounds,   checkImage,   checkImage,   coalesceEvents,   contains,   contains,   createImage,   createImage,   createVolatileImage,   createVolatileImage,   deliverEvent,   disable,   disableEvents,   dispatchEvent,   dispatchEventImpl,   doLayout,   enable,   enable,   enableEvents,   enableInputMethods,   eventTypeEnabled,   findNextFocusComponent,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   generateName,   getAccessibleContext,   getAlignmentX,   getAlignmentY,   getBackground,   getBounds,   getBounds,   getColorModel,   getComponentAt,   getComponentAt,   getComponentListeners,   getComponentOrientation,   getCursor,   getDropTarget,   getFocusCycleRootAncestor,   getFocusListeners,   getFocusTraversalKeys,   getFocusTraversalKeysEnabled,   getFont,   getFontMetrics,   getForeground,   getGraphics,   getGraphicsConfiguration,   getGraphicsConfigurationImpl,   getHeight,   getHierarchyBoundsListeners,   getHierarchyListeners,   getIgnoreRepaint,   getInputContext,   getInputMethodListeners,   getInputMethodRequests,   getKeyListeners,   getListeners,   getLocale,   getLocation,   getLocation,   getLocationOnScreen,   getMaximumSize,   getMinimumSize,   getMouseListeners,   getMouseMotionListeners,   getMouseWheelListeners,   getName,   getParent,   getPeer,   getPreferredSize,   getPropertyChangeListeners,   getPropertyChangeListeners,   getSize,   getSize,   getToolkit,   getTreeLock,   getWidth,   getX,   getY,   gotFocus,   handleEvent,   hasFocus,   hide,   imageUpdate,   inside,   invalidate,   isBackgroundSet,   isCursorSet,   isDisplayable,   isDoubleBuffered,   isEnabled,   isFocusCycleRoot,   isFocusOwner,   isFocusTraversable,   isFocusable,   isFontSet,   isForegroundSet,   isLightweight,   isOpaque,   isShowing,   isValid,   isVisible,   keyDown,   keyUp,   layout,   list,   list,   list,   list,   list,   locate,   location,   lostFocus,   minimumSize,   mouseDown,   mouseDrag,   mouseEnter,   mouseExit,   mouseMove,   mouseUp,   move,   nextFocus,   paint,   paintAll,   paramString,   postEvent,   preferredSize,   prepareImage,   prepareImage,   print,   printAll,   processComponentEvent,   processEvent,   processFocusEvent,   processHierarchyBoundsEvent,   processHierarchyEvent,   processInputMethodEvent,   processKeyEvent,   processMouseEvent,   processMouseMotionEvent,   processMouseWheelEvent,   remove,   removeComponentListener,   removeFocusListener,   removeHierarchyBoundsListener,   removeHierarchyListener,   removeInputMethodListener,   removeKeyListener,   removeMouseListener,   removeMouseMotionListener,   removeMouseWheelListener,   removeNotify,   removePropertyChangeListener,   removePropertyChangeListener,   repaint,   repaint,   repaint,   repaint,   requestFocus,   requestFocus,   requestFocusInWindow,   requestFocusInWindow,   reshape,   resize,   resize,   setBackground,   setBounds,   setBounds,   setComponentOrientation,   setCursor,   setDropTarget,   setEnabled,   setFocusTraversalKeys,   setFocusTraversalKeysEnabled,   setFocusable,   setFont,   setForeground,   setIgnoreRepaint,   setLocale,   setLocation,   setLocation,   setName,   setPeer,   setSize,   setSize,   setVisible,   show,   show,   size,   toString,   transferFocus,   transferFocusBackward,   transferFocusUpCycle,   translateEvent,   update,   validate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.sourceforge.jbird.swing.SavableTableDialog Detail:
 protected final  void buildMenus() 
 public final String getCSVFile() 
    Return name of file to which table will be saved.
 public final String getHTMLFile() 
    Return name of file to which table will be saved.
 protected  void handleException(IOException e) 
 public  void nullify() 
    Set fields to null and invoke super. Called automatically when close icon pushed or close menu item chosen if nullify_on_close is true (see setNullifyOnClose). May also be closed manually.
 protected  void saveAsCSV() 
 protected  void saveAsHTML() 
 public final  void setCSVFile(String txt) 
    Set file that will appear in file chooser.
 public final  void setCSVFormatters(Map map) 
    Set custom formatters to be used for converting table entries into text suitable for inclusion in csv files. Keys in the map should be Class objects such as NoteNumber.class, and values should be objects that subclasses of ObjectFormatter.

    Necessary only if you are unhappy with default behavior.

 public final  void setCSVText(String txt) 
    Customize name of Save to CSV menu item.
 public final  void setCloseText(String txt) 
    Customize name of Close menu item.
 public final  void setExceptionListener(ObjectListener ol) 
    Supply a listener that will receive IOExceptions. If no listener is supplied or if a null value is supplied the default behavior is to print the exception and the traceback.
 public final  void setFileButton(String txt) 
    Customize label on Accept button of file chooser
 public final  void setHTMLFile(String txt) 
    Set file that will appear in file chooser.
 public final  void setHTMLFormatters(Map map) 
    Set custom formatters to be used for converting table entries into text suitable for inclusion in html. Keys in the map should be Class objects such as NoteNumber.class, and values should be objects that subclasses of ObjectFormatter.

    Necessary only if you are unhappy with default behavior.

 public final  void setHTMLText(String txt) 
    Customize name of Save to HTML menu item.
 public final  void setMenuText(String txt) 
    Customize name of File menu.