Bug 191639 - Move NbClipboard into a module with less dependencies
Move NbClipboard into a module with less dependencies
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: -- Other --
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Jan Stola
issues@platform
69patch3-fixed
: API, API_REVIEW_FAST
Depends on:
Blocks:
  Show dependency treegraph
 
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
:


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?


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo