Class BrolTableMouseAdapter

java.lang.Object
java.awt.event.MouseAdapter
be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, PropertyChangeListener, EventListener

public class BrolTableMouseAdapter extends MouseAdapter implements PropertyChangeListener
MouseAdapter to add a contextual menu on the broldev tables to allow features like exporting, ... Provided by the broldev.core.swing project.
Since:
1.0 (Jul 06, 2008), broldev.core.swing 0.0.1-SNAPSHOT dependency
Version:
1.1 (Feb 8 2009)
Author:
Steph GAUDRY
  • Constructor Details

    • BrolTableMouseAdapter

      public BrolTableMouseAdapter(org.jdesktop.swingx.JXTable table)
      Builds an instance and adds a minimum contextual menu to a table
      Parameters:
      table - JXTable to customize
    • BrolTableMouseAdapter

      public BrolTableMouseAdapter(org.jdesktop.swingx.JXTable table, JMenu menu)
      Builds an instance and adds a custom contextual menu to a table
      Parameters:
      table - JXTable to customize
      menu - menu to add to the table contextual menu. All parts of the new menu are moved into the existing menu. May start with a JXTitledSeparator to show specific actions.
    • BrolTableMouseAdapter

      public BrolTableMouseAdapter(org.jdesktop.swingx.JXTable table, JMenu menu, String exportDocumentTitle)
      Builds an instance and adds a custom contextual menu to a table
      Parameters:
      table - JXTable to customize
      menu - menu to add to the table contextual menu. All parts of the new menu are moved into the existing menu. May start with a JXTitledSeparator to show specific actions.
      exportDocumentTitle - String given to the export option dialog to purpose an output document title.
  • Method Details

    • addMenuComponents

      public void addMenuComponents(JMenu menu)
      Adds some features to the table default menu. All the MenuComponents will be added to the existing menu.
      Parameters:
      menu - JMenu containing the new components to add
      Since:
      1.1 (Feb 8, 2009)
    • addMenuComponents

      public void addMenuComponents(Component[] menuComponents)
      Adds some components to the table default menu.
      Parameters:
      menuComponents - new components to add
      Since:
      1.1 (Feb 8, 2009)
    • getMenu

      public JPopupMenu getMenu()
      Returns the contextual menu which may be the minimal menu, or custom
      Returns:
      the menu
      See Also:
      addMenuComponents(JMenu)
    • getExportAction

      public be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.ExportAction getExportAction()
      Returns an action to export table data
      Returns:
      the exportAction
    • setExportAction

      public void setExportAction(be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.ExportAction exportAction)
      Parameters:
      exportAction - the action to set
      See Also:
      getExportAction()
    • getPrintAction

      public be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.PrintAction getPrintAction()
      Returns an action to print table data
      Returns:
      the printAction
    • setPrintAction

      public void setPrintAction(be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.PrintAction printAction)
      Parameters:
      printAction - the printAction to set
    • getClearAction

      public be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.ClearAction getClearAction()
      Returns:
      the clearAction
    • setClearAction

      public void setClearAction(be.gaudry.swing.component.table.listeners.BrolTableMouseAdapter.ClearAction clearAction)
      Parameters:
      clearAction - the clearAction to set
    • getTitle

      public String getTitle()
      Returns:
      the title of the document to export
    • setTitle

      public void setTitle(String title)
      Parameters:
      title - the title of the document to export to set
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class MouseAdapter
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class MouseAdapter
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • setLanguage

      protected void setLanguage()