Bug 84983 [typing] imports disappear
I20050209-0800 + JDT UI from HEAD 1. open a CU with several imports 2. enable folding (ensure imports are folded) 3. remove code so that first import is no longer needed 4. run Organize Imports ==> all imports are gone 5. close and re-open the editor ==> imports are back
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java
Position position= createProjectionPosition(regions[regions.length - 1]);
				if (position != null)
					map.put(new JavaProjectionAnnotation(element, collapse, false, computeCaptionOffset(position, element)), position);
			}
		}
	}
	private boolean isInnerType(IType type) {
		
		try {
			return type.isMember();
		} catch (JavaModelException x) {
			IJavaElement parent= type.getParent();
			if (parent != null) {
				int parentType= parent.getElementType();
				return (parentType != IJavaElement.COMPILATION_UNIT && parentType != IJavaElement.CLASS_FILE);
			}
		}
		
		return false;		
	}
	/**
	 * Computes the projection ranges for a given <code>IJavaElement</code>.
	 * More than one range may be returned if the element has a leading comment
	 * which gets folded separately. If there are no foldable regions,
	 * <code>null</code> is returned.
	 * 
	 * @param element the java element that can be folded
	 * @return the regions to be folded, or <code>null</code> if there are
	 *         none