1 56 57 package org.objectstyle.cayenne.modeler.action; 58 59 import java.awt.event.ActionEvent ; 60 import java.awt.event.KeyEvent ; 61 62 import javax.swing.KeyStroke ; 63 64 import org.objectstyle.cayenne.modeler.Application; 65 import org.objectstyle.cayenne.project.Project; 66 67 70 public class SaveAction extends SaveAsAction { 71 72 public static String getActionName() { 73 return "Save"; 74 } 75 76 public SaveAction(Application application) { 77 super(getActionName(), application); 78 } 79 80 public KeyStroke getAcceleratorKey() { 81 return KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK); 82 } 83 84 public String getIconName() { 85 return "icon-save.gif"; 86 } 87 88 protected boolean chooseDestination(Project p) { 89 return (p.isLocationUndefined()) ? super.chooseDestination(p) : true; 90 } 91 } | Popular Tags |