JavaModelUtil.resolveImportsForType()

See its javadoc and CreateParameterJavaHint.createParameter() (in java/hints) for an example of how to use JavaModelUtil.resolveImportsForType().

Source: NetBeans FAQ