skazsi / multiproperties

MultiProperties Editor is an Eclipse plugin for editing multiple key-value based files with similar content.
http://marketplace.eclipse.org/content/multiproperties
8 stars 1 forks source link

Conflicting handlers for org.eclipse.ui.edit.delete #40

Closed wutzebaer closed 5 years ago

wutzebaer commented 5 years ago

I get this error in my error log, and i cannot delete entries, seems there is an conflict with the mailsnag plugin (https://github.com/foosbar/mailsnag)

eclipse.buildId=4.9.0.I20180906-0745
java.version=1.8.0_144
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.ui
Error
Wed Mar 27 12:03:45 CET 2019
Conflicting handlers for org.eclipse.ui.edit.delete: {com.foosbar.mailsnag.commands.DeleteMessage@14422403} vs {hu.skzs.multiproperties.ui.command.DeleteHandler}
skazsi commented 5 years ago

It is a problem with the MailSnag plugin. The UI delete command should only be hooked for its delete handler when its own editor is active and some other criteria. I checked its code, and the editor type is not checked. This the multiproperties definition for hooking the delete command, note in the beginning the condition that the active editor should be the multiproperties.

      <definition id="hu.skzs.multiproperties.ui.definition.hasSelection">
        <and>
            <with variable="activeEditor">
                <instanceof value="hu.skzs.multiproperties.ui.editor.Editor"/>
            </with>
            <with variable="selection">
                <and>
                    <count value="+"/>
                    <iterate ifEmpty="false" operator="and">
                        <instanceof value="hu.skzs.multiproperties.base.model.AbstractRecord"/>
                    </iterate>
                </and>
            </with>
        </and>
      </definition>

Here is the MailSnag similar definition:

      <definition
            id="oneElementSelected">
         <with
               variable="selection">
            <not>
               <count
                     value="0">
               </count>
            </not>
         </with>
      </definition>

Nothing can be done in MultiProperties.