Class AttributeOptionTreeSupport

java.lang.Object
com.easydesk.web.support.AttributeOptionTreeSupport

public final class AttributeOptionTreeSupport extends Object
AttributeOption 들을 부모/자식(A_PARENT_CHILD_B) 관계대로 tree 로 보여주기 위한 공용 로직. Attribute 상세(admin-attribute-detail), ItemTypeAttribute 상세(admin-item-type-attribute), ModuleAttribute 상세(admin-module-attribute) 세 화면이 같은 규칙을 쓰므로 여기로 뽑았다. core 의 Attribute#getTopAttributeOptions() 로 맨 상위 Option 들을 구하고, 각 Option 의 AttributeOption#getChildren() 으로 내려가면서 tree 를 만든다 (형제끼리는 core 가 돌려주는 PreferredOrder 순서 그대로). 삭제(removed) 처리된 Option 은 그 아래 subtree 까지 함께 제외한다 - 기존 화면이 쓰던 attribute.getAttributeOptions(false) 와 같은 기준. 화면(Thymeleaf)에서는 재귀 fragment 대신 flatten(List) 로 펼친 AttributeOptionTreeSupport.Row 목록을 그대로 table 의 tr 로 뿌린다. 각 Row 의 prefix("│ ├─ " 같은 문자열)를 이름 앞에 고정폭으로 찍어 주면 table 의 다른 column(Active/Order 등)은 그대로 유지하면서 이름 column 만 tree 모양이 된다.