if (fViewer instanceof AbstractTreeViewer) ((AbstractTreeViewer)fViewer).remove(elements);
Object[] newElements= getNewElements(elements); if (fViewer instanceof AbstractTreeViewer) { if (fViewer.testFindItem(parent) == null) { Object root= ((AbstractTreeViewer)fViewer).getInput(); if (root != null) ((AbstractTreeViewer)fViewer).add(root, newElements); } else ((AbstractTreeViewer)fViewer).add(parent, newElements); }
			public void run() {				Control ctrl= fViewer.getControl();				if (ctrl != null && !ctrl.isDisposed()) {					if (fViewer instanceof AbstractTreeViewer)						((AbstractTreeViewer)fViewer).remove(elements);					else if (fViewer instanceof ListViewer)						((ListViewer)fViewer).remove(elements);					else if (fViewer instanceof TableViewer)						((TableViewer)fViewer).remove(elements);				}			}