Spec-Zone .ru
спецификации, руководства, описания, API
|
001/* 002 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 004 * 005 * This code is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU General Public License version 2 only, as 007 * published by the Free Software Foundation. Oracle designates this 008 * particular file as subject to the "Classpath" exception as provided 009 * by Oracle in the LICENSE file that accompanied this code. 010 * 011 * This code is distributed in the hope that it will be useful, but WITHOUT 012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 014 * version 2 for more details (a copy is included in the LICENSE file that 015 * accompanied this code). 016 * 017 * You should have received a copy of the GNU General Public License version 018 * 2 along with this work; if not, write to the Free Software Foundation, 019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 020 * 021 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 022 * or visit www.oracle.com if you need additional information or have any 023 * questions. 024 */ 025 026package javafx.scene.control; 027 028/** 029Builder class for javafx.scene.control.TableColumn 030@see javafx.scene.control.TableColumn 031@deprecated This class is deprecated and will be removed in the next version 032*/ 033@javax.annotation.Generated("Generated by javafx.builder.processor.BuilderProcessor") 034@Deprecated 035public class TableColumnBuilder<S, T, B extends javafx.scene.control.TableColumnBuilder<S, T, B>> implements javafx.util.Builder<javafx.scene.control.TableColumn<S, T>> { 036 protected TableColumnBuilder() { 037 } 038 039 /** Creates a new instance of TableColumnBuilder. */ 040 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) 041 public static <S, T> javafx.scene.control.TableColumnBuilder<S, T, ?> create() { 042 return new javafx.scene.control.TableColumnBuilder(); 043 } 044 045 private int __set; 046 private void __set(int i) { 047 __set |= 1 << i; 048 } 049 public void applyTo(javafx.scene.control.TableColumn<S, T> x) { 050 int set = __set; 051 while (set != 0) { 052 int i = Integer.numberOfTrailingZeros(set); 053 set &= ~(1 << i); 054 switch (i) { 055 case 0: x.setCellFactory(this.cellFactory); break; 056 case 1: x.setCellValueFactory(this.cellValueFactory); break; 057 case 2: x.getColumns().addAll(this.columns); break; 058 case 3: x.setComparator(this.comparator); break; 059 case 4: x.setContextMenu(this.contextMenu); break; 060 case 5: x.setEditable(this.editable); break; 061 case 6: x.setGraphic(this.graphic); break; 062 case 7: x.setId(this.id); break; 063 case 8: x.setMaxWidth(this.maxWidth); break; 064 case 9: x.setMinWidth(this.minWidth); break; 065 case 10: x.setOnEditCancel(this.onEditCancel); break; 066 case 11: x.setOnEditCommit(this.onEditCommit); break; 067 case 12: x.setOnEditStart(this.onEditStart); break; 068 case 13: x.setPrefWidth(this.prefWidth); break; 069 case 14: x.setResizable(this.resizable); break; 070 case 15: x.setSortable(this.sortable); break; 071 case 16: x.setSortNode(this.sortNode); break; 072 case 17: x.setSortType(this.sortType); break; 073 case 18: x.setStyle(this.style); break; 074 case 19: x.getStyleClass().addAll(this.styleClass); break; 075 case 20: x.setText(this.text); break; 076 case 21: x.setUserData(this.userData); break; 077 case 22: x.setVisible(this.visible); break; 078 } 079 } 080 } 081 082 private javafx.util.Callback<javafx.scene.control.TableColumn<S,T>,javafx.scene.control.TableCell<S,T>> cellFactory; 083 /** 084 Set the value of the {@link javafx.scene.control.TableColumn#getCellFactory() cellFactory} property for the instance constructed by this builder. 085 */ 086 @SuppressWarnings("unchecked") 087 public B cellFactory(javafx.util.Callback<javafx.scene.control.TableColumn<S,T>,javafx.scene.control.TableCell<S,T>> x) { 088 this.cellFactory = x; 089 __set(0); 090 return (B) this; 091 } 092 093 private javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S,T>,javafx.beans.value.ObservableValue<T>> cellValueFactory; 094 /** 095 Set the value of the {@link javafx.scene.control.TableColumn#getCellValueFactory() cellValueFactory} property for the instance constructed by this builder. 096 */ 097 @SuppressWarnings("unchecked") 098 public B cellValueFactory(javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S,T>,javafx.beans.value.ObservableValue<T>> x) { 099 this.cellValueFactory = x; 100 __set(1); 101 return (B) this; 102 } 103 104 private java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> columns; 105 /** 106 Add the given items to the List of items in the {@link javafx.scene.control.TableColumn#getColumns() columns} property for the instance constructed by this builder. 107 */ 108 @SuppressWarnings("unchecked") 109 public B columns(java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> x) { 110 this.columns = x; 111 __set(2); 112 return (B) this; 113 } 114 115 /** 116 Add the given items to the List of items in the {@link javafx.scene.control.TableColumn#getColumns() columns} property for the instance constructed by this builder. 117 */ 118 public B columns(javafx.scene.control.TableColumn<S,?>... x) { 119 return columns(java.util.Arrays.asList(x)); 120 } 121 122 private java.util.Comparator<T> comparator; 123 /** 124 Set the value of the {@link javafx.scene.control.TableColumn#getComparator() comparator} property for the instance constructed by this builder. 125 */ 126 @SuppressWarnings("unchecked") 127 public B comparator(java.util.Comparator<T> x) { 128 this.comparator = x; 129 __set(3); 130 return (B) this; 131 } 132 133 private javafx.scene.control.ContextMenu contextMenu; 134 /** 135 Set the value of the {@link javafx.scene.control.TableColumn#getContextMenu() contextMenu} property for the instance constructed by this builder. 136 */ 137 @SuppressWarnings("unchecked") 138 public B contextMenu(javafx.scene.control.ContextMenu x) { 139 this.contextMenu = x; 140 __set(4); 141 return (B) this; 142 } 143 144 private boolean editable; 145 /** 146 Set the value of the {@link javafx.scene.control.TableColumn#isEditable() editable} property for the instance constructed by this builder. 147 */ 148 @SuppressWarnings("unchecked") 149 public B editable(boolean x) { 150 this.editable = x; 151 __set(5); 152 return (B) this; 153 } 154 155 private javafx.scene.Node graphic; 156 /** 157 Set the value of the {@link javafx.scene.control.TableColumn#getGraphic() graphic} property for the instance constructed by this builder. 158 */ 159 @SuppressWarnings("unchecked") 160 public B graphic(javafx.scene.Node x) { 161 this.graphic = x; 162 __set(6); 163 return (B) this; 164 } 165 166 private java.lang.String id; 167 /** 168 Set the value of the {@link javafx.scene.control.TableColumn#getId() id} property for the instance constructed by this builder. 169 */ 170 @SuppressWarnings("unchecked") 171 public B id(java.lang.String x) { 172 this.id = x; 173 __set(7); 174 return (B) this; 175 } 176 177 private double maxWidth; 178 /** 179 Set the value of the {@link javafx.scene.control.TableColumn#getMaxWidth() maxWidth} property for the instance constructed by this builder. 180 */ 181 @SuppressWarnings("unchecked") 182 public B maxWidth(double x) { 183 this.maxWidth = x; 184 __set(8); 185 return (B) this; 186 } 187 188 private double minWidth; 189 /** 190 Set the value of the {@link javafx.scene.control.TableColumn#getMinWidth() minWidth} property for the instance constructed by this builder. 191 */ 192 @SuppressWarnings("unchecked") 193 public B minWidth(double x) { 194 this.minWidth = x; 195 __set(9); 196 return (B) this; 197 } 198 199 private javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> onEditCancel; 200 /** 201 Set the value of the {@link javafx.scene.control.TableColumn#getOnEditCancel() onEditCancel} property for the instance constructed by this builder. 202 */ 203 @SuppressWarnings("unchecked") 204 public B onEditCancel(javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> x) { 205 this.onEditCancel = x; 206 __set(10); 207 return (B) this; 208 } 209 210 private javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> onEditCommit; 211 /** 212 Set the value of the {@link javafx.scene.control.TableColumn#getOnEditCommit() onEditCommit} property for the instance constructed by this builder. 213 */ 214 @SuppressWarnings("unchecked") 215 public B onEditCommit(javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> x) { 216 this.onEditCommit = x; 217 __set(11); 218 return (B) this; 219 } 220 221 private javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> onEditStart; 222 /** 223 Set the value of the {@link javafx.scene.control.TableColumn#getOnEditStart() onEditStart} property for the instance constructed by this builder. 224 */ 225 @SuppressWarnings("unchecked") 226 public B onEditStart(javafx.event.EventHandler<javafx.scene.control.TableColumn.CellEditEvent<S,T>> x) { 227 this.onEditStart = x; 228 __set(12); 229 return (B) this; 230 } 231 232 private double prefWidth; 233 /** 234 Set the value of the {@link javafx.scene.control.TableColumn#getPrefWidth() prefWidth} property for the instance constructed by this builder. 235 */ 236 @SuppressWarnings("unchecked") 237 public B prefWidth(double x) { 238 this.prefWidth = x; 239 __set(13); 240 return (B) this; 241 } 242 243 private boolean resizable; 244 /** 245 Set the value of the {@link javafx.scene.control.TableColumn#isResizable() resizable} property for the instance constructed by this builder. 246 */ 247 @SuppressWarnings("unchecked") 248 public B resizable(boolean x) { 249 this.resizable = x; 250 __set(14); 251 return (B) this; 252 } 253 254 private boolean sortable; 255 /** 256 Set the value of the {@link javafx.scene.control.TableColumn#isSortable() sortable} property for the instance constructed by this builder. 257 */ 258 @SuppressWarnings("unchecked") 259 public B sortable(boolean x) { 260 this.sortable = x; 261 __set(15); 262 return (B) this; 263 } 264 265 private javafx.scene.Node sortNode; 266 /** 267 Set the value of the {@link javafx.scene.control.TableColumn#getSortNode() sortNode} property for the instance constructed by this builder. 268 */ 269 @SuppressWarnings("unchecked") 270 public B sortNode(javafx.scene.Node x) { 271 this.sortNode = x; 272 __set(16); 273 return (B) this; 274 } 275 276 private javafx.scene.control.TableColumn.SortType sortType; 277 /** 278 Set the value of the {@link javafx.scene.control.TableColumn#getSortType() sortType} property for the instance constructed by this builder. 279 */ 280 @SuppressWarnings("unchecked") 281 public B sortType(javafx.scene.control.TableColumn.SortType x) { 282 this.sortType = x; 283 __set(17); 284 return (B) this; 285 } 286 287 private java.lang.String style; 288 /** 289 Set the value of the {@link javafx.scene.control.TableColumn#getStyle() style} property for the instance constructed by this builder. 290 */ 291 @SuppressWarnings("unchecked") 292 public B style(java.lang.String x) { 293 this.style = x; 294 __set(18); 295 return (B) this; 296 } 297 298 private java.util.Collection<? extends java.lang.String> styleClass; 299 /** 300 Add the given items to the List of items in the {@link javafx.scene.control.TableColumn#getStyleClass() styleClass} property for the instance constructed by this builder. 301 */ 302 @SuppressWarnings("unchecked") 303 public B styleClass(java.util.Collection<? extends java.lang.String> x) { 304 this.styleClass = x; 305 __set(19); 306 return (B) this; 307 } 308 309 /** 310 Add the given items to the List of items in the {@link javafx.scene.control.TableColumn#getStyleClass() styleClass} property for the instance constructed by this builder. 311 */ 312 public B styleClass(java.lang.String... x) { 313 return styleClass(java.util.Arrays.asList(x)); 314 } 315 316 private java.lang.String text; 317 /** 318 Set the value of the {@link javafx.scene.control.TableColumn#getText() text} property for the instance constructed by this builder. 319 */ 320 @SuppressWarnings("unchecked") 321 public B text(java.lang.String x) { 322 this.text = x; 323 __set(20); 324 return (B) this; 325 } 326 327 private java.lang.Object userData; 328 /** 329 Set the value of the {@link javafx.scene.control.TableColumn#getUserData() userData} property for the instance constructed by this builder. 330 */ 331 @SuppressWarnings("unchecked") 332 public B userData(java.lang.Object x) { 333 this.userData = x; 334 __set(21); 335 return (B) this; 336 } 337 338 private boolean visible; 339 /** 340 Set the value of the {@link javafx.scene.control.TableColumn#isVisible() visible} property for the instance constructed by this builder. 341 */ 342 @SuppressWarnings("unchecked") 343 public B visible(boolean x) { 344 this.visible = x; 345 __set(22); 346 return (B) this; 347 } 348 349 /** 350 Make an instance of {@link javafx.scene.control.TableColumn} based on the properties set on this builder. 351 */ 352 public javafx.scene.control.TableColumn<S, T> build() { 353 javafx.scene.control.TableColumn<S, T> x = new javafx.scene.control.TableColumn<S, T>(); 354 applyTo(x); 355 return x; 356 } 357}