analyst.refresh();
}
}
});
IViewSite site = getViewSite();
final IPartListener partListener = new IPartListener() {
@Override
public void partOpened(IWorkbenchPart part) {
}
@Override
public void partDeactivated(IWorkbenchPart part) {
}
@Override
public void partClosed(IWorkbenchPart part) {
}
@Override
public void partBroughtToTop(IWorkbenchPart part) {
}
@Override
public void partActivated(IWorkbenchPart part) {
LiveCodingAnalyst newAnalyst = null;
if (part instanceof PyEdit)
{
PyEdit editor = (PyEdit)part;
newAnalyst = PyEditDecorator.getAnalyst(editor);
}
setAnalyst(newAnalyst);
if (newAnalyst != null) {
newAnalyst.refresh();
}
}
};
site.getPage().addPartListener(partListener);
parent.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
IViewSite viewSite = getViewSite();
viewSite.getPage().removePartListener(partListener);
setAnalyst(null);
}
});
}