Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:31:43+00:00 2026-06-12T18:31:43+00:00

The Eclipse command framework allows you to create a generic command and handler. However,

  • 0

The Eclipse command framework allows you to create a generic command and handler. However, when you create an extension point that targets ‘copy’ the runtime complains:

<extension point="org.eclipse.ui.handlers">
 <handler class="example.Handler" commandId="org.eclipse.ui.edit.copy"/>
</extension>

!MESSAGE Conflicting handlers for org.eclipse.ui.edit.copy: {org.eclipse.ui.internal.handlers.WidgetMethodHandler:copy} vs {example.Handler}

If you add an activeWhen clause, so that the special handler is only invoked when an object of a particular type is selected in a viewer, then you get an exception when you try and copy:

<extension point="org.eclipse.ui.handlers">
 <handler class="example.Handler" commandId="org.eclipse.ui.edit.copy">
     <activeWhen>
        <with
              variable="selection">
           <iterate
                 ifEmpty="false"
                 operator="or">
              <instanceof
                    value="sample.Class">
              </instanceof>
           </iterate>
        </with>
     </activeWhen>
   </handler>
</extension>

Caused by: org.eclipse.core.commands.NotHandledException: There is no handler to execute for command org.eclipse.ui.edit.copy

What’s the right way of using the commands framework to provide a specific copy operation for objects of a particular type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:31:44+00:00Added an answer on June 12, 2026 at 6:31 pm

    Your activeWhen clause looks acceptable. What will matter is what selection you are going for. ex:

      <handler class="z.ex.cmd.handlers.LongCopyHandler"
            commandId="org.eclipse.ui.edit.copy">
         <activeWhen>
            <with variable="selection">
               <iterate ifEmpty="false"
                     operator="and">
                  <adapt type="org.eclipse.core.resources.IMarker"/>
               </iterate>
            </with>
         </activeWhen>
      </handler>
    

    I originally tried instanceof in my activeWhen expression to get access to the IMarkers in the markers view, but that didn’t work (the objects don’t implement IMarker). I had to adapt them to get my handler to work correctly. This would apply to .java files in the Package Explorer as well, they adapt to an IResource but they’re actually IJavaElements or something.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

...or will I break Eclipse integration? That's what happened when I did corresponding command
The Eclipse RCP command framework is intended to replace the action framework as the
I would like to see the command that Eclipse is running when I hit
Command : \eclipse-SDK-4.2RC3-win32-x86_64_001\eclipse\plugins>java -jar org.eclipse.osgi_3.8.0.v20120529-1548.jar -console Exception (from Log files) !SESSION 2012-06-22 23:36:27.649 -----------------------------------------------
how do I configure an Eclipse RCP command style menu to match the different
I would like to connect to java process started by eclipse using a command
$ eclipse -console The above command opens OSGi console and Eclipse IDE in different
Possible Duplicate: Can I run from command line program created by Eclipse? I am
I'm having trouble setting the command-line arguments in Eclipse. I've searched around the Internet
From my Eclipse plugin, I want to execute a command and show the results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.