Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Overriding standard commands(eclipse plugin which overrides standard command)
Overriding standard commands [message #1736870] Mon, 04 July 2016 06:09 Go to next message
Karthika Nair is currently offline Karthika NairFriend
Messages: 3
Registered: June 2016
Junior Member
Hello there!
I'm developing a plugin wherein I'm trying to write a new handle for eclipse commands Run and Build Project.
I've modified the plugin.xml file to declare the command like so:
  <command
         
            id="org.eclipse.ui.project.buildProject"
            name="Build Project">
      </command>



I've also extended handlers and used theactivewhen restriction to give my handler greater priority than the customhandler :
 
  </extension>
<extension
       point="org.eclipse.ui.handlers">
    <handler
          class="%MyHandler"
          commandId="org.eclipse.ui.project.buildProject">
       <activeWhen>
       
        <with variable="activePartId">
         <equals value="myactiveid"/>
    	 </with>
    
     </activeWhen>
      
    </handler>
       
</extension>


I've used the Alt+shift+F1 spy to check that my id is active and indeed, it is active when I call the build command.

I've extended org.eclipse.ui.startup to rule out the possibility of lazy loading.
   <extension
         point="org.eclipse.ui.startup">
      <startup
            class="customplugin.StartupClass">
      </startup>
   </extension>

Despite all this, the default handler for both commands is still taken to be the inbuilt eclipse handler. Is there something I'm missing/doing wrong?

I read here
http://stackoverflow.com/questions/28132938/eclipse-plugin-overriding-standard-command-handler
that commands like run cannot be overriden. Is this true? Can this source be trusted?
Re: Overriding standard commands [message #1736997 is a reply to message #1736870] Tue, 05 July 2016 03:50 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3501
Registered: July 2009
Senior Member

I trust it, but why would being able to override those ever be a good thing?

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Overriding standard commands [message #1737005 is a reply to message #1736997] Tue, 05 July 2016 06:08 Go to previous message
Karthika Nair is currently offline Karthika NairFriend
Messages: 3
Registered: June 2016
Junior Member
The plugin isn't working with vanilla java applications. Hence, I want build to automatically gradle build. Similarly run to automatically call scripts for deployment.

[Updated on: Tue, 05 July 2016 06:10]

Report message to a moderator

Previous Topic:Setting a Korean -Duser.name in eclipse.ini
Next Topic:Scala in Eclipse
Goto Forum:
  


Current Time: Mon Sep 16 20:16:19 GMT 2019

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

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

Back to the top