本文整理汇总了Java中com.extjs.gxt.ui.client.data.BaseTreeModel类的典型用法代码示例。如果您正苦于以下问题:Java BaseTreeModel类的具体用法?Java BaseTreeModel怎么用?Java BaseTreeModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseTreeModel类属于com.extjs.gxt.ui.client.data包,在下文中一共展示了BaseTreeModel类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateTimesheet
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
private void populateTimesheet() {
tree.mask("Loading Data");
final HourServiceAsync hourService = GWT.create(HourService.class);
hourService.getHours(userDTO, date, new AsyncCallback<BaseTreeModel>() {
public void onFailure(Throwable caught) {
MessageBox.alert("Cannot get Hours", caught.getMessage(), null);
}
public void onSuccess(BaseTreeModel model) {
if (model == null) {
MessageBox.alert("Cannot get Hours",
"server answer is null", null);
} else {
store.removeAll();
store.add(model.getChildren(), true);
store.sort(myConstants.type(), SortDir.ASC);
tree.unmask();
}
}
});
}
示例2: loadUserTreeGrid
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
public void loadUserTreeGrid(Integer assignmentId,Integer departmentId, Date starting, Date finishing){
if(assignmentId != null && departmentId != null){
if(starting.compareTo(finishing) > 0 && finishing.compareTo(starting) < 0){
MessageBox.info("ERROR"," Starting Data must be less whan Finishing Data",null);
}else{
userTreeGrid.getStore().removeAll();
final HourServiceAsync hourService = GWT.create(HourService.class);
hourService.getHours(assignmentId, departmentId,starting, finishing, new AsyncCallback<BaseTreeModel>() {
public void onFailure(Throwable caught) {
MessageBox.info("Cant get users information",caught.getMessage() , null);
}
public void onSuccess(BaseTreeModel model) {
userStore.add(model.getChildren(), true);
}
});
}
}
}
示例3: HourFolder
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public HourFolder(String name,Integer index,Integer type,List<Hour> hours,List<BaseTreeModel> children) {
set("id", ID++);
set("name", name);
set("index",index);
set("type",type);
if(children.size() >0){
set("leaf",false);
}else{
set("leaf",true);
}
for(Hour h: hours ){
set(Integer.toString(h.getDate().getDate()),h.getHour());
this.summ = this.summ + h.getHour();
}
set("summ",this.summ);
for(BaseTreeModel b: children){
add(b);
}
}
示例4: deselectChildren
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
private void deselectChildren(final M m) {
for (final ModelData md : m.getChildren()) {
if (md instanceof BaseTreeModel) {
@SuppressWarnings("unchecked")
final M child = (M) md;
deselect(child);
deselectChildren(child);
}
}
}
示例5: selectChildren
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
private void selectChildren(final M m, final boolean keepExisting) {
for (final ModelData md : m.getChildren()) {
if (md instanceof BaseTreeModel) {
@SuppressWarnings("unchecked")
final M child = (M) md;
select(child, keepExisting);
selectChildren(child, keepExisting);
}
}
}
示例6: Folder
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
public Folder(String name, BaseTreeModel[] children) {
this(name);
for (int i = 0; i < children.length; i++) {
add(children[i]);
}
}
示例7: getHours
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
@Override
public BaseTreeModel getHours(Integer assignmentId, Integer departmentId) {
Assignment assignment = assignmentDAO.getAssignmentById(assignmentId);
Department department = departmentDAO.getDepartmentById(departmentId);
BaseTreeModel root = new BaseTreeModel();
root.set("name", "root");
root.set("id", 99999999);
Random randomGenerator = new Random();
Map<User, List<Hour>> map = hourDAO.getHours(assignment, department);
for (Map.Entry<User, List<Hour>> m : map.entrySet()) {
List<Hour> list = m.getValue();
Hour rootHour = list.get(0);
BaseTreeModel b = new BaseTreeModel();
b.set("name", m.getKey().getFullName());
b.set("id", randomGenerator.nextInt(100000));
b.set("assignment", rootHour.getAssignment().getName());
b.set("hour", rootHour.getHour());
b.set("inratesum", rootHour.getInratesum());
b.set("extratesum", rootHour.getExtratesum());
list.remove(0);
if (assignment.getLevel() == 0) {
for (Hour h : list) {
// if(!h.getAssignment().getFirst()){
BaseTreeModel child = new BaseTreeModel();
child.set("name", m.getKey().getFullName());
child.set("id", randomGenerator.nextInt(100000));
child.set("assignment", h.getAssignment().getName());
child.set("hour", h.getHour());
child.set("inratesum", h.getInratesum());
child.set("extratesum", h.getExtratesum());
b.add(child);
// }
}
}
root.add(b);
}
return root;
}
示例8: getHours
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
public BaseTreeModel getHours(UserDTO userDTO,Date date) throws Exception;
示例9: getHours
import com.extjs.gxt.ui.client.data.BaseTreeModel; //导入依赖的package包/类
public void getHours(UserDTO userDTO,Date date, AsyncCallback<BaseTreeModel> callback);