Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package com.example.app
  2.  
  3. import com.vaadin.navigator.Navigator
  4. import com.vaadin.navigator.View
  5. import com.vaadin.navigator.ViewChangeListener
  6. import com.vaadin.server.Page
  7. import com.vaadin.ui.Alignment
  8. import com.vaadin.ui.Button
  9. import com.vaadin.ui.VerticalLayout
  10.  
  11. class Dashboard(val nav: Navigator) : VerticalLayout(), View {
  12.   init {
  13.     Page.getCurrent().setTitle("Login")
  14.     setHeight("100%")
  15.     setWidth("100%")
  16.  
  17.     val overviewButton = Button("Go to User Overview")
  18.  
  19.     addComponent(overviewButton)
  20.     setComponentAlignment(overviewButton, Alignment.MIDDLE_CENTER)
  21.  
  22.     overviewButton.addClickListener {
  23.       nav.navigateTo(UserOverview::class.java.name)
  24.     }
  25.   }
  26.  
  27.   override fun enter(event: ViewChangeListener.ViewChangeEvent) {
  28.     // Do nothing
  29.   }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement