Jface TextCellEditor 필드를 비활성화합니다
문제
개별 Jface TextCellEditor 필드를 활성화/비활성화 할 수 있는지 알고 있습니다.
예를 들어 5 개의 열이있는 테이블이있는 경우 필드 #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);
제휴하지 않습니다 StackOverflow