Explore the Code
You've just created a Scaladin application! This is a basic "Hello, World" application. Let's look at the HelloScaladinUI.scala file.
This file is the UI class of you Scaladin application. The HelloScaladinUI class extends the
vaadin.scala.UI class which is a base class for all Scaladin UIs. One application can contain an arbitrary amount of UI classes, but this example has only one UI class. Let's look inside the class:
content = Button("Click me!", Notification.show("Hello, Scaladin!"))
Each UI must have a content, which is the base component rendered in the browser window. In this example we set a Button (
vaadin.scala.Button) component as the content of our UI. The Button component accepts a string and a click listener as the constructor argument; this string will be shown as the caption of the Button component when the application is opened in the browser. Once you click the button, a Notification component will be shown.
The content can be any Vaadin / Scaladin component - you can find a good set of choices in the
vaadin.scala package within the Scaladin add-on.
Running Scaladin Applications
You can deploy this scaladin application to an embedded Jetty servlet container by going to the Run tab, clicking the Start button, and then accessing http://localhost:9000 on your computer. You should end up with a simple application showing a button with the caption of "Click me!".
You can also run Scaladin applications easily from the command line using sbt. First you must of course compile the application by typing
compile in the sbt prompt. Once the compilation is done you can simply type
container:start to start the Jetty server and deploy your application.