by.bigvova.views.HomeView.java Source code

Java tutorial

Introduction

Here is the source code for by.bigvova.views.HomeView.java

Source

/*
 * Copyright 2015 The original authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package by.bigvova.views;

import by.bigvova.Sections;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.FontAwesome;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.spring.annotation.SpringView;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.ValoTheme;
import org.springframework.security.access.annotation.Secured;
import org.vaadin.spring.sidebar.annotation.FontAwesomeIcon;
import org.vaadin.spring.sidebar.annotation.SideBarItem;

/**
 * When the user logs in and there is no view to navigate to, this view will be shown.
 *
 * @author Petter Holmstrm (petter@vaadin.com)
 */

@SpringView(name = "")
@SideBarItem(sectionId = Sections.VIEWS, caption = "Home", order = 0)
@FontAwesomeIcon(FontAwesome.HOME)
public class HomeView extends VerticalLayout implements View {

    public HomeView() {
        setSpacing(true);
        setMargin(true);
        setSizeFull();

        Label header = new Label("   -=FoodNote=-");
        header.addStyleName(ValoTheme.LABEL_H1);
        addComponent(header);
        Label body = new Label(
                "<h3> ?? ? ? <b>CRUD</b> ?  ? <b>enterprise</b> ."
                        + "   ?  ?? ,    ?  ? .</h3>"
                        + "? ?:" + "<ul>"
                        + "<li>?  ?  <b>Spring Boot</b>, ? ? - propertie .</li>"
                        + "<li>? ?  ?? ? ???   <b>Repository</b> - <b>Spring Data JPA</b>, <b>Hibernate</b> (<b>JdbcTemplate</b>  ?).</li>"
                        + "<li> ?? - ?? ,  :</li>"
                        + "<ul>" + "<li>  - <b>PostgreSQL</b></li>"
                        + "<li>connection pool - <b>HikariCP</b></li>" + "</ul>"
                        + "<li>? - <b>EhCache</b>.</li>"
                        + "<li> ? -  <b>EventBus</b>, ? <b>Google Guava</b>.</li>"
                        + "<li>?,  - <b>Spring Security</b>:</li>"
                        + "<ul>"
                        + "<li>    , ? <b>UserDetails</b></li>"
                        + "<li> ??   ? <b>BCrypt</b></li>"
                        + "<li>  <b>Remember Me</b> ??</li>"
                        + "</ul>" + "<li>? - <b>JUnit4</b></li>"
                        + "<li> - <b>slf4j</b>, <b>logback</b></li>"
                        + "<li>Front-end - <b>Vaadin framework</b>, <b>GWT</b></li>"
                        + "<li>   <b>Docker</b>      ? <b>Ubuntu Server 14.04</b></li>"
                        + "</ul>"
                        + "<p>? Spring Boot - Vaadin ?? : <a href=\"https://github.com/peholmst/vaadin4spring\">vaadin4spring</a></p>"
                        + "<p> ? <a href=\"https://github.com/BigVOVA/FoodNote\">github.com/BigVOVA/FoodNote</a></p>");
        body.setContentMode(ContentMode.HTML);
        VerticalLayout bodyLayout = new VerticalLayout();
        bodyLayout.setWidth(100, Unit.PERCENTAGE);
        bodyLayout.setMargin(new MarginInfo(false, true, false, true));
        bodyLayout.addComponent(body);
        Panel panel = new Panel();
        panel.setSizeFull();
        panel.setContent(bodyLayout);
        addComponent(panel);
        setExpandRatio(panel, 1);
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent event) {
    }
}