netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Copy & paste options are disabled when editing XML files that use the "Object/relational mapping file schema"

Open negora opened this issue 3 years ago • 5 comments
trafficstars

Apache NetBeans version

Apache NetBeans 15

What happened

When you edit an XML file that uses the Object/relational mapping file schema (specifically, those that use the namespace http://xmlns.jcp.org/xml/ns/persistence/orm), the options Cut, Copy and Paste get disabled. This occurs in both the toolbar and also in the context menu of the editor.

Copying and pasting using the keyboard still works fine. However, sometimes, when you're using your mouse than your keyboard, it's more practical to do it using the GUI.

How to reproduce

I've been experiencing this error at least since version 8.2, I believe. I hadn't informed about it because it has been hard to reproduce. But today I've spent time investigating the cause and I think I've found the way:

  1. In a Java project based on Maven, create an XML file. For example, in src/main/resources/META-INF/.

  2. Write this code:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"/>
  1. Right-click on the editor and view that the options Cut, Copy and Paste are enabled in the context menu:

image

  1. Close the file (very important) and then, close NetBeans IDE. Not closing the file was the reason why I could never reproduce this error.

  2. Run NetBeans IDE and open the file again. Then, right-click on the editor and open the context menu, and view that the mentioned options are disabled now:

image

  1. The same happens with the toolbar. See:

image

Did this work correctly in an earlier version?

No / Don't know

Operating System

Debian GNU/Linux 11.5 (Bullseye)

JDK

OpenJDK Runtime Environment (build 17.0.4+8-Debian-1deb11u1)

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

I've tested this in versions 13, 14 and 15. But I believe that this bug dates back from version 8.2 days.

Are you willing to submit a pull request?

No

Code of Conduct

Yes

negora avatar Nov 04 '22 08:11 negora

  • NB 15, windows 10
  • control copy not working, not copying new value

sysmat avatar Nov 23 '22 10:11 sysmat

@sysmat I had not seen your message. Do you mean that [CTRL] + [C] does not work for you? It has always worked fine for me. The context menu options and copy-paste icons are what have never worked (they appear attenuated).

Have you tried NetBeans 20? If so, Have you tried with a clean configuration?

negora avatar Feb 18 '24 11:02 negora

  • I'm on 20 for few months
  • no with previous conf it is to big to start from clean, I use NB a lot
  • it doesn't work very well when switching copy paste from different IDE or browsers

sysmat avatar Feb 18 '24 11:02 sysmat

Also I have the same problem on two PC (NB 20, WIN 11)

sysmat avatar Feb 18 '24 11:02 sysmat

no with previous conf it is to big to start from clean, I use NB a lot

I meant to start with a clean configuration just to test if [CTRL] + [C] works fine. After that, you can revert back to your original configuration (it's a matter of renaming the configuration directory from 20 to 20.bak, for example, and undo it after the test).

Apart from that, just to make sure: this report is only about XML files that use the http://xmlns.jcp.org/xml/ns/persistence/orm namespace. Does your problem appear in other types of files?

negora avatar Feb 19 '24 10:02 negora