use of org.talend.designer.business.model.business.diagram.handler.ClipboardActionHandler in project tdi-studio-se by Talend.
the class ClipboardActionHandlerProvider method getGlobalActionHandler.
@Override
public IGlobalActionHandler getGlobalActionHandler(final IGlobalActionHandlerContext context) {
if (!getHandlerList().containsKey(context.getActivePart())) {
getHandlerList().put(context.getActivePart(), new ClipboardActionHandler());
context.getActivePart().getSite().getPage().addPartListener(new IPartListener() {
private IWorkbenchPart localPart = context.getActivePart();
/**
* @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
*/
public void partActivated(IWorkbenchPart part) {
// NULL implementation
}
public void partBroughtToTop(IWorkbenchPart part) {
// NULL implementation
}
public void partClosed(IWorkbenchPart part) {
if (part != null && part == localPart && getHandlerList().containsKey(part)) {
getHandlerList().remove(part);
localPart.getSite().getPage().removePartListener(this);
localPart = null;
}
}
/**
* @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
*/
public void partDeactivated(IWorkbenchPart part) {
// NULL implementation
}
/**
* @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
*/
public void partOpened(IWorkbenchPart part) {
// NULL implementation
}
});
}
return (ClipboardActionHandler) getHandlerList().get(context.getActivePart());
}
Aggregations