1 13 package info.magnolia.cms.gui.controlx.list; 14 15 import info.magnolia.cms.gui.controlx.impl.TemplatedRenderer; 16 17 18 23 public class ListControlRenderer extends TemplatedRenderer { 24 25 28 public ListControlRenderer() { 29 super(); 30 } 31 32 36 public ListControlRenderer(String templateName) { 37 super(templateName); 38 } 39 40 46 public String nextSortByOrder(ListControl list, String field) { 47 if (list.getSortBy().equals(field)) { 48 if (list.getSortByOrder().equals("asc")) { 49 return "desc"; 50 } 51 } 52 return "asc"; 53 } 54 55 61 public String nextGroupByOrder(ListControl list, String field) { 62 if (list.getGroupBy().equals(field)) { 63 if (list.getGroupByOrder().equals("asc")) { 64 return "desc"; 65 } 66 } 67 return "asc"; 68 } 69 70 75 public String onSelect(ListControl list, Integer index) { 76 return ""; 77 } 78 79 84 public String onClick(ListControl list, Integer index) { 85 return ""; 86 } 87 88 93 public String onDblClick(ListControl list, Integer index) { 94 return ""; 95 } 96 97 102 public String onRightClick(ListControl list, Integer index) { 103 return ""; 104 } 105 106 112 public String getGroupLinkCSSClass(ListControl list, String field) { 113 if (list.getGroupBy().equals(field)) { 114 return "mgnlListSortGroupLink" + list.getGroupByOrder().toUpperCase(); 115 } 116 return "mgnlListSortGroupLink"; 117 } 118 119 125 public String getSortLinkCSSClass(ListControl list, String field) { 126 if (list.getSortBy().equals(field)) { 127 return "mgnlListSortGroupLink" + list.getSortByOrder().toUpperCase(); 128 } 129 return "mgnlListSortGroupLink"; 130 } 131 132 } 133 | Popular Tags |