简体   繁体   English

Eclipse插件来检测Eclipse的活动

[英]Eclipse Plugin to detect the activity of Eclipse

I am working on an Eclipse plugin project. 我正在开发一个Eclipse插件项目。 Which extension point should I use to detect the activity of Eclipse. 我应该使用哪个扩展点来检测Eclipse的活动。 Like, when it is minimized or not on the top level of screen, plugin stops to counting. 就像,当最小化或不在屏幕顶层时,插件停止计数。 Right now, I can just use “org.eclipse.ui.startup“ extension point, and my plugin starts to count when Eclipse starts and keep counting until it is closed which is not good. 现在,我可以只使用“ org.eclipse.ui.startup”扩展点,并且我的插件在Eclipse启动时开始计数,并一直计数到关闭为止,这不好。 Please help me with some advice!!! 请帮我一些建议!!! Thank you 谢谢

One way is to use a ShellListener on the Shell for the workbench window: 一种方法是在命令行管理Shell的工作台窗口上使用ShellListener

IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

Shell shell = window.getShell();

shell.addShellListener(listener);

The shell listener is notified when the shell is activated, deactivated, closed, minimized (iconified) and restored (deiconified). 当外壳被激活,停用,关闭,最小化(图标化)和还原(去图标化)时,将通知外壳侦听器。

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

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