나는 기본적으로 레이블, 콤보 및 버튼, 일렬로 정렬 된 모든 숫자로 구성된 형태의 컨테이너입니다 ... 거기에 몇 가지 물건으로Composite 객체의 모든 자식을 처리하는 방법은 무엇입니까?
Composite descComp
을 HAVA. 양식이 유한 한 것이 아니며 추가 입력을 위해 한 줄을 추가하는 버튼이 있습니다. 그러나 그 어떤 이유로
descComp.getChildren()[i].dispose();
, 그것은 늘 모든 아이를 폐기 의미 작동 할 수없는 결과를 위해 ... 그것이 내가 내 descComp의 세 아동을 폐기해야 솔기
private void populateConstantMain(ContentData tariffConstantsOfType, Composite descComp,GridLayout descCompLayout, Boolean resize) {
int arraySize;
if (resize == false) {
arraySize = tariffConstantsOfType.getQueryRowCount();
} else {
for (int i = 0 ; i < descComp.getChildren().length; i++) {
System.out.println("Disposing: " + i + " " + descComp.getChildren()[i].toString());
//descComp.getChildren()[i].setEnabled(false);
descComp.getChildren()[i].dispose();
}
arraySize = tariffConstantsOfType.getQueryRowCount() + 1;
}
......
}
를 작동하려면 따라서 새로운 아이를 삽입 레이아웃을 망치고의 오류 :/흥미로운 점은 그 나는 모든 아이들을 위해, 그것을 uncoment
descComp.getChildren()[i].setEnabled(false);
작품, ...
이 답변에 투표하십시오. 나는 그것을 작동 내기! –
굉장! 정말 고맙습니다 ! 그것은 작동합니다 :) – mentis
남자 나는 어쨌든 런타임 예외를 얻는다 : D 내 경우에는 합성/라디오'Button's를 재설정/repopulating. 어떤 생각? – Campa