PopupMenu objectContribution [message #327353] |
Wed, 16 April 2008 09:40 |
Eclipse User |
|
|
|
Originally posted by: jefftymc.yahoo.com
Hi,
I currently have a popupMenu in an objectContribution for
IResource. The plugin.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension point="org.eclipse.ui.popupMenus">
<objectContribution
adaptable="true"
id="test.ResourceMapperContributions"
objectClass="org.eclipse.core.resources.mapping.ResourceMapping ">
<action
class="com.test.TestAction"
enablesFor="+"
id="test.action"
label="test">
</action>
</objectContribution>
</extension>
</plugin>
While right clicking on file, folder or project in the Package
Explorer, the action will display in the popupMenu. But it disappears
when I click on a file in "Synchronize" viewer of "Team Synchronizing"
perspective.
When created the plug-in project I choosed "Eclipse 3.4" in the
field of "Target Platform". Does it matter?
Would you please help about this?
Thanks in advance.
|
|
|
|
Re: PopupMenu objectContribution [message #327385 is a reply to message #327353] |
Thu, 17 April 2008 07:32 |
Eclipse User |
|
|
|
Originally posted by: jefftymc.yahoo.com
I modified the contribution like this:
<viewerContribution
id="com.test"
targetID="org.eclipse.team.ccvs.ui.RepositoriesView">
<action
class="com.test.TestAction"
definitionId="org.eclipse.ui.edit.paste1"
enablesFor="*"
id="test.ResourceMapperContributions"
menubarPath="miscGroup"
label="testLabel">
</action>
</viewerContribution>
TestAction extends ActionDelegate and implements IViewActionDelegate,
the action display in "CVS Repositories" (the id is
"org.eclipse.team.ccvs.ui.RepositoriesView") View.
So I think if I change the targetID to "Synchronize" View's ---
"org.eclipse.team.sync.views.SynchronizeView" the action will display in
the context menu of Synchronize View.
But it didn't. What's wrong with that?
Thanks a lot!
jeffty wrote:
> Hi,
> I currently have a popupMenu in an objectContribution for IResource.
> The plugin.xml is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.2"?>
> <plugin>
> <extension point="org.eclipse.ui.popupMenus">
> <objectContribution
> adaptable="true"
> id="test.ResourceMapperContributions"
> objectClass="org.eclipse.core.resources.mapping.ResourceMapping ">
> <action
> class="com.test.TestAction"
> enablesFor="+"
> id="test.action"
> label="test">
> </action>
> </objectContribution>
> </extension>
> </plugin>
>
> While right clicking on file, folder or project in the Package
> Explorer, the action will display in the popupMenu. But it disappears
> when I click on a file in "Synchronize" viewer of "Team Synchronizing"
> perspective.
> When created the plug-in project I choosed "Eclipse 3.4" in the
> field of "Target Platform". Does it matter?
>
> Would you please help about this?
> Thanks in advance.
|
|
|
|
Re: PopupMenu objectContribution [message #327411 is a reply to message #327396] |
Fri, 18 April 2008 00:58 |
Eclipse User |
|
|
|
Originally posted by: jefftymc.yahoo.com
Then we cann't add a menuItem to this View manually?
Paul Webster wrote:
> jeffty wrote:
>
>> TestAction extends ActionDelegate and implements
>> IViewActionDelegate, the action display in "CVS Repositories" (the id
>> is "org.eclipse.team.ccvs.ui.RepositoriesView") View.
>> So I think if I change the targetID to "Synchronize" View's ---
>> "org.eclipse.team.sync.views.SynchronizeView" the action will display
>> in the context menu of Synchronize View.
>> But it didn't. What's wrong with that?
>
>
> The Sync view doesn't register a context menu with the system (at least
> it doesn't look like it does, from ALT+SHIFT+F1) so there's nothing to
> add to.
>
> PW
>
>
|
|
|
|
Re: PopupMenu objectContribution [message #327430 is a reply to message #327428] |
Fri, 18 April 2008 14:59 |
Eclipse User |
|
|
|
Originally posted by: jefftymc.yahoo.com
Thanks Paul, I won't waste time on the popupmenu then. :)
Paul Webster 写道:
> jeffty wrote:
>> Then we cann't add a menuItem to this View manually?
>
> Not to the popup menu, only to the view dropdown menu.
>
> PW
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04012 seconds