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 191639 - Move NbClipboard into a module with less dependencies
Summary: Move NbClipboard into a module with less dependencies
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jan Stola
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2010-11-04 12:24 UTC by Jan Stola
Modified: 2010-12-10 11:58 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch with the suggested changes (7.58 KB, patch)
2010-11-04 12:25 UTC, Jan Stola
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Stola 2010-11-04 12:24:03 UTC
The primary motivation for this issue is an analogy of issue 40693 in JDeveloper. JDeveloper would like to reuse our hacks around NbClipboard to solve their clipboard problems.

The jdev-nb environment allows to reuse NetBeans modules in JDeveloper. Unfortunately, NbClipboard class resides in o.n.core module that is not included in jdev-nb by now. This module is too heavyweight to include just because of NbClipboard. Therefore, I suggest to move NbClipboard into another module.

A good candidate seems to be o.n.bootstrap (thanks Yarda for this idea) that contains TopSecurityManager that plays an essential role in NbClipboard-related hacks.

Note that NbClipboard is a standalone class that itself is not part of API. No code references this class directly, it is used indirectly as Clipboard or ExClipboard service. Hence, the suggested move should be harmless.
Comment 1 Jan Stola 2010-11-04 12:25:14 UTC
Created attachment 102800 [details]
Patch with the suggested changes
Comment 2 Jaroslav Tulach 2010-11-04 13:21:22 UTC
maybe you still want to wait for the frame to be really isShowing. As far as I know setVisible does not make the window immediately visible:

-                for(;;) {
-                    w = SwingUtilities.getWindowAncestor(tc);
-                    if (w != null && w.isVisible()) {
-                        break;
-                    }
-                    Thread.sleep(100);
-                }
Comment 3 Jesse Glick 2010-11-04 14:25:53 UTC
[JG01] Logger.getLogger should use NbClipboard.class to get the new package name. This should also be a constant.
Comment 4 Jan Stola 2010-11-07 14:27:42 UTC
> maybe you still want to wait for the frame to be really isShowing.
> As far as I know setVisible does not make the window immediately visible:

isVisible() == isShowing() for frames/windows. So, there is no need to wait.

> [JG01] Logger.getLogger should use NbClipboard.class to get the new package
> name. This should also be a constant.

Sure. I overlooked that logger code contains hardcored package name.
So, the additional changes in NbClipboard are:

-    private Logger log;
+    private static final Logger log = Logger.getLogger(NbClipboard.class.getName());

     NbClipboard( Clipboard systemClipboard ) {
         super("NBClipboard");   // NOI18N
         this.systemClipboard = systemClipboard;
-        log = Logger.getLogger("org.netbeans.core.NbClipboard"); // NOI18N
Comment 5 Jan Stola 2010-11-10 14:04:46 UTC
Thank you for the review. I will integrate the changes tomorrow.
Comment 6 Jan Stola 2010-11-12 07:14:21 UTC
Moved: http://hg.netbeans.org/core-main/rev/705c1173f585
Comment 7 Michel Graciano 2010-11-12 12:11:51 UTC
(In reply to comment #6)
> Moved: http://hg.netbeans.org/core-main/rev/705c1173f585

Will it be transplanted to Beta branch?