1 18 19 package org.objectweb.jac.aspects.gui; 20 21 import java.util.HashSet ; 22 import java.util.Hashtable ; 23 import org.objectweb.jac.core.rtti.CollectionItem; 24 import org.objectweb.jac.core.rtti.FieldItem; 25 import org.objectweb.jac.core.rtti.MemberItem; 26 import org.objectweb.jac.core.rtti.RttiAC; 27 28 31 public class CollectionItemView extends MemberItemView { 32 public CollectionItemView(CollectionItem collection, String viewName) { 33 super(collection,viewName); 34 this.collection = collection; 35 } 36 37 CollectionItem collection; 38 CollectionItem getCollection() { 39 return collection; 40 } 41 42 MemberItem[] membersOrder; 43 public MemberItem[] getMembersOrder() { 44 return membersOrder; 45 } 46 public void setMembersOrder(MemberItem[] newMembersOrder) { 47 this.membersOrder = newMembersOrder; 48 } 49 50 CollectionItem multiLineCollection; 51 public CollectionItem getMultiLineCollection() { 52 return multiLineCollection; 53 } 54 public void setMultiLineCollection(CollectionItem newMultiLineCollection) { 55 this.multiLineCollection = newMultiLineCollection; 56 } 57 58 FieldItem groupBy; 59 public FieldItem getGroupBy() { 60 return groupBy; 61 } 62 public void setGroupBy(FieldItem newGroupBy) { 63 this.groupBy = newGroupBy; 64 } 65 66 boolean embeddedAdded; 67 public void setEmbeddedAdded(boolean embedded) { 68 this.embeddedAdded = embedded; 69 } 70 public boolean isEmbeddedAdded() { 71 return embeddedAdded; 72 } 73 74 HashSet embeddedEditorColumns = new HashSet (); 75 boolean embeddedEditors = false; 76 public void setEmbeddedEditors(boolean embeddedEditors) { 77 this.embeddedEditors = embeddedEditors; 78 } 79 public void addEmbeddedEditorColumn(MemberItem field) { 80 embeddedEditorColumns.add(field); 81 } 82 public boolean isEmbeddedEditors(MemberItem field) { 83 return embeddedEditors || embeddedEditorColumns.contains(field); 84 } 85 public boolean isEmbeddedEditors() { 86 return embeddedEditors; 87 } 88 89 boolean viewableItems = true; 90 public boolean isViewableItems() { 91 if (collection.isMap()) 92 return RttiAC.isIndex(collection) && viewableItems; 93 else 94 return viewableItems; 95 } 96 public void setViewableItems(boolean newViewableItems) { 97 this.viewableItems = newViewableItems; 98 } 99 100 boolean enableLinks = true; 101 public void setEnableLinks(boolean enable) { 102 this.enableLinks = enable; 103 } 104 public boolean areLinksEnabled() { 105 return enableLinks; 106 } 107 108 109 Hashtable viewTypes = new Hashtable (); 110 public void setViewType(MemberItem member, String viewType) { 111 viewTypes.put(member,viewType); 112 } 113 public String getViewType(MemberItem member) { 114 return (String )viewTypes.get(member); 115 } 116 117 FieldItem additionalRow; 118 public FieldItem getAdditionalRow() { 119 return additionalRow; 120 } 121 public void setAdditionalRow(FieldItem newAdditionalRow) { 122 this.additionalRow = newAdditionalRow; 123 } 124 } 125 126 | Popular Tags |