Java tutorial
/* * Copyright 2015 Kaiserpfalz EDV-Service, Roland T. Lichti * * 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 de.kaiserpfalzEdv.piracc.tech.account.list; import com.vaadin.navigator.View; import com.vaadin.spring.annotation.SpringView; import com.vaadin.spring.annotation.UIScope; import de.kaiserpfalzEdv.piracc.backend.db.dynamic.Account; import de.kaiserpfalzEdv.vaadin.auth.Access; import de.kaiserpfalzEdv.vaadin.ui.defaultviews.DataContainerProvider; import de.kaiserpfalzEdv.vaadin.ui.defaultviews.list.TableDescription; import de.kaiserpfalzEdv.vaadin.ui.defaultviews.list.impl.BaseListViewImpl; import de.kaiserpfalzEdv.vaadin.ui.menu.MenuEntry; import javax.inject.Inject; import javax.inject.Named; import java.util.ArrayList; /** * @author klenkes * @version 2015Q1 * @since 13.09.15 22:37 */ @Named @UIScope @Access({ "admin", "dsb", "board", "office" }) @MenuEntry(name = AccountListViewImpl.VIEW_NAME, i18nKey = AccountListViewImpl.VIEW_NAME, access = { "dsb", "board", "office" }, order = 12, separator = false) @SpringView(name = AccountListViewImpl.VIEW_NAME) public class AccountListViewImpl extends BaseListViewImpl<Account, AccountListView> implements AccountListView, View { public static final String VIEW_NAME = "accounts.list"; private static final long serialVersionUID = -7034688590121887607L; @Inject public AccountListViewImpl(final AccountListPresenterImpl presenter, final DataContainerProvider dataContainerProvider) { super(presenter, dataContainerProvider, Account.class); } @Override protected ArrayList<TableDescription> initializeFields() { ArrayList<TableDescription> result = new ArrayList<>(10); result.add(new TableDescription("id", 5).setI18nHeadingKey("base.id")); result.add(new TableDescription("system.name", 15).setI18nHeadingKey("systems.name")); result.add(new TableDescription("account", 15).setI18nHeadingKey("accounts.account")); result.add(new TableDescription("from", 10).setI18nHeadingKey("base.from")); result.add(new TableDescription("accountCreated", 10).setI18nHeadingKey("accounts.accountCreated")); result.add(new TableDescription("till", 10).setI18nHeadingKey("base.till")); result.add(new TableDescription("accountRemoved", 10).setI18nHeadingKey("accounts.accountRemoved")); result.add(new TableDescription("locked", 5).setI18nHeadingKey("base.locked")); result.add(new TableDescription("created", 10).setI18nHeadingKey("base.created")); result.add(new TableDescription("lastModified", 10).setI18nHeadingKey("base.lastModified")); return result; } }