public static SelectionDispatchAction createPasteAction(final ISourceReference[] elements, Object target){ return new PasteSourceReferencesFromClipboardAction(new MockWorkbenchSite(new Object[]{target}), null){ protected TypedSource[] getContentsToPaste(){ List result= new ArrayList(elements.length); for(int i= 0; i < elements.length; i++){ try { result.add(new TypedSource(elements[i])); } catch(JavaModelException e) {  } } return (TypedSource[])result.toArray(new TypedSource[result.size()]); } };
public static SelectionDispatchAction createPasteAction(IWorkbenchSite site, Clipboard clipboard){ SelectionDispatchAction a1= new PasteResourcesFromClipboardAction(site, clipboard); SelectionDispatchAction a2= new PasteSourceReferencesFromClipboardAction(site, clipboard); String helpContextID= IJavaHelpContextIds.PASTE_ACTION; SelectionDispatchAction dual= new DualReorgAction(site, ReorgMessages.getString("ReorgGroup.paste"), ReorgMessages.getString("ReorgGroup.pasteAction.description"), a1, a2, helpContextID);  ISharedImages workbenchImages= getWorkbenchSharedImages(); dual.setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED)); dual.setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); dual.setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_HOVER)); return dual;
	public static SelectionDispatchAction createPasteAction(final ISourceReference[] elements, Object target){		return new PasteSourceReferencesFromClipboardAction(new MockWorkbenchSite(new Object[]{target}), null){			protected TypedSource[] getContentsToPaste(){				List result= new ArrayList(elements.length);				for(int i= 0; i < elements.length; i++){					try {						result.add(new TypedSource(elements[i]));					} catch(JavaModelException e) {						//ignore					}				}				return (TypedSource[])result.toArray(new TypedSource[result.size()]);			}		};	}