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.TreeFillingConfigurationDialog_elementDialogName); final UMLFeatureRestrictedContentProvider contentProvider = new UMLFeatureRestrictedContentProvider(null, false) { @Override public Object[] getChildren(final Object parentElement) { List<Object> childrenList = Arrays.asList(super.getChildren(parentElement)); if (parentElement instanceof EClass) { childrenList = new ArrayList<Object>(childrenList); final EClass eClass = (EClass) parentElement; if (isIgnoringInheritedElements()) { childrenList.addAll(eClass.getEOperations()); } else { childrenList.addAll(eClass.getEAllOperations()); } childrenList.remove(EcorePackage.eINSTANCE.getEModelElement_EAnnotations()); } return childrenList.toArray(); } }; 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 isTypeNeeded(element); } }; 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) { setAxisElement(null); } else { Object selectedValue = newValue[0]; setAxisElement(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.TreeFillingConfigurationDialog_elementDialogName); final UMLFeatureRestrictedContentProvider contentProvider = new UMLFeatureRestrictedContentProvider(null, false) { @Override public Object[] getChildren(final Object parentElement) { List<Object> childrenList = Arrays.asList(super.getChildren(parentElement)); if (parentElement instanceof EClass) { childrenList = new ArrayList<Object>(childrenList); final EClass eClass = (EClass) parentElement; if (isIgnoringInheritedElements()) { childrenList.addAll(eClass.getEOperations()); } else { childrenList.addAll(eClass.getEAllOperations()); } childrenList.remove(EcorePackage.eINSTANCE.getEModelElement_EAnnotations()); } return childrenList.toArray(); } }; 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 isTypeNeeded(element); } }; 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) { setAxisElement(null); } else { setAxisElement(newValue[0]); } } }