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.TableView 030@see javafx.scene.control.TableView 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 TableViewBuilder<S, B extends javafx.scene.control.TableViewBuilder<S, B>> extends javafx.scene.control.ControlBuilder<B> implements javafx.util.Builder<javafx.scene.control.TableView<S>> { 036 protected TableViewBuilder() { 037 } 038 039 /** Creates a new instance of TableViewBuilder. */ 040 @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) 041 public static <S> javafx.scene.control.TableViewBuilder<S, ?> create() { 042 return new javafx.scene.control.TableViewBuilder(); 043 } 044 045 private int __set; 046 private void __set(int i) { 047 __set |= 1 << i; 048 } 049 public void applyTo(javafx.scene.control.TableView<S> x) { 050 super.applyTo(x); 051 int set = __set; 052 while (set != 0) { 053 int i = Integer.numberOfTrailingZeros(set); 054 set &= ~(1 << i); 055 switch (i) { 056 case 0: x.setColumnResizePolicy(this.columnResizePolicy); break; 057 case 1: x.getColumns().addAll(this.columns); break; 058 case 2: x.setEditable(this.editable); break; 059 case 3: x.setFocusModel(this.focusModel); break; 060 case 4: x.setItems(this.items); break; 061 case 5: x.setPlaceholder(this.placeholder); break; 062 case 6: x.setRowFactory(this.rowFactory); break; 063 case 7: x.setSelectionModel(this.selectionModel); break; 064 case 8: x.getSortOrder().addAll(this.sortOrder); break; 065 case 9: x.setTableMenuButtonVisible(this.tableMenuButtonVisible); break; 066 } 067 } 068 } 069 070 private javafx.util.Callback<javafx.scene.control.TableView.ResizeFeatures,java.lang.Boolean> columnResizePolicy; 071 /** 072 Set the value of the {@link javafx.scene.control.TableView#getColumnResizePolicy() columnResizePolicy} property for the instance constructed by this builder. 073 */ 074 @SuppressWarnings("unchecked") 075 public B columnResizePolicy(javafx.util.Callback<javafx.scene.control.TableView.ResizeFeatures,java.lang.Boolean> x) { 076 this.columnResizePolicy = x; 077 __set(0); 078 return (B) this; 079 } 080 081 private java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> columns; 082 /** 083 Add the given items to the List of items in the {@link javafx.scene.control.TableView#getColumns() columns} property for the instance constructed by this builder. 084 */ 085 @SuppressWarnings("unchecked") 086 public B columns(java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> x) { 087 this.columns = x; 088 __set(1); 089 return (B) this; 090 } 091 092 /** 093 Add the given items to the List of items in the {@link javafx.scene.control.TableView#getColumns() columns} property for the instance constructed by this builder. 094 */ 095 public B columns(javafx.scene.control.TableColumn<S,?>... x) { 096 return columns(java.util.Arrays.asList(x)); 097 } 098 099 private boolean editable; 100 /** 101 Set the value of the {@link javafx.scene.control.TableView#isEditable() editable} property for the instance constructed by this builder. 102 */ 103 @SuppressWarnings("unchecked") 104 public B editable(boolean x) { 105 this.editable = x; 106 __set(2); 107 return (B) this; 108 } 109 110 private javafx.scene.control.TableView.TableViewFocusModel<S> focusModel; 111 /** 112 Set the value of the {@link javafx.scene.control.TableView#getFocusModel() focusModel} property for the instance constructed by this builder. 113 */ 114 @SuppressWarnings("unchecked") 115 public B focusModel(javafx.scene.control.TableView.TableViewFocusModel<S> x) { 116 this.focusModel = x; 117 __set(3); 118 return (B) this; 119 } 120 121 private javafx.collections.ObservableList<S> items; 122 /** 123 Set the value of the {@link javafx.scene.control.TableView#getItems() items} property for the instance constructed by this builder. 124 */ 125 @SuppressWarnings("unchecked") 126 public B items(javafx.collections.ObservableList<S> x) { 127 this.items = x; 128 __set(4); 129 return (B) this; 130 } 131 132 private javafx.scene.Node placeholder; 133 /** 134 Set the value of the {@link javafx.scene.control.TableView#getPlaceholder() placeholder} property for the instance constructed by this builder. 135 */ 136 @SuppressWarnings("unchecked") 137 public B placeholder(javafx.scene.Node x) { 138 this.placeholder = x; 139 __set(5); 140 return (B) this; 141 } 142 143 private javafx.util.Callback<javafx.scene.control.TableView<S>,javafx.scene.control.TableRow<S>> rowFactory; 144 /** 145 Set the value of the {@link javafx.scene.control.TableView#getRowFactory() rowFactory} property for the instance constructed by this builder. 146 */ 147 @SuppressWarnings("unchecked") 148 public B rowFactory(javafx.util.Callback<javafx.scene.control.TableView<S>,javafx.scene.control.TableRow<S>> x) { 149 this.rowFactory = x; 150 __set(6); 151 return (B) this; 152 } 153 154 private javafx.scene.control.TableView.TableViewSelectionModel<S> selectionModel; 155 /** 156 Set the value of the {@link javafx.scene.control.TableView#getSelectionModel() selectionModel} property for the instance constructed by this builder. 157 */ 158 @SuppressWarnings("unchecked") 159 public B selectionModel(javafx.scene.control.TableView.TableViewSelectionModel<S> x) { 160 this.selectionModel = x; 161 __set(7); 162 return (B) this; 163 } 164 165 private java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> sortOrder; 166 /** 167 Add the given items to the List of items in the {@link javafx.scene.control.TableView#getSortOrder() sortOrder} property for the instance constructed by this builder. 168 */ 169 @SuppressWarnings("unchecked") 170 public B sortOrder(java.util.Collection<? extends javafx.scene.control.TableColumn<S,?>> x) { 171 this.sortOrder = x; 172 __set(8); 173 return (B) this; 174 } 175 176 /** 177 Add the given items to the List of items in the {@link javafx.scene.control.TableView#getSortOrder() sortOrder} property for the instance constructed by this builder. 178 */ 179 public B sortOrder(javafx.scene.control.TableColumn<S,?>... x) { 180 return sortOrder(java.util.Arrays.asList(x)); 181 } 182 183 private boolean tableMenuButtonVisible; 184 /** 185 Set the value of the {@link javafx.scene.control.TableView#isTableMenuButtonVisible() tableMenuButtonVisible} property for the instance constructed by this builder. 186 */ 187 @SuppressWarnings("unchecked") 188 public B tableMenuButtonVisible(boolean x) { 189 this.tableMenuButtonVisible = x; 190 __set(9); 191 return (B) this; 192 } 193 194 /** 195 Make an instance of {@link javafx.scene.control.TableView} based on the properties set on this builder. 196 */ 197 public javafx.scene.control.TableView<S> build() { 198 javafx.scene.control.TableView<S> x = new javafx.scene.control.TableView<S>(); 199 applyTo(x); 200 return x; 201 } 202}