Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Eclipse Project MenuManager MenuListener MenuShown?(I want my code work when I press or before Project button is clicked in MenuManager)
Eclipse Project MenuManager MenuListener MenuShown? [message #1707627] Tue, 08 September 2015 05:55 Go to next message
ilke Muhtaroglu is currently offline ilke MuhtarogluFriend
Messages: 44
Registered: September 2015
Member
index.php/fa/23174/0/I want to override org.eclipse.ui.project.cleanAction.

Simple org.eclipse.ui. commands & handlers doesnt work because of structure of WorkbenchActionBuilder. I have solved it with code :


 MenuManager menu = (MenuManager) ((WorkbenchWindow)PlatformUI.getWorkbench().getActiveWorkbenchWindow()).getActionBars().getMenuManager();
    menu = (MenuManager) menu.find( "project" );
    menu.replaceItem( "buildClean", new ActionContributionItem( new ABCBuildCleanAction(  PlatformUI.getWorkbench().getActiveWorkbenchWindow() ) ) );



Now how can I make this code piece work when I press Project from menu? This is a MenuManager and I thought MenuAdapter (MenuListener) menuShown method can help but how can I make it run? I searched for a solution via plugin.xml Extensions but as which extension point should I add it?

Any Idea? Please don't hesitate to ask for more information...
  • Attachment: Project.jpg
    (Size: 68.10KB, Downloaded 241 times)

[Updated on: Tue, 08 September 2015 12:25]

Report message to a moderator

Re: Eclipse Project MenuManager MenuListener MenuShown? [message #1707973 is a reply to message #1707627] Fri, 11 September 2015 06:22 Go to previous message
ilke Muhtaroglu is currently offline ilke MuhtarogluFriend
Messages: 44
Registered: September 2015
Member
We put that code piece under : Bundle-Activator : in MANIFEST.MF file (It is the Activator.) That XXPlugin class extends AbstractUIPlugin class. In the start method I put my code to work.

This solved my problem, now when eclipse starts It loads this code and my code works instead of CleanDialog class...

ilke
Previous Topic:Migrate RAD projects to Eclipse
Next Topic:Add new Combo in CommitDialog
Goto Forum:
  


Current Time: Mon Oct 26 11:18:56 GMT 2020

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

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

Back to the top