Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » PopupMenu objectContribution
PopupMenu objectContribution [message #327353] Wed, 16 April 2008 09:40 Go to next message
Eclipse UserFriend
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 #327366 is a reply to message #327353] Wed, 16 April 2008 16:09 Go to previous messageGo to next message
Toby Weston is currently offline Toby WestonFriend
Messages: 22
Registered: July 2009
Junior Member
Thanks, seems reasonable, add a SWT.PaintItem listener... do you know if this is likely to work in combination with a label provider (who's getColumnImage returns null)?

I'm trying it and having problems...

The getColumnImage gets called first it seems, then the event listener for SWT.PaintItem, so I'll keep playing, just wondered if you knew in principle if it was likely to work.

Cheers ears


http://www.eclipsezone.com/eclipse/forums/m92233118.html
Re: PopupMenu objectContribution [message #327385 is a reply to message #327353] Thu, 17 April 2008 07:32 Go to previous messageGo to next message
Eclipse UserFriend
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 #327396 is a reply to message #327385] Thu, 17 April 2008 14:33 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: PopupMenu objectContribution [message #327411 is a reply to message #327396] Fri, 18 April 2008 00:58 Go to previous messageGo to next message
Eclipse UserFriend
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 #327428 is a reply to message #327411] Fri, 18 April 2008 14:26 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: PopupMenu objectContribution [message #327430 is a reply to message #327428] Fri, 18 April 2008 14:59 Go to previous message
Eclipse UserFriend
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
>
>
Previous Topic:PDE Build with Packager
Next Topic:Fullscreen view
Goto Forum:
  


Current Time: Sun Jul 07 06:13:31 GMT 2024

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

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

Back to the top