~codescore-dev/codescore/version-1.0

« back to all changes in this revision

Viewing changes to src/net/launchpad/codescore/ui/admin/ppl/TeamSItem.java

  • Committer: Adam Cornett
  • Date: 2008-03-15 05:15:51 UTC
  • Revision ID: adam.cornett@gmail.com-20080315051551-p04pf7pglcguazgq
Massive updates to the admin side, added html loaders and pages for all major sections, began work on the tree for the school and coach views

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2008 Adam Cornett This program is free software; you can
 
3
 * redistribute it and/or modify it under the terms of the GNU General Public
 
4
 * License as published by the Free Software Foundation; either version 3 of the
 
5
 * License, or (at your option) any later version. This program is distributed
 
6
 * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 
7
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
8
 * See the GNU General Public License for more details. You should have received
 
9
 * a copy of the GNU General Public License along with this program; if not, see
 
10
 * <http://www.gnu.org/licenses>.
 
11
 */
 
12
 
 
13
package net.launchpad.codescore.ui.admin.ppl;
 
14
 
 
15
import org.zkoss.zul.Treechildren;
 
16
import net.launchpad.codescore.dbo.Competition;
 
17
import net.launchpad.codescore.dbo.Team;
 
18
import net.launchpad.codescore.ui.Style;
 
19
 
 
20
public class TeamSItem extends Treeitem {
 
21
        private static final long serialVersionUID = -4013359339515156028L;
 
22
 
 
23
        private Treechildren childern;
 
24
 
 
25
        private final Team team;
 
26
 
 
27
        public TeamSItem(final Team t) {
 
28
                team = t;
 
29
                setImage("/images/team.png");
 
30
                setValue(t);
 
31
                setLabel(t.getName());
 
32
                setOpen(false);
 
33
                setLoaded(false);
 
34
                setStyle(Style.getString("style.bold"));
 
35
                initChildern();
 
36
                for (final Competition c : t.getCompetitions()) {
 
37
                        final CompTItem ci = new CompTItem(c, team);
 
38
                        ci.setParent(childern);
 
39
                }
 
40
        }
 
41
 
 
42
        private void initChildern() {
 
43
                childern = new Treechildren();
 
44
                childern.setParent(this);
 
45
        }
 
46
}