2009-10-06 5 views
1

개별 JFace TextCellEditor 필드를 활성화/비활성화 할 수 있는지 누구나 알고 있습니다. 예를 들어 DIsable JFace TextCellEditor 필드

나는 5 열이있는 테이블이있는 경우

, 나는 필드 # 4 채워되지 않는 마지막 셀이 비어되고 싶어요.

답변

4

당신이 EditingSupport 클래스를 사용하는 경우 반환 canEdit을 설정할 수 있습니다 참된.

TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE); 

EditingSupport editingSupport = new EditingSupport(viewer) 
{ 
    ... implement abstract methods ... 

    protected boolean canEdit(Object element) 
    { 
     return (/* criteria to determine if this column is editable*/) 
    } 
}; 

column.setEditingSupport(editingSupport); 
+0

감사합니다. 필요한 사항 일 수 있습니다. 오늘 이걸 시도 할거야 ... 내가 그 녹색 체크 박스를 확인할 수 있기를 희망한다. –

+0

ICellModifier를 구현하는 CellModifier를 만들어서 조금 다르게 끝냈다. 그냥 canEdit보다 더 좋은 것을 찾을 수 있으면 좋겠다. field –

+0

@PSU_Kardi : 비슷한 문제에 직면하고 있습니다. 나는 EditingSupport로 시도했다. 하지만 전체 행을 회색으로 표시하고 싶습니다. 너 혹시 나 한테 아이디어 좀 주실 수 있니? – Acjb