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 16:06 Go to next message
sabrina ing is currently offline sabrina ing
Messages: 39
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] Tue, 26 February 2013 22:16 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. Damus
Messages: 756
Registered: July 2009
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 04:38 Go to previous messageGo to next message
sabrina ing is currently offline sabrina ing
Messages: 39
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 09:24 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. Damus
Messages: 756
Registered: July 2009
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 09:20 Go to previous message
sabrina ing is currently offline sabrina ing
Messages: 39
Registered: February 2013
Member
Hi,


Thanks for your help Smile

[Updated on: Thu, 28 February 2013 09: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: Tue Jul 22 11:45:08 EDT 2014

Powered by FUDForum. Page generated in 0.03333 seconds