use of com.cas.sim.tis.entity.Catalog in project TeachingInSimulation by ScOrPiOzzy.
the class PreparationMenu method initializeContent.
private void initializeContent(TitledPane pane, Catalog project) {
List<Catalog> tasks = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(project.getId());
VBox box = new VBox(10);
for (Catalog task : tasks) {
ToggleButton taskBtn = new ToggleButton(task.getName());
taskBtn.setGraphic(createGraphicTitle(task));
taskBtn.getStyleClass().add("titled-content-btn");
taskBtn.setOnAction(e -> {
// TODO 加载备课详情
PageController controller = SpringUtil.getBean(PageController.class);
controller.loadContent(new PreparationDetail(task), PageLevel.Level1);
});
box.getChildren().add(taskBtn);
group.getToggles().add(taskBtn);
}
pane.setContent(box);
}
use of com.cas.sim.tis.entity.Catalog in project TeachingInSimulation by ScOrPiOzzy.
the class PreparationMenu method initialize.
/**
* 界面初始化
* @param catalog
*/
private void initialize(Catalog subject) {
this.subject.setText(subject.getName());
this.projects.getPanes().clear();
this.group.getToggles().clear();
List<Catalog> projects = SpringUtil.getBean(CatalogAction.class).findCatalogsByParentId(subject.getId());
for (Catalog project : projects) {
TitledPane pane = new TitledPane();
pane.setOnMousePressed(e -> {
if (pane.getContent() == null) {
initializeContent(pane, project);
pane.setOnMousePressed(null);
}
});
pane.setGraphic(createGraphicTitle(project));
this.projects.getPanes().add(pane);
}
}
use of com.cas.sim.tis.entity.Catalog in project TeachingInSimulation by ScOrPiOzzy.
the class CatalogServiceImpl method findCatalogsByParentId.
@Override
public List<Catalog> findCatalogsByParentId(Integer rid) {
Condition condition = new Condition(Catalog.class);
Criteria criteria = condition.createCriteria();
criteria.andEqualTo("rid", rid);
criteria.andEqualTo("del", 0);
CatalogMapper catalogMapper = (CatalogMapper) mapper;
catalogMapper.selectByCondition(condition);
List<Catalog> catalogs = null;
try {
catalogs = catalogMapper.selectByCondition(condition);
LOG.debug("查询到子节点数量:{}", catalogs.size());
} catch (Exception e) {
LOG.error("查询ID{}下子节点失败!", rid);
catalogs = Collections.emptyList();
}
return catalogs;
}
Aggregations