Example usage for com.google.gwt.eclipse.core.markers GWTProblemType getProblemType

List of usage examples for com.google.gwt.eclipse.core.markers GWTProblemType getProblemType

Introduction

In this page you can find the example usage for com.google.gwt.eclipse.core.markers GWTProblemType getProblemType.

Prototype

public static GWTProblemType getProblemType(int problemId) 

Source Link

Usage

From source file:com.google.gdt.eclipse.appengine.rpc.markers.quickfixes.ReqFactoryProblemMarkerResolutionGenerator.java

License:Open Source License

public IJavaCompletionProposal[] getCorrections(IInvocationContext context, IProblemLocation[] locations)
        throws CoreException {
    List<IJavaCompletionProposal> proposals = new ArrayList<IJavaCompletionProposal>();

    for (IProblemLocation problem : locations) {
        GWTProblemType problemType = GWTProblemType.getProblemType(problem.getProblemId());
        if (problemType == null) {
            continue;
        }/*from  ww w  . ja  va  2s. c  om*/
        switch (problemType) {
        case REQ_FACTORY_SERVICE_METHOD_ERROR:
            proposals.addAll(CreateRequestFactoryMethodProposal.createProposals(context.getCompilationUnit(),
                    context.getCoveringNode()));
            proposals.addAll(DeleteServiceMethodAnnotationProposal.createProposals(context.getCompilationUnit(),
                    context.getCoveringNode()));
            break;
        }
    }
    return proposals.toArray(new IJavaCompletionProposal[0]);
}

From source file:com.google.gdt.eclipse.appengine.rpc.markers.quickfixes.ReqFactoryProblemMarkerResolutionGenerator.java

License:Open Source License

public boolean hasCorrections(ICompilationUnit unit, int problemId) {
    GWTProblemType problemType = GWTProblemType.getProblemType(problemId);
    if (problemType != null) {
        switch (problemType) {
        case REQ_FACTORY_SERVICE_METHOD_ERROR:
            return true;
        default://from   w w w.  java  2s.co  m
            return false;
        }
    }
    // Non Request Factory problem
    return false;
}