1 13 package info.magnolia.cms.gui.controlx.list; 14 15 import info.magnolia.cms.gui.controlx.impl.AbstractControl; 16 17 import org.apache.commons.lang.StringUtils; 18 19 20 25 public class ListColumn extends AbstractControl { 26 27 30 public static final String RENDER_TYPE = "listColumn"; 31 32 35 private String columnName; 36 37 40 private String label; 41 42 45 private String width; 46 47 50 private boolean separator; 51 52 55 public ListColumn() { 56 this.setRenderType(RENDER_TYPE); 57 } 58 59 66 public ListColumn(String columnName, String label, String width, boolean separator) { 67 this(); 68 this.setName(columnName); 69 this.setColumnName(columnName); 70 this.setLabel(label); 71 this.setWidth(width); 72 this.setSeparator(separator); 73 } 74 75 79 public ListControl getListControl() { 80 return (ListControl) this.getParent(); 81 } 82 83 86 public String getLabel() { 87 if (this.label == null) { 88 return this.getName(); 89 } 90 return this.label; 91 } 92 93 96 public void setLabel(String label) { 97 this.label = label; 98 } 99 100 103 public boolean isSeparator() { 104 return this.separator; 105 } 106 107 110 public void setSeparator(boolean separator) { 111 this.separator = separator; 112 } 113 114 117 public String getWidth() { 118 return this.width; 119 } 120 121 124 public void setWidth(String width) { 125 this.width = width; 126 } 127 128 132 public Object getValue() { 133 return this.getListControl().getIteratorValue(this.getColumnName()); 134 } 135 136 139 public String getColumnName() { 140 if(this.columnName == null){ 141 return this.getName(); 142 } 143 return this.columnName; 144 } 145 146 149 public void setColumnName(String columnName) { 150 this.columnName = columnName; 151 } 152 153 } 154 | Popular Tags |