Bug 301841 [LinkedResources] ImportTypeDialog needs Javadoc
HEAD ImportTypeDialog needs Javadoc (type, constructor, setResource(..)) and probably an @noextend tag.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/ImportTypeDialog.java
*
	 * So if there's two variables, being 
	 * 		FOO - c:\foo\
	 * 		DIR1 - c:\foo\path\bar\dir1
	 * And the common root is:
	 * 		c:\foo\path\bar
	 * FOO will be selected over DIR1, even through the distance between 
	 * the common root and DIR1 is (1), and the distance between the 
	 * common root and FOO is (2).  This is because selecting DIR1 would
	 * cause the location to be relative to its parent.
	 * @param paths
	 * 		The list of items that were dragged
	 * @param target
	 * 		The target container onto which the items were dropped
	 * @return the most appropriate path variable given the context
	 */
	private static String getPreferredVariable(IPath[] paths,
			IContainer target) {
		IPath commonRoot = null;
		for (int i = 0; i < paths.length; i++) {
			if (paths[i] != null) {
				if (commonRoot == null)
					commonRoot = paths[i];
				else  {
					int count = commonRoot.matchingFirstSegments(paths[i]);
					int remainingSegments = commonRoot.segmentCount() - count;
					if (remainingSegments <= 0)
						return null;
					commonRoot = commonRoot.removeLastSegments(remainingSegments);
				}