Skip to main content



      Home
Home » Modeling » Papyrus » Hide lements in a TreeSelectorDialog
Hide lements in a TreeSelectorDialog [message #1645484] Mon, 02 March 2015 09:37 Go to next message
Eclipse UserFriend
Hi,

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
Re: Hide lements in a TreeSelectorDialog [message #1645493 is a reply to message #1645484] Mon, 02 March 2015 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi Patrik,

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
Re: Hide lements in a TreeSelectorDialog [message #1647005 is a reply to message #1645493] Tue, 03 March 2015 02:51 Go to previous messageGo to next message
Eclipse UserFriend
So simple... if I could access the JFace Treeviewer. The TreeSelectorDialog#getViewer() is protected and there is is no addFilter() method in TreeSelectorDialog.
Re: Hide lements in a TreeSelectorDialog [message #1647229 is a reply to message #1647005] Tue, 03 March 2015 05:14 Go to previous message
Eclipse UserFriend
Hi Patrik,

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)

HTH,
Camille
Previous Topic:Activity and CallOperationAction question
Next Topic:A methodological guid to model a system in SysML
Goto Forum:
  


Current Time: Sun Jul 13 16:50:38 EDT 2025

Powered by FUDForum. Page generated in 0.03923 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top