This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I cut some text in the Java source editor using the pop-up menu bar, the "paste" menu item is still disabled. So I can't cut-and-paste text in the editor. Sometime, I can recover the problem by click the output window, click on "Clear output" and the cut-and-paste works again in the source editor.
Peter, is not this similar to what you have solved in CloneableEditor?
How to reproduce: 1. Right click on some node in exporer and perform Copy. 2. Right click on editor window. (Paste is disabled. OK.) 3. Select some text in editor. 4. Invoke popup by right click. Perform copy. 5. reinvoke popup => Paste is still disabled.
It seems, it is in CloneableEditor. if you perform item 4 via main window toolbar - Copy button, paste is also disabled. Reassigning ...
It seems to be a prob in CloneableEditor, updating the paste action. I look at it. Assigned to me.
Adjusted QA contact.
It was in CloneableEditor. Adjusting version. Fixed in [main-trunk]. Fix: openide/../openide/text/CloneableEditor.java [1.25]. Note: You could easilly reproduce it this way: 1) Select some text in editor 2) click on system Cut or Copy in main-window. 3) The actions are performed (yoiu can use succesfully the paste short cut in editor) but the system Paste was not updated. The prob with popup has the came reason. Problem was there was created bridge between editor cut (copy) and system cut (copy) actions, but it should be created between substituted editor cut (copy) and system cut (copy) actions. The substitute actions add the updating of system paste action to the standard behaviour.
*** Issue 17763 has been marked as a duplicate of this issue. ***
It's back. Paste action in menu is disabled after cut or copy. Note, that keyboard paste works. dev#20011123 jdk1.4.0-rc1-b87
Works OK for me in [r33 nov 23] with 1.3.1_01, maybe this is a JDK_1.4 problem?
Yes it is on jdk1.4. And it seems the problem was the same which described and patched by Jesse in #18066. It seem the patch for #18066 solves also this problem.
Marking 1.4-specific with your permission. Maybe JDK 1.4 replaces the clipboard with some kind of wrapper transferable, too. Or perhaps it just doesn't use StringSelection to begin with. You may want to insert a println into the place where I patched #18066 to see what it is putting there.
Jesse, I did and it seems it is used the wrapper (sun.awt.datatransfer.TransferableProxy) instance (therefore the check for instance of StringSelection failed on 1.4). Anyway your patch seems to be more general and the right one. Thanks.
Fixed in [release33]. See #18066. Marked as 3.3.0 candidate.
Fixed in [release33]. See #18066. Target milestone -> 3.3.1. Marked as 3.3.0 candidate.
Created attachment 3599 [details] Jesse's patch = fix (from #18066)
Request for approval to integrate the fix to release330: Justification: The fix is tested just by using cut/copy actions while wprking in editor. Problem was the system action didn't enable/disable itself accordingly. Before the code checked just if in clipboard is StringSelection instance of Transferable. This was only one case solution, works only in jdk1.3 and only when the transferable was put in clipboard from editor. Jesse's patch makes the check correct (more general), i.e. checking for ability of Transferable to provide DataFlavor.stringFlavor. The patch is simple and shouldn't cause any problems. Since it is Jesse's patch. I'm the reviewer.
BTW this bug is RESOLVED but has no Resolution?! Possibly useful background info: the reason I suggested the patch to begin with was because I was working on the minicomposer example module in openide/api/examples/org/netbeans/examples/modules/minicomposer/ which adds a clipboard convertor capable of taking a multiple "note" selection and converting it into a string, as one flavor in an ExTransferable. I noticed that it was working strangely: after copying some notes, you could Ctrl-V to paste them in the editor, yet Paste was disabled in popup and in the Edit menu. I found the bug in CloneableEditor this way, patched it locally, restarted with the patch, and the Paste menu item was now enabled, as well as Ctrl-V working. Using 1.3.1_01, so the restriction to JDK 1.4 is not quite accurate, though of course the bug is much more likely to be noticed under 1.4.
verified in 3.3 #200111280300
Integrated to [release330]. openide/../openide/text/CloneableEditor.java [1.25.6.1] Removed keyword 3.3.0_CANDIDATE and changed milestone to 3.3.
issue without resolution ! reopen and close it again
x
Resolved for 3.4.x or earlier, no new info since then -> closing.