1 18 19 package org.objectweb.jac.aspects.gui.swing; 20 21 import org.objectweb.jac.aspects.gui.*; 22 import org.objectweb.jac.core.rtti.CollectionItem; 23 import org.objectweb.jac.core.rtti.FieldItem; 24 import javax.swing.JList ; 25 26 29 public class CompactList extends AbstractView 30 implements CollectionUpdate 31 { 32 CollectionItem collection; 33 Object substance; 34 CollectionModel model; 35 36 JList list; 37 38 public CollectionModel getCollectionModel() { 39 return model; 40 } 41 42 public CompactList(ViewFactory factory, DisplayContext context, 43 CollectionItem collection, Object substance, 44 CollectionModel model) { 45 super(factory,context); 46 this.collection = collection; 47 this.substance = substance; 48 this.model = model; 49 50 list = new JList (); 51 list.setModel((ListModel)model); 52 add(list); 53 54 Utils.registerCollection(substance,collection,this); 55 } 56 57 public void close(boolean validate) { 58 closed = true; 59 model.close(); 60 } 61 62 protected void setNoRefresh(boolean norefresh) { 63 if (norefresh==false) { 64 repaint(); 65 } 66 } 67 68 public void setField(FieldItem field) { 69 collection = (CollectionItem)field; 70 } 71 72 public void setSubstance(Object substance) { 73 this.substance = substance; 74 } 75 76 public FieldItem getField() { 77 return collection; 78 } 79 80 public void setValue(Object value) { 81 } 82 83 public void updateModel(Object substance) { 84 } 85 86 88 public void onChange(Object substance, CollectionItem collection, 89 Object value, Object param) { 90 } 91 92 public void onAdd(Object substance, CollectionItem collection, Object value, 93 Object added, Object param) { 94 } 95 96 public void onRemove(Object substance, CollectionItem collection, Object value, 97 Object removed, Object param) { 98 } 99 100 } 101 | Popular Tags |