use of org.eclipse.ui.IPartService in project tdi-studio-se by Talend.
the class TalendPaletteHelper method checkAndInitToolBar.
public static void checkAndInitToolBar() {
if (talendPartListener == null) {
talendPartListener = new TalendPartAdapter2() {
@Override
public void partActivated(IWorkbenchPartReference partRef) {
checkAndInitToolBar();
}
@Override
public void partOpened(IWorkbenchPartReference partRef) {
checkAndInitToolBar();
}
};
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IPartService partService = activeWorkbenchWindow.getPartService();
partService.addPartListener(talendPartListener);
}
}
// check every time
checkAndInitToolBar2();
}
Aggregations