user3573702
user3573702

Reputation: 13

Eclipse Plugin to detect the activity of Eclipse

I am working on an Eclipse plugin project. Which extension point should I use to detect the activity of 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. Please help me with some advice!!! Thank you

Upvotes: 0

Views: 84

Answers (1)

greg-449
greg-449

Reputation: 111141

One way is to use a ShellListener on the Shell for the workbench window:

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).

Upvotes: 1

Related Questions