com.squadd.views.PrimaryView.java Source code

Java tutorial

Introduction

Here is the source code for com.squadd.views.PrimaryView.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.squadd.views;

import com.squadd.ApplicationUI;
//import com.squadd.Windows.WelcomeWindow;
import com.squadd.javaBeans.Contact;
import com.squadd.javaBeans.Group;
import com.squadd.javaBeans.UserInfoBean;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Notification;
import com.vaadin.ui.UI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.squadd.javaBeans.Contact;
import javax.annotation.PostConstruct;

/**
 *
 * @author SharkNado
 */
public class PrimaryView extends FormLayout implements View {

    @Autowired
    protected Contact contact;

    @Autowired
    protected Group group;

    @Autowired
    protected UserInfoBean anotherUser;

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent event) {
        if (contact == null || contact.isAuthorized() == false) {
            getUI().getNavigator().navigateTo(LoginView.name);
            fillFromView();
        }
    }

    protected void fillFromView() {
        //must be overriden
    }

}