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