Java tutorial
/* 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 com.klwork.explorer.ui.main.views; import com.klwork.explorer.web.VaadinView; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener; import com.vaadin.server.ExternalResource; import com.vaadin.ui.Label; import com.vaadin.ui.Link; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import org.apache.shiro.authz.annotation.RequiresAuthentication; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; /** * The Class AuthenticatedView. */ @Component @Scope("prototype") @VaadinView(AuthenticatedView.NAME) @RequiresAuthentication public class AuthenticatedView extends Panel implements View { public static final String NAME = "authenticated"; @PostConstruct public void PostConstruct() { setSizeFull(); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.addComponent(new Label("@RequiresAuthentication")); layout.addComponent(new Link("Go back", new ExternalResource("#!" + MainView.NAME))); setContent(layout); } @Override public void enter(ViewChangeListener.ViewChangeEvent event) { } }