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 40238 - Cut/copy/paste shortcuts not updated in main menu, keyboard shortcuts don't work
Summary: Cut/copy/paste shortcuts not updated in main menu, keyboard shortcuts don't work
Status: VERIFIED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks: 38441
  Show dependency tree
 
Reported: 2004-02-18 15:42 UTC by _ tboudreau
Modified: 2008-12-22 18:01 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2004-02-18 15:42:38 UTC
Start NetBeans with a clean userdir.
Select a file such as README.
Press CTRL-C.
Select its parent folder.
Press CTRL-V.
Nothing happens.

Open the main Edit menu.
Paste is disabled.
Now right click the parent folder.
Paste action is enabled.
Open the main Edit menu.
Paste action is now enabled there too.

This is not a recent problem - I reproduced it 
on a build from late December.
Comment 1 David Simonek 2004-02-18 16:03:49 UTC
OK, but why is this reported as winsys problem? I believe winsys
doesn't play any role in this, it's something between
AWT-Actions-Explorer.
Comment 2 _ tboudreau 2004-02-18 16:25:45 UTC
True, I was trying to evaluate the fix for 38441 when it came up, and I misfiled it.  Anyway, 
I'm working on it now.
Comment 3 Jaroslav Tulach 2004-02-18 16:31:59 UTC
Check issue 39678 for possible similarity.
Comment 4 _ tboudreau 2004-02-18 17:44:18 UTC
Well, I put logging in various places...so far, it looks like there is simply nothing bound to 
CTRL-C, etc.  There is some code in TreeView.ExplorerTree to *remove* shortcuts the L&F 
binds.

I'm having difficulty figuring out where the keystroke should actually be bound - the ways 
to get a keystroke handled are pretty byzantine.  So I'm not sure if Explorer *should* be 
putting bindings for these keystrokes into its InputMap (seems reasonable), or somebody 
else should be doing it, or some global handler should do it.  We have:

 - Deprecated ExplorerActions, which is what Explorer actually uses
 - Non-deprecated, non-public ExplorerActionsImpl, which looks like a slightly modified 
copy of ExplorerActions - who uses this?  Anyway, doesn't matter, they don't deal with 
keybindings.

Then there's NbKeymap...

Or the bindings could go into NbMainExplorer in core...

I will probably put correct bindings into the input map of TreeView.ExplorerTree, as that 
seems like the normal and natural thing to do, so I can test issue 38441, and put the 
patch here. 
Comment 5 _ tboudreau 2004-02-18 19:27:12 UTC
Okay, now this is really weird.  I've got logging in CopyAction, PasteAction & 
CallableSystemAction.  

ant build-nozip tryme
Navigate the Explorer tree with the keyboard, press ctrl-c
Copy/cut/paste in explorer works from the keyboard, I see logging when I press ctrl-c
Navigate to a folder node, press ctrl-v - file is pasted, works as expected

cd netbeans\bin
runide.exe -userdir \tmp\someDirThatDoesntExistYet
Copy/cut/paste DO NOT work from the keyboard, no logging that they are invoked when I 
press ctrl-c, etc.

runide.exe -userdir ..\..\testuserdir
Same thing, actions don't work.

BTW, this is running with one small code change - the actions we remove from the tree's 
action map in TreeView.ExplorerTree are changed to use the default menu accelerator key 
from Toolkit instead of KeyStroke.getKeyStroke ("control C") etc.  Shouldn't make any 
difference.

Passing this issue to Jirka/Explorer - he knows more about what this code is doing and 
what might be going wrong.
Comment 6 Jaroslav Tulach 2004-02-19 08:54:16 UTC
The CopyAction, CutAction and PasteAction delegates to TopComponent
ActionMap which in turn delegates to ActionMap of the selected
component inside itself. 
Comment 7 Jiri Rechtacek 2004-02-22 09:59:59 UTC
Tim, sorry I'm a little puzzled what's wrong what is have to fix.
Copy/Paste via main Edit menu basically works for me. Could you
restate a problem and decribe any test case? In the meantime I close
as WORKSFORME, reopen or file new issue if a problem persists.
Comment 8 Marian Mirilovic 2005-07-12 09:43:14 UTC
closed