Get project name for a component
One answer
Since projects don't necessarily have to be at the top-level, you have to search the configuration for the .project files. (these are special files which Eclipse uses to identify a project)
For a code example, take a look in and around the com.ibm.team.filesystem.ide.ui.internal.wizards.load.LoadWizard class. Specifically there is com.ibm.team.filesystem.ide.ui.internal.wizards.load.LoadWizardInput which does the real work and gathers the information about the projects.