Changeset 7908
- Timestamp:
- Feb 12, 2021, 10:52:20 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/list/AbstractListColumnBean.java
r7907 r7908 50 50 private String title; 51 51 private String subtitle; 52 private String cellClass; 53 private String cellStyle; 54 private boolean disableOverflowCheck; 52 55 private String tooltip; 53 56 private String property; … … 121 124 122 125 @Override 126 public String getCellClass() 127 { 128 return cellClass; 129 } 130 public void setCellClass(String cellClass) 131 { 132 this.cellClass = cellClass; 133 } 134 135 @Override 136 public String getCellStyle() 137 { 138 return cellStyle; 139 } 140 public void setCellStyle(String cellStyle) 141 { 142 this.cellStyle = cellStyle; 143 } 144 145 @Override 146 public boolean getDisableOverflowCheck() 147 { 148 return disableOverflowCheck; 149 } 150 public void setDisableOverflowCheck(boolean disableOverflowCheck) 151 { 152 this.disableOverflowCheck = disableOverflowCheck; 153 } 154 155 156 @Override 123 157 public String getTooltip() 124 158 { -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/list/ListColumnAction.java
r7907 r7908 79 79 80 80 /** 81 Optional extra classes to add to table cell (td) 82 tags for this column. 83 @since 3.18 84 */ 85 public default String getCellClass() 86 { 87 return null; 88 } 89 90 /** 91 Optional extra style definition to add to table cell (td) 92 tags for this column. 93 @since 3.18 94 */ 95 public default String getCellStyle() 96 { 97 return null; 98 } 99 100 /** 101 If set, text overflow check is disabled for this column. 102 If not set, the global settings for the logged in user is used. 103 @since 3.18 104 */ 105 public default boolean getDisableOverflowCheck() 106 { 107 return false; 108 } 109 110 /** 81 111 An optional tooltip that is displayed when the mouse is over the 82 112 column header. -
trunk/src/clients/web/net/sf/basedb/clients/web/extensions/list/PropertyPathActionFactory.java
r7907 r7908 70 70 private String title; 71 71 private String subtitle; 72 private String cellClass; 73 private String cellStyle; 74 private boolean disableOverflowCheck; 72 75 private String tooltip; 73 76 private String property; … … 133 136 action.setTitle(title); 134 137 action.setSubtitle(subtitle); 138 action.setCellClass(cellClass); 139 action.setCellStyle(cellStyle); 140 action.setDisableOverflowCheck(disableOverflowCheck); 135 141 action.setTooltip(tooltip); 136 142 action.setProperty(property); … … 181 187 this.subtitle = subtitle; 182 188 } 189 190 /** 191 @since 3.18 192 */ 193 public void setCellClass(String cellClass) 194 { 195 this.cellClass = cellClass; 196 } 197 198 /** 199 @since 3.18 200 */ 201 public void setCellStyle(String cellStyle) 202 { 203 this.cellStyle = cellStyle; 204 } 205 206 /** 207 @since 3.18 208 */ 209 public void setDisableOverflowCheck(boolean disableOverflowCheck) 210 { 211 this.disableOverflowCheck = disableOverflowCheck; 212 } 183 213 184 214 public void setTooltip(String tooltip) -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/Cell.java
r7703 r7908 40 40 <tbl:cell 41 41 clazz=... 42 subclass=... 42 43 errorclazz=... 43 44 style=... … … 142 143 143 144 /** 145 More classes. 146 @since 3.18 147 */ 148 private String subclass = null; 149 150 /** 144 151 Optional <code>class</code> attribute for errors. 145 152 */ … … 171 178 private boolean isHidden; 172 179 180 private boolean disableOverflowCheck = false; 173 181 private int maxCharacters = 50; 174 182 private boolean autoShow = true; … … 189 197 190 198 /** 199 @since 3.18 200 */ 201 public void setSubclass(String subclas) 202 { 203 this.subclass = subclas; 204 } 205 /** 206 @since 3.18 207 */ 208 public String getSubclass() 209 { 210 return subclass; 211 } 212 213 214 /** 191 215 @since 2.9.1 192 216 */ … … 243 267 { 244 268 return formatter; 269 } 270 271 /** 272 @since 3.18 273 */ 274 public void setDisableOverflowCheck(boolean disable) 275 { 276 this.disableOverflowCheck = disable; 245 277 } 246 278 … … 285 317 if (isHidden) return SKIP_BODY; 286 318 287 if (xtCells != null) value = xtCells.getCurrentValue( );319 if (xtCells != null) value = xtCells.getCurrentValue(this); 288 320 289 321 formatter = table.getFormatter(columnId); … … 303 335 content += formatter == null ? value.toString() : formatter.format(value); 304 336 } 305 boolean overflowed = maxCharacters > 0 && content.length() > maxCharacters &&337 boolean overflowed = !disableOverflowCheck && maxCharacters > 0 && content.length() > maxCharacters && 306 338 HTML.textLength(content) > maxCharacters; 307 339 308 340 StringBuilder sb = new StringBuilder(); 309 341 sb.append("\t<td"); 310 if (getClazz() != null) sb.append(" class=\"").append(getClazz()).append("\""); 342 if (getClazz() != null || getSubclass() != null) 343 { 344 sb.append(" class=\""); 345 if (getClass() != null) sb.append(getClazz()); 346 if (getSubclass() != null) sb.append(" ").append(getSubclass()); 347 sb.append("\""); 348 } 311 349 if (getStyle() != null) sb.append(" style=\"").append(getStyle()).append("\""); 312 350 if (getId() != null) sb.append(" id=\"").append(getId()).append("\""); -
trunk/src/clients/web/net/sf/basedb/clients/web/taglib/table/ExtensionCells.java
r7703 r7908 157 157 158 158 /** 159 Get the value for the current column and item. 159 Get the value for the current column and item and 160 update other settings for the cell. Note that it is 161 important that the current value is retrieved first. 162 This can give the action an opportunity to return different 163 values for the other settings depending on the current item. 160 164 */ 161 165 @SuppressWarnings("unchecked") 162 Object getCurrentValue( )166 Object getCurrentValue(Cell cell) 163 167 { 164 return current.getValue(dc, item); 168 Object value = current.getValue(dc, item); 169 cell.setSubclass(current.getCellClass()); 170 cell.setStyle(current.getCellStyle()); 171 cell.setDisableOverflowCheck(current.getDisableOverflowCheck()); 172 return value; 165 173 } 166 174 -
trunk/www/WEB-INF/table.tld
r7905 r7908 636 636 </attribute> 637 637 <attribute> 638 <name>subclass</name> 639 <rtexprvalue>true</rtexprvalue> 640 </attribute> 641 <attribute> 638 642 <name>errorclazz</name> 639 643 <rtexprvalue>true</rtexprvalue> … … 654 658 <attribute> 655 659 <name>value</name> 660 <rtexprvalue>true</rtexprvalue> 661 </attribute> 662 <attribute> 663 <name>disableOverflowCheck</name> 656 664 <rtexprvalue>true</rtexprvalue> 657 665 </attribute>
Note: See TracChangeset
for help on using the changeset viewer.