Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » problem displaying popup menu(problem displaying popup menu)
problem displaying popup menu [message #1014932] Tue, 26 February 2013 21:06 Go to next message
Mariem Makni is currently offline Mariem MakniFriend
Messages: 46
Registered: February 2013
Member
Hi,

I'm doing a project using the Plug-in papyrus Marte in eclipse, I add a popup menu

named "named import platform" using commands and Handlers in the view of the Model

Explorer when creating a papyrus Model.

But the problem is that when I run handler with Eclipse Application for two or three

times, this popup menu will not be displayed.

Can you help me please.

Thanks in advance,

Best Regards,
Re: problem displaying popup menu [message #1014972 is a reply to message #1014932] Wed, 27 February 2013 03:16 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Sorry, can you be more clear? Is the pop-up menu displayed once but
then not again (second and third time)? What visibility and/or
enablement conditions do you have on the menu contribution and the
handler in the plugin.xml?

If this command is intended for a selection in the Model Explorer, you
should note that the Model Explorer presents instances of ITreeElement,
an internal interface in the EMF Facet project. These elements are
adaptable (via IAdaptable API) to EObject, so to get the actual
selected model elements, you need an <adapt
type="org.eclipse.emf.ecore.EObject"> expression in the XML.

HTH,

Christian


On 2013-02-26 21:06:15 +0000, Mariem Makni said:

> Hi,
>
> I'm doing a project using the Plug-in papyrus Marte in eclipse, I add a
> popup menu
> named "named import platform" using commands and Handlers in the view
> of the Model
>
> Explorer when creating a papyrus Model.
>
> But the problem is that when I run handler with Eclipse Application for
> two or three
> times, this popup menu will not be displayed.
>
> Can you help me please.
>
> Thanks in advance,
>
> Best Regards,
Re: problem displaying popup menu [message #1015045 is a reply to message #1014972] Wed, 27 February 2013 09:38 Go to previous messageGo to next message
Mariem Makni is currently offline Mariem MakniFriend
Messages: 46
Registered: February 2013
Member
Hi,

yes, the problem is the pop-up menu displayed once but then not again.
I don't understand how I should note that the Model Explorer presents instances of ITreeElement, an internal interface in the EMF Facet project.
can you explain me more .
This is the plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="true"
locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
<menu
id="com.cea.architect.implementation.commands.menu1"
label="platform-architect">
<command
commandId="com.cea.architect.implementation.commands.commandid"
label="import platform"
style="push">
</command>
<command
commandId="com.cea.architect.implementation.commands.commandidd"
label="Generate Implementation Model"
style="push">
</command>
</menu>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="com.cea.architect.implementation.commands.Handlers.ImportPlatformHandler"
id="com.cea.architect.implementation.commands.commandid"
name="launch import">
</command>
<command
defaultHandler="com.cea.architect.implementation.commands.Handlers.GenerateImplementationModelHandler"
id="com.cea.architect.implementation.commands.commandidd"
name="launch generate">
</command>
</extension>

</plugin>

Thanks for your help,
Re: problem displaying popup menu [message #1015123 is a reply to message #1015045] Wed, 27 February 2013 14:24 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

OK. I assumed that you would have had some XML enablement condition
restricting the menu actions to some particular kind of model element,
and that maybe this wasn't account for the need to adapt the selection
to an EObject. It seems that your action should be applicable to
absolutely any selection.

Eclipse's menus are often optimistically enabled: they only check
whether they are actually enabled the first time the user selects them,
because it requires loading code from some plug-in to do the enablement
test. After this, it is not uncommon to find that Eclipse pops up a
dialog saying that "This action is not currently enabled." or something
to that effect, after which it is actually disabled in the menu.

So, I'd suggest debugging your handler's enablement test (if it has
one) or checking the error log for exceptions in the initialization of
your handler or the pop-up menu or something.

In any case, this sounds like a more general platform UI question than
a Papyrus-specific issue, so you might find better guesses as to the
nature of your problem in the platform UI newsgroup.

HTH,

Christian


On 2013-02-27 09:38:18 +0000, Mariem Makni said:

> Hi,
>
> yes, the problem is the pop-up menu displayed once but then not again.
> I don't understand how I should note that the Model Explorer presents
> instances of ITreeElement, an internal interface in the EMF Facet
> project.
> can you explain me more .
> This is the plugin.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.4"?>
> <plugin>
> <extension
> point="org.eclipse.ui.menus">
> <menuContribution
> allPopups="true"
>
> locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup">
>
> <menu
> id="com.cea.architect.implementation.commands.menu1"
> label="platform-architect">
> <command
>
> commandId="com.cea.architect.implementation.commands.commandid"
> label="import platform"
> style="push">
> </command>
> <command
>
> commandId="com.cea.architect.implementation.commands.commandidd"
> label="Generate Implementation Model"
> style="push">
> </command>
> </menu>
> </menuContribution>
> </extension>
> <extension
> point="org.eclipse.ui.commands">
> <command
>
> defaultHandler="com.cea.architect.implementation.commands.Handlers.ImportPlatformHandler"
>
> id="com.cea.architect.implementation.commands.commandid"
> name="launch import">
> </command>
> <command
>
> defaultHandler="com.cea.architect.implementation.commands.Handlers.GenerateImplementationModelHandler"
>
> id="com.cea.architect.implementation.commands.commandidd"
> name="launch generate">
> </command>
> </extension>
>
> </plugin>
>
> Thanks for your help,
Re: problem displaying popup menu [message #1015418 is a reply to message #1015123] Thu, 28 February 2013 14:20 Go to previous message
Mariem Makni is currently offline Mariem MakniFriend
Messages: 46
Registered: February 2013
Member
Hi,


Thanks for your help Smile

[Updated on: Thu, 28 February 2013 14:21]

Report message to a moderator

Previous Topic:Behaviour Generation
Next Topic:How to call myAction when pressing the Next Button of myWizardPage
Goto Forum:
  


Current Time: Fri Mar 29 08:18:28 GMT 2024

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

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

Back to the top