Пример #1
0
 public CommonModelField findCommonModelField(int fieldId) {
   for (CommonModel c : getCommonModelList()) {
     for (CommonModelField f : c.getCommonModelFieldList()) {
       if (f.getId() == fieldId) return f;
     }
   }
   return null;
 }
Пример #2
0
 // 删除项目旧model的字段数据
 public void removeCommonModelField(int id, Session session) {
   CommonModelField commonModelField = this.findCommonModelField(id);
   if (commonModelField != null
       && commonModelField.getCommonModel() != null
       && commonModelField.getCommonModel().getCommonModelFieldList() != null) {
     commonModelField.getCommonModel().getCommonModelFieldList().remove(commonModelField);
     session.delete(commonModelField);
   }
 }
Пример #3
0
 private void getCommonModelHTMLSub(StringBuilder html, List<CommonModelField> list, short level) {
   for (CommonModelField f : list) {
     html
         // .append("<tr class=\"tr-level-" + level + "\">")
         // .append("<td class=\"td-name\">" + levelMark(level) +
         // StringUtils.escapeInH(p.getName()) + "</td>")
         .append(
             "<td class=\"td-identifier\">" + StringUtils.escapeInH(f.getIdentifier()) + "</td>")
         .append("<td class=\"td-type\">" + StringUtils.escapeInH(f.getDatatype()) + "</td>")
         // .append("<td class=\"td-need\">" + StringUtils.escapeInH(f.getNeeded()) + "</td>")
         .append("<td class=\"td-need\">" + (f.getNeeded() == 1 ? "是" : "否") + "</td>")
         .append("<td class=\"td-remark\">" + StringUtils.escapeInH(f.getDescription()) + "</td>")
         .append("</tr>");
     /*if (p.getParameterList() != null || p.getParameterList().size() > 0) {
     	getParameterListHTMLSub(html, p.getParameterList(), (short)(level + 1));
     }*/
   }
 }
Пример #4
0
 public void addCommonModelField(CommonModelField commonModelField) {
   getCommonModelFieldList().add(commonModelField);
   commonModelField.setCommonModel(this);
 }