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.
If I select a file in the filesystems (or forthcoming projects) window, and issue the Cut command, there is no visible feedback that the file is "cut". In essence, this means there is no feedback that the IDE has successfully received the command (and no feedback to check back with to verify that one cut the right thing)
Assigned to new owner.
I have a patch for you; it involves a smidgen of API. It could either be implemented on Node (as in the patch I sent), or someplace else that Node can see. The idea is pretty simple - keep a collection of the cut items and have a test in Node.getHtmlDisplayName & friends to check it and return grayed out text (same for icon but I didn't try it yet - there's some good icon graying code in navigator/javanavigation if you want it). It adds a few protected static methods to Node (which could really go anywhere): protected static void nodeCut(); protected static boolean wasCut(Node n); public static void pastePerformed(); The last one is ugly; it could also be somewhere else (maybe put all of these methods on ExClipboard and generalize it to Object instead of Node?). Rather than create packages in CVS just to send you a patch, I put that last method on Node for now. The only clever trick in here is that it's pretty safe to assume cut over multiple nodes happens in a single cycle in the event dispatch thread, so there's a cute little flag that gets set and reset to make this work. Anyway, it works - with a few aesthetic choices about where to put the code, it'd be pretty simple to implement/integrate.
Created attachment 23046 [details] Diff
1. the proposed methods are not correct. 2. you can very likely just observe ExClipboard.getDefault() content to know which nodes are the correct ones 3. test would be more useful patch than the one attached
> 1. the proposed methods are not correct Please explain what you mean by this. Re observing ExClipboard.getDefault(), remember that the isCut() test will need to be done once (more typically twice - once getting the HTML display name and once getting the icon). I suspect that for performance reasons, we do not want to be calling Lookup.getDefault().lookup(ExClipboard.class) twice for every node on screen from inside the paint loop. I didn't test this, but I'd suspect there will be problems if we need to actually get the clipboard contents to see if it's a node and if it's the right one while painting the nodes (imagine I have just copied a 4K px bitmap in photoshop and switch to NetBeans). So some kind of tracking mechanism that is node-specific will be needed. As I noted before, it doesn't really matter what class isCut(Node n), etc. is implemented - just that it be fast.
Performance consideration needs to take place. However please notice that ExClipboard is not "native clipboard". It is a copy. Also please realize that the proposed methods (definitevely the static one) are not correct.
Then please suggest an alternative - "not correct" is pretty ambiguous (since I've already pointed out that the methods could live on any class accessible to Node and be static or non-static). I could imagine it being on ExClipboard, i.e. boolean isCut; ExClipboard ex = (ExClipboard) Lookup.getDefault().lookup (ExClipboard.class); return ex.isCut (this) except that once again we're calling into Lookup once per node per paint cycle, which doesn't seem like a good idea to me. I expect we don't want to actually add static methods to Node, since there's the vague possibility that someone will have instance methods with the same names - but again, the placement and naming of the methods is proof-of-concept. So, Jarda, don't be shy - if you have a concrete suggestion, make it.
The fact that someone calls Node.clipboardCut does not necessarily mean that the node is being pasted into (system) clipboard. That is why you cannot use static methods the way you try to use them, regardless of their potential place.
Okay; so I think what you're saying is this logic would have to be in CutAction? Who else does use clipboardCut, and for what? An aborted drag and drop could use the same mechanism to reset the "cut" state of the nodes; what else uses clipboardCut?
Reassigning to new module owner Tomas Holy.
*** Issue 16339 has been marked as a duplicate of this issue. ***
The feedback is the same for last ten years. Won'tfix unless someone provides a patch.