1 18 19 package org.objectweb.jac.ide.diagrams; 20 21 import CH.ifa.draw.framework.DrawingEditor; 22 import CH.ifa.draw.framework.Figure; 23 import org.objectweb.jac.aspects.gui.DisplayContext; 24 import org.objectweb.jac.aspects.gui.EventHandler; 25 import org.objectweb.jac.aspects.gui.InvokeEvent; 26 import org.objectweb.jac.core.rtti.ClassRepository; 27 28 public class FieldCreationTool extends AbstractActionTool { 29 30 public FieldCreationTool(DrawingEditor newDrawingEditor, 31 DisplayContext context) { 32 super(newDrawingEditor,context,ClassFigure.class); 33 } 34 35 public void action(Figure figure) { 36 EventHandler.get().onInvoke( 37 context, 38 new InvokeEvent( 39 null, 40 ((ClassFigure)figure).getSubstance(), 41 ClassRepository.get().getClass(org.objectweb.jac.ide.Class.class) 42 .getMethod("addField(org.objectweb.jac.ide.Field)"))); 43 } 44 45 } 46 47 | Popular Tags |