001package csheets.ext.database.ui;
002
003import java.awt.event.ActionEvent;
004
005import csheets.core.Cell;
006import csheets.ui.ctrl.*;
007
008/**
009 * Export submenu
010 * 
011 * @author João Carreira
012 */
013public class Export extends FocusOwnerAction 
014{
015
016    /* The user interface controller */
017    protected UIController uiController;
018
019    /**
020     * Export action
021     * @param uiController 
022     */
023    public Export(UIController uiController) 
024    {
025        this.uiController = uiController;
026    }
027
028    /**
029     * return name of the Export submenu
030     * @return 
031     */
032    @Override
033    protected String getName() 
034    {
035        return "Export to database";
036    }
037
038    /**
039     * 
040     */
041    @Override
042    protected void defineProperties() 
043    {
044    }
045
046    /**
047     * A simple action that presents a confirmation dialog. this method catch
048     * the selected cells and create the UIExport
049     * 
050     * @param event
051     *            the event that was fired
052     */
053    @Override
054    public void actionPerformed(ActionEvent event) 
055    {
056        /* select cells to export */
057        Cell [][]cells = focusOwner.getSelectedCells();
058        
059        try 
060        {
061                UIExport uiExp = new UIExport(cells);
062        } 
063        catch (Exception e2) 
064        {
065                e2.printStackTrace();
066        }
067    }
068}