Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHide lements in a TreeSelectorDialog
https://www.eclipse.org/forums/index.php/mv/msg/1022349/1645484/#msg_1645484
Is it somehow possible to hide element in a org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog?
I can control the if they are valid objects and thus selectable using the SemanticUMLContentProvider#isValidValue() method.
/Patrik]]>Patrik Nandorf2015-03-02T14:37:27-00:00Re: Hide lements in a TreeSelectorDialog
https://www.eclipse.org/forums/index.php/mv/msg/1022349/1645493/#msg_1645493
If isValidValue() returns false for an element + all its children, then the element shouldn't be displayed. If it returns false for an element, but true for at least one child, then the element should be displayed but not selectable.
If you want to add additional filters, you can use a JFace ViewerFilter (Which can be installed by the ContentProvider)
Camille]]>Camille Letavernier2015-03-02T14:43:48-00:00Re: Hide lements in a TreeSelectorDialog
https://www.eclipse.org/forums/index.php/mv/msg/1022349/1647005/#msg_1647005
Patrik Nandorf2015-03-03T07:51:01-00:00Re: Hide lements in a TreeSelectorDialog
https://www.eclipse.org/forums/index.php/mv/msg/1022349/1647229/#msg_1647229
I'm not sure in which context you are using the dialog; but the Dialog takes a ContentProvider as a parameter. This ContentProvider is then used to populate the TreeViewer. At this point, the method IContentProvider#inputChanged(Viewer, Object, Object) is called, so you can get access to the Viewer there (provided that you can implement/override the ContentProvider). That's how the filter is implemented in e.g. the WorkspaceContentProvider (Which adds a filter for file extensions)