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;
}
}