Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » visibleWhen : test the stereotype of the selected element
visibleWhen : test the stereotype of the selected element [message #1777126] Fri, 24 November 2017 18:27 Go to next message
Jules Franc is currently offline Jules FrancFriend
Messages: 5
Registered: May 2016
Junior Member
Hello,

I just started to learn how to develop an Eclipse plugin.
I would like to use it in Papyrus (the UML/SysML modeler).

I would like to add an element in the right click menu if the selected element is a block (a block is a SysML stereotype) with a custom profile (called "myStereotype").

My XML now looks like that :

            <command
                  commandId="TestPopupMenu.commands.sampleCommand"
                  mnemonic="S"
                  id="TestPopupMenu.menus.sampleCommand">
                  <visibleWhen>
						<with variable="activeMenuSelection">
							<iterate ifEmpty="false">
								???
							</iterate>
						</with>
				</visibleWhen> 
            </command>


How to check if the selected element has the profile "myStereotype" ?

I found "instanceof" on Eclipse' website:
https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_cmd_expressions.htm

Is it the right thing to use ?

Thank you very much!
Re: visibleWhen : test the stereotype of the selected element [message #1780572 is a reply to message #1777126] Wed, 24 January 2018 00:20 Go to previous message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 432
Registered: July 2009
Senior Member

Hi Jules,

We don't know papyrus. Maybe you should ask in that forum. If you want to test on a tree item element, it might be possible to use the plugin spy ALT+SHIFT+F1 to get the class. You can use the class of the selected object in the core expression.

Another idea is to inspect the menu entries of the papyrus plugins. If you can find one of their menu options maybe you can mimic it.

Best regards,

Wim
Previous Topic:Show Splash screen on double clicking System tray icon
Next Topic:P2 site
Goto Forum:
  


Current Time: Sun Sep 23 18:05:48 GMT 2018

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

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

Back to the top