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.

Bug 177041 - [68cat] Cut + Copy Buttons disabled
Summary: [68cat] Cut + Copy Buttons disabled
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-17 18:39 UTC by ulfzibis
Modified: 2009-11-27 03:05 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Toolbar settings (2.46 KB, application/zip)
2009-11-19 09:27 UTC, ulfzibis
Details
Screenshot (78.60 KB, image/png)
2009-11-19 09:28 UTC, ulfzibis
Details
Diff of the fix (845 bytes, patch)
2009-11-23 09:57 UTC, Miloslav Metelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2009-11-17 18:39:56 UTC
After marking some text in java file, Cut + Copy Buttons should be enabled.
Comment 1 Vitezslav Stejskal 2009-11-19 07:36:40 UTC
And they are, at least in my 6.8dev build. Ulfzibis, please with all due respect I think you have been with Netbeans for quite some time now and so you surely are not going to be surprised that I am closing this as INCOMPLETE for an obvious lack of steps how to reproduce the problem. I really am sorry.
Comment 2 ulfzibis 2009-11-19 09:27:10 UTC
Created attachment 91364 [details]
Toolbar settings

Sorry, I do not have something special for reproduce:
- Start NetBeans
- open a file in editor
- mark some text
--> Cut + Copy Buttons stay disabled

Maybe my toolbar settings would help
Comment 3 ulfzibis 2009-11-19 09:28:42 UTC
Created attachment 91366 [details]
Screenshot

In contrast, context menu items are enabled
Comment 4 swpalmer 2009-11-19 10:58:35 UTC
I can confirm that this happens for me as well.
Just enabled the clipboard toolbar and the buttons are disabled even when I select some text.

I disabled the clipboard toolbar and re-enabled it and then the cut and copy buttons were stuck in the enabled state.  If I had nothing selected Cut would cut the entire line where the cursor was.

This was in build 200911180645.
Comment 5 Vitezslav Stejskal 2009-11-20 04:14:06 UTC
I see. The buttons really seem to be broken and not even in the editor. Although the problem is most visible in the editor. Here are the steps that seem to reproduce it on my laptop:

1. fresh userdir, start the ide
2. open a java project, but no files
3. turn on the clipboard toolbar
4. open a file in the editor -> both copy and cut buttons are disabled (and can't be enabled no matter if you select text or not)
5. turn off the toolbar and turn it on again -> the buttons are now enabled
6. but as soon as you close and reopen the edited file they will be disabled again

Strange thing is that the same actions in the main menu work fine and the keyboard shortcuts work as well. So it seems to be just the toolbar buttons.

Milo, could this be somehow related to the actions registration (ie. annotations, the auto-generated layer stuff, etc)?

Ulf, did you intentionally assigned this to yourself? If so, thanks a lot for your help.
Comment 6 Jiri Prox 2009-11-20 04:44:18 UTC
I can reproduce it as well
Comment 7 David Strupl 2009-11-20 07:29:24 UTC
I guess this should be assigned to someone else than the reporter ... Ulf, did you assign it to yourself by mistake? Should it be assigned to Vita or Mila?

If Jirka can reproduce - is it visible for all users? If so I guess this might be even a stopper (P1) ...
Comment 8 Vitezslav Stejskal 2009-11-20 08:27:09 UTC
(In reply to comment #7)
> If Jirka can reproduce - is it visible for all users? If so I guess this might
> be even a stopper (P1) ...

Well, the actions work (eg. ctrl+c, ctrl+x and the main menu actions) and the Clipboard toolbar is turned off by default. So, I'd say it's a stupid and annoying bug, but since most users use the shortcuts (eg. in the editor) or popup menu (eg. on nodes) they probably won't even notice. But I guess the final call should be made by QA.
Comment 9 Miloslav Metelka 2009-11-21 12:16:05 UTC
I was debugging the problem and we properly set enabled state of editor's copy action

                            Action a = kit.getActionByName(BaseKit.copyAction);
                            if (a != null) {
                                // In order to allow the action to operate even if there is no selection
                                // (to copy a single line) the action is always enabled.
                                a.setEnabled(true);
                            }

and also the system action updater should properly bridge editor's copy action to openide's one.
I'll continue until it gets revealed.
Comment 10 ulfzibis 2009-11-21 12:27:27 UTC
> Ulf, did you intentionally assigned this to yourself? If so, thanks a lot for your help.

This happened automatically, don't know why.
Had this several times, filing a bug, maybe happens on reopen.
Comment 11 Miloslav Metelka 2009-11-23 09:56:07 UTC
Since this does not work also e.g. in explorer for cut/copy of files I'm raising priority to P1.
After some significant debugging, Yarda has found the problem (diff of the fix attached).
Reassigning to Yarda.
Comment 12 Miloslav Metelka 2009-11-23 09:57:08 UTC
Created attachment 91548 [details]
Diff of the fix
Comment 13 Jaroslav Tulach 2009-11-23 11:15:03 UTC
Fixed in trunk, please review: http://hg.netbeans.org/core-main/rev/9d814160420d
Comment 14 Miloslav Metelka 2009-11-24 02:42:09 UTC
Thanks for the fix. I approve it.
Comment 15 Quality Engineering 2009-11-24 19:07:34 UTC
Integrated into 'main-golden', will be available in build *200911241400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/9d814160420d
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #177041: No enabled state change was delivered when changing action delegate
Comment 16 pribyl 2009-11-27 03:05:37 UTC
Product Version: NetBeans IDE 6.8 RC1 (Build 200911252200)
Java: 1.6.0_16; Java HotSpot(TM) Client VM 14.2-b01
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

Verified