* NOTE: the first time this function is called will be before the
* active workbench window is instantiated Eclipse RCP causes this
* function to fail quietly, so we just don't set the already installed
* flag true until after it is successful
*/
ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
final IHandler handler = this;
selectionService.addSelectionListener(new ISelectionListener() {
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
fireHandlerChanged(new HandlerEvent(handler, true, false));
}
});