--- title: Getting Started On NetBeans order: 76 layout: page --- [[getting-started-on-netbeans]] = Getting started on NetBeans *This page is for old NetBeans version. Take a look at http://wiki.netbeans.org/VaadinPlugin1.0.0[New plugin in NetBeans wiki]* [[your-first-project-with-vaadin-in-netbeans-ide-6.7]] Your First Project with Vaadin in NetBeans IDE 6.7 -------------------------------------------------- Eclipse users have access to the http://vaadin.com/eclipse[Vaadin Eclipse plugin] which is probably the easiest way to get started with the Vaadin framework. But if you preferNetBeans IDE, this is the article for you. And don't worry, it's almost as easy to get started with NetBeans also. This tutorial assumes you have downloaded and installed a bundle of http://www.netbeans.org[NetBeans 6.7] that includes the Apache Tomcat server (the "Java Web & EE" support) and you have the latest http://vaadin.com/download[Vaadin] JAR package at hand. [[creating-the-project]] Creating the Project ~~~~~~~~~~~~~~~~~~~~ image:img/netbeans_new_project.png[NetBeans new project] Launch your NetBeans IDE and perform the following steps to create a new web project. * Select `File -> New Project` to open the New Project dialog window. * Select `Java Web` from the categories and `Web Application` from the project selection and click `Next` to proceed. * Type in a name and location for your project (I use `HelloVaadin` as the name and my default project folder) and click `Next`. * Select the `Apache Tomcat 6.0.18` server and type in preferred context path or use the default (the project name). The context path will define the URL of your application (for example `http://localhost:8084/HelloVaadin`). Click `Finish` to create the project. * You can close and ignore the index.jsp, which is opened to the editor by default after the project has been created. [[importing-vaadin-libraries]] Importing Vaadin Libraries ~~~~~~~~~~~~~~~~~~~~~~~~~~ Next you need to import the Vaadin library JAR package to the project you just created. * Right-click the `Libraries` node on your project and select `Add JAR/Folder...`. * Locate your copy of the Vaadin JAR file in the opening file dialog and click `Open`. * Now you should see the JAR file under the Libraries node. [[writing-the-code]] Writing the Code ~~~~~~~~~~~~~~~~ Next we create the application class for our simple example application. * Select `New -> Java Class` on your project to open the New Java Class dialog. * Type in your a name and package for your class (I use a class name of `HelloVaadin` and a package `com.vaadin.netbeans.tutorial`). * Select `Finish` to create the Java class. This class will be the main application class of our Vaadin application.Therefore it must extend the abstract `com.vaadin.Application` class and implement the `init()` method. Type in or copy-paste the following code to the newly created file: [source,java] .... package com.vaadin.netbeans.tutorial; import com.vaadin.Application; import com.vaadin.ui.*; public class HelloVaadin extends Application { @Override public void init() { Window mainWindow = new Window("HelloVaadin"); Label label = new Label("Hello Vaadin user"); mainWindow.addComponent(label); setMainWindow(mainWindow); } } .... [[defining-deployment-descriptor]] Defining Deployment Descriptor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To run your application you must define a deployment descriptor for it. Open `Web Pages -> WEB-INF -> web.xml` file on your project. By default the file is opened in a graphical editor but you can select the XML tab to edit the XML file directly. Type in or copy-paste the following to the contents of the file. [source,xml] .... HelloVaadin productionMode false Vaadin production mode HelloVaadin com.vaadin.terminal.gwt.server.ApplicationServlet application com.vaadin.netbeans.tutorial.HelloVaadin Vaadin application class to start HelloVaadin /* .... [[running-your-application]] Running Your Application ~~~~~~~~~~~~~~~~~~~~~~~~ Now we can run (or debug) the application by simply selecting `Run -> Run Main Project` (or `Run -> Debug Main Project`).This starts the Apache Tomcat server and opens up your application in your default browser. image:img/netbeans_hello_vaadin.png[NetBeans "Hello Vaadin"] [[what-next]] What Next? ~~~~~~~~~~ Now that you have your environment setup, you probably want to explore more of the features of the Vaadin framework. I would suggest that you head to the http://vaadin.com/tutorial[Vaadin tutorial]. Have fun with Vaadin! [[update]] Update ~~~~~~ * http://vaadin.com/netbeans[Vaadin Plugin for NetBeans 6.8] on value='mobile_drag_image_offset'>mobile_drag_image_offset Vaadin 6, 7, 8 is a Java framework for modern Java web applications: https://github.com/vaadin/frameworkwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/AbstractComponentContainer.java
blob: 5bd00b7845d6019b2c11f018b795bea2fa5b29ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331