Search in sources :

Example 1 with Match

use of org.eclipse.che.ide.ext.java.shared.dto.search.Match in project che by eclipse.

the class TypeNode method getMatches.

/**
     * Collect all matches for this type node.
     *
     * @return the list of matches.
     */
public List<Match> getMatches() {
    List<Match> matches = new ArrayList<>();
    if (compilationUnit != null && type.isPrimary()) {
        for (ImportDeclaration importDeclaration : compilationUnit.getImports()) {
            addAllMatches(importDeclaration.getHandleIdentifier(), matches);
        }
    }
    addAllMatches(type.getHandleIdentifier(), matches);
    for (Initializer initializer : type.getInitializers()) {
        addAllMatches(initializer.getHandleIdentifier(), matches);
    }
    for (Field field : type.getFields()) {
        addAllMatches(field.getHandleIdentifier(), matches);
    }
    return matches;
}
Also used : Field(org.eclipse.che.ide.ext.java.shared.dto.model.Field) Initializer(org.eclipse.che.ide.ext.java.shared.dto.model.Initializer) ArrayList(java.util.ArrayList) ImportDeclaration(org.eclipse.che.ide.ext.java.shared.dto.model.ImportDeclaration) Match(org.eclipse.che.ide.ext.java.shared.dto.search.Match)

Aggregations

ArrayList (java.util.ArrayList)1 Field (org.eclipse.che.ide.ext.java.shared.dto.model.Field)1 ImportDeclaration (org.eclipse.che.ide.ext.java.shared.dto.model.ImportDeclaration)1 Initializer (org.eclipse.che.ide.ext.java.shared.dto.model.Initializer)1 Match (org.eclipse.che.ide.ext.java.shared.dto.search.Match)1