001    /*
002     * Copyright (C) 2008 Adam Cornett This program is free software; you can
003     * redistribute it and/or modify it under the terms of the GNU General Public
004     * License as published by the Free Software Foundation; either version 3 of the
005     * License, or (at your option) any later version. This program is distributed
006     * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
007     * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
008     * See the GNU General Public License for more details. You should have received
009     * a copy of the GNU General Public License along with this program; if not, see
010     * <http://www.gnu.org/licenses>.
011     */
012    
013    package net.codescore.ui.components.list.sel;
014    
015    import static net.codescore.ui.i18n.T._;
016    
017    import net.codescore.dbo.School;
018    import net.codescore.dbo.Team;
019    import net.codescore.dbo.inf.TeamTarget;
020    import net.codescore.ui.components.list.AbstractPicker;
021    
022    public class TeamPicker extends AbstractPicker<Team, TeamTarget> {
023            private School school = null;
024    
025            public TeamPicker(TeamTarget target) {
026                    super(_("admin.ppl.team"), target);
027            }
028    
029            public TeamPicker(TeamTarget target, School s) {
030                    super(_("admin.ppl.team"), target);
031                    school = s;
032            }
033    
034            @Override
035            protected void initDropDown(TeamTarget obj) {
036                    if (school == null)
037                            dropDown = new TeamDD(obj);
038                    else
039                            dropDown = new TeamDD(obj, school);
040            }
041    
042    }