0
는 이클립스 마법사에 대해 다음 Java 코드를 관련하여 모든 항목을 제거한 후 남아 : 내가 한 번만이 페이지를 호출 할 때는 - 사용자 정의 위젯은
public class PageTypes extends WizardPage
{
private Table types;
@Override
public void setVisible(boolean visible)
{
// if we get visible, we want to update the tables!
if(visible)
initialize();
super.setVisible(visible);
}
private void initialize()
{
types.setRedraw(false);
types.removeAll();
types.setRedraw(true);
...
//getting data from database and start a cycle for adding rows
...
//adding data for cells in first two columns: plain text - no problems here
...
TableEditor editor = new TableEditor (types);
Button checkButton = new Button(types, SWT.CHECK);
checkButton.setSelection(true);
checkButton.pack();
editor.minimumWidth = checkButton.getSize().x;
editor.horizontalAlignment = SWT.CENTER;
editor.setEditor(checkButton, item, 2);
...
//here comes another widget (comboBox) for the fourth column
...
}
}
이 지금까지 작동합니다. 다시 돌아가서 다시 전달하면 removeAll()은 모든 일반 텍스트 항목을 제거하지만 checkButtons 및 comboBoxes로는 아무 것도 수행하지 않습니다. 그래서 테이블을 다시 그리면 요소가 두 번 나타납니다. 페이지간에 전환하는 동안 다른 데이터 소스를 선택하면 더 이상해 보입니다.
어떤 제안 : 여기 내 문제가 더 명확하게 할 수있는 스크린 샷은입니까?
에서 캐롤린 MacLeod에에
감사합니다. –
감사합니다.이 솔루션도 고려할 것입니다. –