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