Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Hide lements in a TreeSelectorDialog
Hide lements in a TreeSelectorDialog [message #1645484] Mon, 02 March 2015 14:37 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
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 14:43 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


Camille Letavernier
Re: Hide lements in a TreeSelectorDialog [message #1647005 is a reply to message #1645493] Tue, 03 March 2015 07:51 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 195
Registered: January 2013
Location: Sweden
Senior Member
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 10:14 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 952
Registered: February 2011
Senior Member
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


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


Current Time: Thu Apr 25 20:22:31 GMT 2024

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

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

Back to the top