errael commented on code in PR #5280:
URL: https://github.com/apache/netbeans/pull/5280#discussion_r1082951904
##########
platform/openide.util.ui/src/org/openide/util/Utilities.java:
##########
@@ -1325,6 +1323,25 @@ private static Rectangle
findCenterBounds(GraphicsConfiguration gconf, Dimension
);
}
+ /**
+ * Find the main NetBeans window; must have width or height.
+ * This is used locally to avoid dependency issues.
+ * @return NetBeans' main window
+ */
+ private static Frame findMainWindow()
+ {
+ Frame f = null;
+ for( Frame f01 : Frame.getFrames() ) {
+ if( "NbMainWindow".equals(f01.getName())) { //NOI18N
Review Comment:
IIUC, to summarize things
- `openide.util.ui` can not use `WindowManager.getDefault().getMainWindow()`
due to dependencies
- The limited functionality based on finding an existing MainWindow can be
accessed from any application using NetBeans modules, if the application names
the main window "NbMainWindow"
- Don't want findMainWindow() public API
- Could make it internal API (but I don't know where to put it, or exactly
the considerations)
- If, in the future, there is a problem with requiring "NbMainWindow" could
handle a `NetBeansPlatformMainWindowName` service (or somesuch e.g.
SystemProperty) (I'm tempted to put an emoji here, grimace perhaps?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists