1 56 package org.objectstyle.cayenne.modeler.action; 57 58 import javax.swing.Action ; 59 60 import org.objectstyle.cayenne.map.DataMap; 61 import org.objectstyle.cayenne.map.DbEntity; 62 import org.objectstyle.cayenne.map.DerivedDbEntity; 63 import org.objectstyle.cayenne.modeler.Application; 64 import org.objectstyle.cayenne.project.NamedObjectFactory; 65 66 69 public class CreateDerivedDbEntityAction extends CreateDbEntityAction { 70 71 public static String getActionName() { 72 return "Create Derived DbEntity"; 73 } 74 75 78 public CreateDerivedDbEntityAction(Application application) { 79 super(application); 80 super.setName(getActionName()); 81 super.putValue(Action.DEFAULT, getActionName()); 82 } 83 84 public String getIconName() { 85 return "icon-derived-dbentity.gif"; 86 } 87 88 92 protected DbEntity createEntity(DataMap map) { 93 DbEntity entity = 94 (DbEntity) NamedObjectFactory.createObject(DerivedDbEntity.class, map); 95 map.addDbEntity(entity); 96 return entity; 97 } 98 99 } 100 101 | Popular Tags |