1 56 57 package org.objectstyle.cayenne.modeler.dialog.validator; 58 59 import javax.swing.JFrame ; 60 61 import org.objectstyle.cayenne.access.DataDomain; 62 import org.objectstyle.cayenne.access.DataNode; 63 import org.objectstyle.cayenne.modeler.ProjectController; 64 import org.objectstyle.cayenne.modeler.event.DataNodeDisplayEvent; 65 import org.objectstyle.cayenne.project.validator.ValidationInfo; 66 67 73 public class DataNodeErrorMsg extends ValidationDisplayHandler { 74 protected DataNode node; 75 76 80 public DataNodeErrorMsg(ValidationInfo result) { 81 super(result); 82 Object [] path = result.getPath().getPath(); 83 int len = path.length; 84 85 if (len >= 1) { 86 node = (DataNode) path[len - 1]; 87 } 88 89 if (len >= 2) { 90 domain = (DataDomain) path[len - 2]; 91 } 92 } 93 94 public void displayField(ProjectController mediator, JFrame frame) { 95 DataNodeDisplayEvent event; 96 event = new DataNodeDisplayEvent(frame, domain, node); 97 mediator.fireDataNodeDisplayEvent(event); 98 } 99 100 } | Popular Tags |