J2ME中实现可伸展目录树TreeList
时间:2007-10-22 来源:不详 作者:林子
if (!ifSub) {
this.append(item.getLabel(), icon);
} else {
this.append(" " item.getLabel(), icon);
}
}
public void Init() {
int count = this.size();
for (int i = 0; i < count; i ) {
this.delete(0);
}
this.appearHookList.removeAllElements();
System.out.println("Now itemList:" this.itemList);
}
public void LoadList() {
Init();
for (int i = 0; i < itemList.size(); i ) {
ExpandListItem elItem = (ExpandListItem) itemList.elementAt(i);
if (elItem.getType() == ExpandListItem.GROUP) {
Image icon = Util.getImage(elItem.getImagePath());
/**
* @Debug
*/
if (elItem.Ifselected()) {
if (elItem.getSelectImgPath() != null) {
icon = Util.getImage(elItem.getSelectImgPath());
}
System.out.println("Add Parent Node:");
this.appendItem(elItem, icon, false); copyright dedecms
Vector group = (Vector) elItem.getContent();
for (int j = 0; j < group.size(); j ) {
ExpandListItem item = (ExpandListItem) group.elementAt(j);
Image ic = Util.getImage(item.getImagePath());
System.out.println("Add Sub Node:");
this.appendItem(item, ic, true);
}
} else {
System.out.println("Add Leave Node:");
this.appendItem(elItem, icon, false);
}
} else if (elItem.getType() == ExpandListItem.ITEM) {
Image icon = Util.getImage(elItem.getImagePath());
this.appendItem(elItem, icon, false);
}
}
if (this.currentSelectedIndex != -1) {
this.setSelectedIndex(currentSelectedIndex, true);
}
}
public Vector getItemList() {
return itemList;
}
public void setItemList(Vector itemList) {
this.itemList = itemList;
}
public void commandAction(Command arg0, Displayable arg1) {
上一篇:利用JSP的思想来做ASP 下一篇:JSP/Servlet构建三层管理信息系统
文章评论
共有位Admini5网友发表了评论 查看完整内容