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.Tab
030@see javafx.scene.control.Tab
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 TabBuilder<B extends javafx.scene.control.TabBuilder<B>> implements javafx.util.Builder<javafx.scene.control.Tab> {
036    protected TabBuilder() {
037    }
038    
039    /** Creates a new instance of TabBuilder. */
040    @SuppressWarnings({"deprecation", "rawtypes", "unchecked"})
041    public static javafx.scene.control.TabBuilder<?> create() {
042        return new javafx.scene.control.TabBuilder();
043    }
044    
045    private int __set;
046    private void __set(int i) {
047        __set |= 1 << i;
048    }
049    public void applyTo(javafx.scene.control.Tab 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.setClosable(this.closable); break;
056                case 1: x.setContent(this.content); break;
057                case 2: x.setContextMenu(this.contextMenu); break;
058                case 3: x.setDisable(this.disable); break;
059                case 4: x.setGraphic(this.graphic); break;
060                case 5: x.setId(this.id); break;
061                case 6: x.setOnClosed(this.onClosed); break;
062                case 7: x.setOnSelectionChanged(this.onSelectionChanged); break;
063                case 8: x.setStyle(this.style); break;
064                case 9: x.getStyleClass().addAll(this.styleClass); break;
065                case 10: x.setText(this.text); break;
066                case 11: x.setTooltip(this.tooltip); break;
067                case 12: x.setUserData(this.userData); break;
068            }
069        }
070    }
071    
072    private boolean closable;
073    /**
074    Set the value of the {@link javafx.scene.control.Tab#isClosable() closable} property for the instance constructed by this builder.
075    */
076    @SuppressWarnings("unchecked")
077    public B closable(boolean x) {
078        this.closable = x;
079        __set(0);
080        return (B) this;
081    }
082    
083    private javafx.scene.Node content;
084    /**
085    Set the value of the {@link javafx.scene.control.Tab#getContent() content} property for the instance constructed by this builder.
086    */
087    @SuppressWarnings("unchecked")
088    public B content(javafx.scene.Node x) {
089        this.content = x;
090        __set(1);
091        return (B) this;
092    }
093    
094    private javafx.scene.control.ContextMenu contextMenu;
095    /**
096    Set the value of the {@link javafx.scene.control.Tab#getContextMenu() contextMenu} property for the instance constructed by this builder.
097    */
098    @SuppressWarnings("unchecked")
099    public B contextMenu(javafx.scene.control.ContextMenu x) {
100        this.contextMenu = x;
101        __set(2);
102        return (B) this;
103    }
104    
105    private boolean disable;
106    /**
107    Set the value of the {@link javafx.scene.control.Tab#isDisable() disable} property for the instance constructed by this builder.
108    */
109    @SuppressWarnings("unchecked")
110    public B disable(boolean x) {
111        this.disable = x;
112        __set(3);
113        return (B) this;
114    }
115    
116    private javafx.scene.Node graphic;
117    /**
118    Set the value of the {@link javafx.scene.control.Tab#getGraphic() graphic} property for the instance constructed by this builder.
119    */
120    @SuppressWarnings("unchecked")
121    public B graphic(javafx.scene.Node x) {
122        this.graphic = x;
123        __set(4);
124        return (B) this;
125    }
126    
127    private java.lang.String id;
128    /**
129    Set the value of the {@link javafx.scene.control.Tab#getId() id} property for the instance constructed by this builder.
130    */
131    @SuppressWarnings("unchecked")
132    public B id(java.lang.String x) {
133        this.id = x;
134        __set(5);
135        return (B) this;
136    }
137    
138    private javafx.event.EventHandler<javafx.event.Event> onClosed;
139    /**
140    Set the value of the {@link javafx.scene.control.Tab#getOnClosed() onClosed} property for the instance constructed by this builder.
141    */
142    @SuppressWarnings("unchecked")
143    public B onClosed(javafx.event.EventHandler<javafx.event.Event> x) {
144        this.onClosed = x;
145        __set(6);
146        return (B) this;
147    }
148    
149    private javafx.event.EventHandler<javafx.event.Event> onSelectionChanged;
150    /**
151    Set the value of the {@link javafx.scene.control.Tab#getOnSelectionChanged() onSelectionChanged} property for the instance constructed by this builder.
152    */
153    @SuppressWarnings("unchecked")
154    public B onSelectionChanged(javafx.event.EventHandler<javafx.event.Event> x) {
155        this.onSelectionChanged = x;
156        __set(7);
157        return (B) this;
158    }
159    
160    private java.lang.String style;
161    /**
162    Set the value of the {@link javafx.scene.control.Tab#getStyle() style} property for the instance constructed by this builder.
163    */
164    @SuppressWarnings("unchecked")
165    public B style(java.lang.String x) {
166        this.style = x;
167        __set(8);
168        return (B) this;
169    }
170    
171    private java.util.Collection<? extends java.lang.String> styleClass;
172    /**
173    Add the given items to the List of items in the {@link javafx.scene.control.Tab#getStyleClass() styleClass} property for the instance constructed by this builder.
174    */
175    @SuppressWarnings("unchecked")
176    public B styleClass(java.util.Collection<? extends java.lang.String> x) {
177        this.styleClass = x;
178        __set(9);
179        return (B) this;
180    }
181    
182    /**
183    Add the given items to the List of items in the {@link javafx.scene.control.Tab#getStyleClass() styleClass} property for the instance constructed by this builder.
184    */
185    public B styleClass(java.lang.String... x) {
186        return styleClass(java.util.Arrays.asList(x));
187    }
188    
189    private java.lang.String text;
190    /**
191    Set the value of the {@link javafx.scene.control.Tab#getText() text} property for the instance constructed by this builder.
192    */
193    @SuppressWarnings("unchecked")
194    public B text(java.lang.String x) {
195        this.text = x;
196        __set(10);
197        return (B) this;
198    }
199    
200    private javafx.scene.control.Tooltip tooltip;
201    /**
202    Set the value of the {@link javafx.scene.control.Tab#getTooltip() tooltip} property for the instance constructed by this builder.
203    */
204    @SuppressWarnings("unchecked")
205    public B tooltip(javafx.scene.control.Tooltip x) {
206        this.tooltip = x;
207        __set(11);
208        return (B) this;
209    }
210    
211    private java.lang.Object userData;
212    /**
213    Set the value of the {@link javafx.scene.control.Tab#getUserData() userData} property for the instance constructed by this builder.
214    */
215    @SuppressWarnings("unchecked")
216    public B userData(java.lang.Object x) {
217        this.userData = x;
218        __set(12);
219        return (B) this;
220    }
221    
222    /**
223    Make an instance of {@link javafx.scene.control.Tab} based on the properties set on this builder.
224    */
225    public javafx.scene.control.Tab build() {
226        javafx.scene.control.Tab x = new javafx.scene.control.Tab();
227        applyTo(x);
228        return x;
229    }
230}