Example usage for org.eclipse.jdt.core.dom.rewrite ImportRewrite addStaticImport

List of usage examples for org.eclipse.jdt.core.dom.rewrite ImportRewrite addStaticImport

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom.rewrite ImportRewrite addStaticImport.

Prototype

public String addStaticImport(IBinding binding) 

Source Link

Document

Adds a new static import to the rewriter's record and returns a name - single member name if import is successful, else qualified name.

Usage

From source file:org.eclipse.ajdt.internal.ui.editor.actions.AJOrganizeImportsOperation.java

License:Open Source License

private void addStaticImports(List<SimpleName> staticReferences, ImportRewrite importsStructure) {
    for (int i = 0; i < staticReferences.size(); i++) {
        Name name = staticReferences.get(i);
        IBinding binding = name.resolveBinding();
        if (binding != null) { // paranoia check
            importsStructure.addStaticImport(binding);
        }//from   w w  w.ja  v  a 2  s .  c om
    }
}