Source:
protected void browseAction(final Object value) { final ITreeSelectorDialog dialog = new TreeSelectorDialog(getShell()) { @Override protected void initViewerAndProvider() { super.initViewerAndProvider(); getViewer().setComparator(new ViewerComparator(new StringComparator())); } }; dialog.setTitle(org.eclipse.papyrus.customization.nattableconfiguration.messages.Messages.FeatureFillingConfigurationDialog_listenFeatureDialogName); final UMLFeatureRestrictedContentProvider contentProvider = new UMLFeatureRestrictedContentProvider(null, false); final ReferenceSelector selector = new ReferenceSelector(false) { @Override public void createControls(Composite parent) { super.createControls(parent); this.treeViewer.setComparator(new ViewerComparator(new StringComparator())); } }; selector.setLabelProvider(labelProvider); selector.setContentProvider(contentProvider); final ITreeContentProvider treeContentProvider = new FlattenableRestrictedFilteredContentProvider((IRestrictedContentProvider) contentProvider, selector) { @Override public boolean isValidValue(final Object element) { return element instanceof EReference && ((EReference) element).isMany() && element != EcorePackage.eINSTANCE.getEModelElement_EAnnotations(); } }; dialog.setContentProvider(treeContentProvider); dialog.setLabelProvider(labelProvider); if (null != value) { dialog.setInitialElementSelections(Collections.singletonList(value)); } int result = dialog.open(); if (Window.OK == result) { Object[] newValue = dialog.getResult(); if (null == newValue) { return; } if (0 == newValue.length) { setListenFeature(null); } else { Object selectedValue = newValue[0]; setListenFeature((EStructuralFeature) selectedValue); } } }

Target:
protected void browseAction(final Object value) { final ITreeSelectorDialog dialog = new TreeSelectorDialog(getShell()) { @Override protected void initViewerAndProvider() { super.initViewerAndProvider(); getViewer().setComparator(new ViewerComparator(new StringComparator())); } }; dialog.setTitle(org.eclipse.papyrus.customization.nattableconfiguration.messages.Messages.FeatureFillingConfigurationDialog_listenFeatureDialogName); final UMLFeatureRestrictedContentProvider contentProvider = new UMLFeatureRestrictedContentProvider(null, false); final ReferenceSelector selector = new ReferenceSelector(false) { @Override public void createControls(Composite parent) { super.createControls(parent); this.treeViewer.setComparator(new ViewerComparator(new StringComparator())); } }; selector.setLabelProvider(labelProvider); selector.setContentProvider(contentProvider); final ITreeContentProvider treeContentProvider = new FlattenableRestrictedFilteredContentProvider((IRestrictedContentProvider) contentProvider, selector) { @Override public boolean isValidValue(final Object element) { return element instanceof EReference && ((EReference) element).isMany() && element != EcorePackage.eINSTANCE.getEModelElement_EAnnotations(); } }; dialog.setContentProvider(treeContentProvider); dialog.setLabelProvider(labelProvider); if (null != value) { dialog.setInitialElementSelections(Collections.singletonList(value)); } int result = dialog.open(); if (Window.OK == result) { Object[] newValue = dialog.getResult(); if (null == newValue) { return; } if (0 == newValue.length) { setListenFeature(null); } else { setListenFeature((EStructuralFeature) newValue[0]); } } }