You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,7 @@ Server-side `Grid` allows you to set the `DataProvider` which will actually fetc
236
236
To create a new view, all that's needed is to create a Kotlin class which is annotated with the `@Route` annotation and extends
237
237
some Vaadin Component.
238
238
239
-
Create the `web/src/main/kotlin/com/example/vok/MyWelcomeView.kt` file and make sure it looks like follows:
239
+
Create the `src/main/kotlin/com/example/vok/MyWelcomeView.kt` file and make sure it looks like follows:
240
240
241
241
```kotlin
242
242
packagecom.example.vok
@@ -266,10 +266,27 @@ Open up the `WelcomeView.kt` file and change the `@Route("")` annotation to the
266
266
267
267
Having the `@Route("")` on `MyWelcomeView` will tell the Vaadin Route Registry to map requests to the root of the application to the `MyWelcomeView` view.
268
268
269
-
Launch the web server again and navigate to [http://localhost:8080](http://localhost:8080) in your browser. You'll see the "Hello, Vaadin-on-Kotlin!"
269
+
Launch the app again and navigate to [http://localhost:8080](http://localhost:8080) in your browser. You'll see the "Hello, Vaadin-on-Kotlin!"
270
270
message you put into the `web/src/main/kotlin/com/example/vok/MyWelcomeView.kt`, indicating
271
271
that this new route is indeed going to `MyWelcomeView` and is rendering the view correctly.
272
272
273
+
## Setting up Intellij Community
274
+
275
+
To have a proper file editor, with auto-completion features and all, let's set up Intellij IDEA Community.
276
+
Download and install [Intellij IDEA Community](https://www.jetbrains.com/idea/download/) if you haven't done that already.
277
+
Then, select the "Open" button and open the `vok-helloworld-app` directory as a project. Please give
278
+
Intellij a bit of time to open the project and download all files.
279
+
280
+
In your Intellij, open the `src/main/kotlin/com/example/vok/Main.kt` file. It contains just one
281
+
function called `main()` which runs the entire app. There's a little green arrow to the left of the function; simply
282
+
right-click the arrow and select "Debug 'Main'" from the menu. Your app is now running from your Intellij!
283
+
284
+
> The app may fail to start since it's already running from a command-line from previous experiments.
285
+
> In such case, simply press CTRL+C in the terminal to kill the old app, then try to launch the app from Intellij again.
286
+
287
+
Running the app from Intellij in debug mode allows you to publish changes in your file directly to the running app easily.
288
+
Simply edit the file, then press CTRL+F9 (or *Build / Build Project* from the menu) then reload the page in your browser.
289
+
273
290
## Getting Up and Running
274
291
275
292
Now that you've seen how to create a view, let's create something with a bit more substance.
0 commit comments