Bug 4074 Add Import does not add to right group (1GI182E)
1. Ensure that at least "java" and "org.eclipse.swt" are defined in the import order pref page 2. Ensure SWT is on the build path of the test project 3. Add a new class with the following source: ------------------------------------------ import java.util.List; import org.eclipse.swt.SWT; public class AddImportBug { Set } ------------------------------------------ 4. Select Set 5. Add Import ==> The import is added to the org.eclipse group (before SWT) BTW: Organize import adds it to the right group NOTES: MA (27.08.2001 12:24:06) Need to change the separator placeholder structure. The information that the entry was matched to an other entry is lost.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java
setReplacementString(replacement);
		} catch (BadLocationException e) {
			JavaPlugin.log(e);
		} catch (JavaModelException e) {
			JavaPlugin.log(e);
		}
			
		super.apply(document, trigger, offset);
	}
	
	private boolean createStubs(StringBuffer buf, ImportsStructure imports) throws JavaModelException {
		if (fDeclaringType == null) {
			return true;
		}
		CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
		ITypeHierarchy hierarchy= fDeclaringType.newSupertypeHierarchy(null);
		OverrideMethodQuery selectionQuery= fDeclaringType.isClass() ? new OverrideMethodQuery(JavaPlugin.getActiveWorkbenchShell(), true) : null;
		String[] unimplemented= StubUtility.evalUnimplementedMethods(fDeclaringType, hierarchy, true, settings, selectionQuery, imports);
		if (unimplemented != null) {
			for (int i= 0; i < unimplemented.length; i++) {
				buf.append(unimplemented[i]);
				buf.append('\n');
			}
			return true;
		}
		return false;
	}
}