1
我具有延伸org.eclipse.jface.dialogs.Dialog覆蓋無效org.eclipse.jface.viewers.StructuredViewer.setInput(對象輸入)
我使用的org.eclipse.jface.viewers一個類.TableViewer類似於...
private TableViewer tableViewer = new TableViewer(newCntr, SWT.SINGLE|SWT.FULL_SELECTION|SWT.BORDER);
tableViewer.setInput(setOfObjects);
我將允許用戶從UI中進行刪除。我不想從該集合中刪除,而是想用一個屬性標記該對象,而不是將它列在TableViewer上。但是,TableViewer會列出集合中的所有內容。我應該重寫這個方法嗎?我在下面提供了它......謝謝!
public final void setInput(Object input) {
Control control = getControl();
if (control == null || control.isDisposed()) {
throw new IllegalStateException(
"Need an underlying widget to be able to set the input." + //$NON-NLS-1$
"(Has the widget been disposed?)"); //$NON-NLS-1$
}
try {
// fInChange= true;
unmapAllElements();
super.setInput(input);
} finally {
// fInChange= false;
}
}