String name= ((IPackageFragment) element).getElementName();
IPackageFragment fragment= (IPackageFragment) element; String name= fragment.getElementName();
	private IJavaElement[] getSourceElements(IJavaProject[] projects) {		ArrayList res= new ArrayList();		try {			Set allChecked= fInputGroup.getAllCheckedTreeItems();			Set incompletePackages= new HashSet();			for (int h= 0; h < projects.length; h++) {				IJavaProject iJavaProject= projects[h];				IPackageFragmentRoot[] roots= iJavaProject.getPackageFragmentRoots();				for (int i= 0; i < roots.length; i++) {					IPackageFragmentRoot root= roots[i];					if (root.getKind() == IPackageFragmentRoot.K_SOURCE) {						IJavaElement[] packs= root.getChildren();						for (int k= 0; k < packs.length; k++) {							IJavaElement curr= packs[k];							if (curr.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {								// default packages are always incomplete								if (curr.getElementName().length() == 0 || !allChecked.contains(curr) || fInputGroup.isTreeItemGreyChecked(curr)) {									incompletePackages.add(curr.getElementName());								}							}						}					}				}			}			Iterator checkedElements= fInputGroup.getAllCheckedListItems();			while (checkedElements.hasNext()) {				Object element= checkedElements.next();				if (element instanceof ICompilationUnit) {					ICompilationUnit unit= (ICompilationUnit) element;					if (incompletePackages.contains(unit.getParent().getElementName())) {						res.add(unit);					}				}			}			Set addedPackages= new HashSet();			checkedElements= allChecked.iterator();			while (checkedElements.hasNext()) {				Object element= checkedElements.next();				if (element instanceof IPackageFragment) {					String name= ((IPackageFragment) element).getElementName();					if (!incompletePackages.contains(name) && !addedPackages.contains(name)) {						res.add(element);						addedPackages.add(name);					}				}			}		} catch (JavaModelException e) {			JavaPlugin.log(e);		}		return (IJavaElement[]) res.toArray(new IJavaElement[res.size()]);	}