getSite().getWorkbenchWindow().getPartService().addPartListener(partListener=new IPartListener(){
@Override
public void partActivated(IWorkbenchPart part) {
// TODO Auto-generated method stub
writeMessage("partActivated");
}
@Override
public void partBroughtToTop(IWorkbenchPart part) {
// TODO Auto-generated method stub
writeMessage("partBroughtToTop");
}
@Override
public void partClosed(IWorkbenchPart part) {
// TODO Auto-generated method stub
writeMessage("partClosed");
}
@Override
public void partDeactivated(IWorkbenchPart part) {
// TODO Auto-generated method stub
writeMessage("partDeactivated");
}
@Override
public void partOpened(IWorkbenchPart part) {
// TODO Auto-generated method stub
writeMessage("partOpened");
}
});