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 26334 - NbClipboard#slowSystemClipboard property problem (Was: Paste action disabled)
Summary: NbClipboard#slowSystemClipboard property problem (Was: Paste action disabled)
Status: VERIFIED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Peter Zavadsky
URL:
Keywords: T9Y
Depends on: 26339
Blocks:
  Show dependency tree
 
Reported: 2002-08-07 12:36 UTC by Miloslav Metelka
Modified: 2008-12-22 21:48 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debugging log (38.47 KB, text/plain)
2002-08-07 12:40 UTC, Miloslav Metelka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2002-08-07 12:36:10 UTC
The Paste action can become disabled if there is
just one file opened in the editor (for more files
it usually does not happen).
We've made a research with Mato and we have found
that in CloneableEditor the setPasteTypes(null) is
called which makes the PasteAction disabled.
The log is attached.
Debugging legend in the log:
 "enab:" means the status of the system Paste action
 "enabled:" means the status of the editor's Paste
action
Comment 1 Miloslav Metelka 2002-08-07 12:40:12 UTC
Created attachment 7033 [details]
Debugging log
Comment 2 Jan Lahoda 2002-08-07 13:39:02 UTC
Hi,
    althought I said to Mila that the paste action is enabled for more
than one file, now I found that this is not always true. Sometimes it
is disabled when just one file is opened and enabled when more files
are opened. Sometimes, it is disabled/enabled in both cases. But,
these steps seems to be reliable:
1. Start brand new IDE (clean userdir).
2. Close welcome
3. Open examples/colorpicker/ColorPreview
4. Select piece of code, choose Copy from pop-up
5. Open Pop-up menu in editor, the Paste is disabled.
6. Create a new class (Main java class)
7. Open pop-up menu in editor, the Paste is enabled.

I found even another problem (this seems to be more reproducible):
1. Go into the explorer.
2. Cut some file.
3. Go into the editor, select piece of text.
4. Open pop-up menu in editor - Cut&Copy are disabled.
5. Paste the node somewhere in the explorer.
6. Select a piece of text in the editor.
7. Open pop-up menu in editor: the Cut&Copy actions are enabled.
Comment 3 Peter Zavadsky 2002-08-07 13:55:51 UTC
Here is the evaluation:
CloneableEditor is fine, it tries to update system paste action
according the clipboard content, whenever the cut/copy was perfomed.
But the problem is it doesn't get the proper results.

The issue has two parts:
1) one is there is not working lookup correctly (see #issue 26339)
2) second one the NbClipboard#getContents with the slowSystemClipboard
doesn't work correctly.

NbClipboard uses slowSystemClipboard property, which in case is set
(our case), then the getContents returns bad result (null).
If the property is switched off, the getContents() method works fine.


Passing to Trung. As I remeber the property was put there due to a
performance reasons.
Maybe it could be removed, there was made a change aferwards, which
accesses the clipboard outside the AWT thread (originally it caused
deadlocks by DnD, the change was done on two places ExplorerActions,
and CloneableEditor). I think the accesssing the clipboard whitin the
AWT could have been the main problem. However I didn't measure it now.
Comment 4 Martin Balin 2002-11-18 15:01:48 UTC
Raising priority because this issue affects one of the important IDE
validation tests.
Comment 5 _ ttran 2002-11-18 15:24:58 UTC
We will have to investigate.  Currently I don't understand why
pzavadsky thinks that NbClipboard doesn't work correctly.

Workaround in the meantime:

-J-Dnetbeans.slow.system.clipboard.hack=false
Comment 6 Jiri Skrivanek 2003-01-15 09:25:42 UTC
It seems it is fixed in builds 20030114 and later. It stopped to
happen in automated tests and I cannot reproduce it manually either.
Comment 7 Marian Mirilovic 2003-01-15 09:27:46 UTC
Peter, have you fixed it by new actions implementation?
Comment 8 Peter Zavadsky 2003-01-28 16:52:30 UTC
Yes, the changes in actions could fixed this, it changes all above said.

If some similar problem occures, please create a new issue.
Comment 9 Marian Mirilovic 2003-07-29 10:44:02 UTC
It works fine in [nb_dev](20030728) - verifying.