简体   繁体   English

为什么 Eclipse JFace 的 Window 类只创建一个调整大小的侦听器然后立即将其删除?

[英]Why does Eclipse JFace's Window class create a resize listener only to then immediately remove it?

org.eclipse.jface.window.Window 's create method calls createShell which during it's run creates a resizeListener , which sets a protected flag for any resize that may have occurred, which can then be used by subclasses to handle appropriately upon closure and such. org.eclipse.jface.window.Windowcreate方法调用createShell ,它在运行期间创建一个resizeListener ,它为可能发生的任何调整大小设置一个protected标志,然后子类可以使用它在关闭时进行适当的处​​理等. However, then it calls initalizeBounds , which removes this very same listener.但是,然后它调用了initalizeBounds ,它删除了这个完全相同的侦听器。

I'm a bit confused as to why.我有点困惑为什么。 I tried googling this, but I couldn't find anything even acknowledging this.我试着谷歌搜索这个,但我什至找不到任何承认这一点的东西。 Am I missing something?我错过了什么吗?

It looks like this flag is just intended for the Window class itself to handle a resize event happening before initializeBounds is called.看起来这个标志只是为了让Window类本身处理在调用initializeBounds之前发生的调整大小事件。

The flag was made protected to deal with a problem in ApplicationWindow (see bug 289181 ) where a resize event during Shell.setMenu was causing problems.该标志受到protected以处理ApplicationWindow的问题(请参阅错误289181 ),其中Shell.setMenu期间的调整大小事件导致问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM