jump.java

来自「tbuy1.1.5是在netbeans环境下用JSF技术编写的一个论坛tbuy1」· Java 代码 · 共 63 行

JAVA
63
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package biz.tbuy.bbs.bean;import biz.tbuy.bbs.ForumModel;import biz.tbuy.bbs.ZoneBuilder;import biz.tbuy.bbs.ZoneFactory;import biz.tbuy.bbs.ZoneModel;import java.util.ArrayList;import java.util.List;import javax.faces.model.SelectItem;import javax.faces.model.SelectItemGroup;/** * * @author Administrator */public class Jump extends BaseBean{    private List<SelectItemGroup> _forums;              // 包含BBS的讨论区列表    /** Creates a new instance of Jump */    public Jump() {    }        public void setForums(List<SelectItemGroup> forums) {        _forums = forums;    }        public List<SelectItemGroup> getForums() {        if (_forums == null) {            _forums = ZoneFactory.getForumsGroup();        }        return _forums;    }        /*    private void loadForums() {        _forums = new ArrayList<SelectItemGroup>();        List<ZoneModel> zones = ZoneFactory.getZones();        if (!zones.isEmpty()) {            for (ZoneModel zone : zones) {                SelectItemGroup zoneG = new SelectItemGroup(zone.getName());                ZoneBuilder zBuilder = ZoneFactory.newBuilder(zone.getNum());                List<ForumModel> theForums = zBuilder.getForums();                if (theForums != null && !theForums.isEmpty()) {                    SelectItem[] items = new SelectItem[theForums.size()];                    int n = 0;                    for (ForumModel forum : theForums) {                        items[n] = new SelectItem(forum.getNum(), forum.getName());                        n++;                    }                    zoneG.setSelectItems(items);                    _forums.add(zoneG);                }            }        }    }*/}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?