Example usage for org.eclipse.jdt.core CompletionFlags isStaticImport

List of usage examples for org.eclipse.jdt.core CompletionFlags isStaticImport

Introduction

In this page you can find the example usage for org.eclipse.jdt.core CompletionFlags isStaticImport.

Prototype

public static boolean isStaticImport(int flags) 

Source Link

Document

Returns whether the given integer includes the #StaticImport flag.

Usage

From source file:edu.brown.cs.bubbles.bedrock.BedrockUtil.java

License:Open Source License

/********************************************************************************/

static void outputCompletion(CompletionProposal cp, IvyXmlWriter xw) {
    xw.begin("COMPLETION");
    fieldValue(xw, "ACCESSIBILITY", cp.getAccessibility(), accessibility_types);
    if (cp.isConstructor())
        xw.field("CONSTRUCTOR", true);
    xw.field("TEXT", cp.getCompletion());
    xw.field("INDEX", cp.getCompletionLocation());
    xw.field("DECLKEY", cp.getDeclarationKey());
    switch (cp.getKind()) {
    case CompletionProposal.ANNOTATION_ATTRIBUTE_REF:
    case CompletionProposal.ANONYMOUS_CLASS_DECLARATION:
    case CompletionProposal.FIELD_IMPORT:
    case CompletionProposal.FIELD_REF:
    case CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER:
    case CompletionProposal.METHOD_IMPORT:
    case CompletionProposal.METHOD_REF:
    case CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER:
    case CompletionProposal.METHOD_DECLARATION:
    case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
        xw.field("DECLSIGN", cp.getDeclarationSignature());
        break;/*from  ww  w  .  j a  va2 s .co m*/
    case CompletionProposal.PACKAGE_REF:
    case CompletionProposal.TYPE_IMPORT:
    case CompletionProposal.TYPE_REF:
        xw.field("DOTNAME", cp.getDeclarationSignature());
        break;
    }
    fieldFlags(xw, "ACCESS", cp.getFlags(), access_flags);
    xw.field("FLAGS", cp.getFlags());
    xw.field("KEY", cp.getKey());
    xw.field("NAME", cp.getName());
    xw.field("RELEVANCE", cp.getRelevance());
    xw.field("REPLACE_START", cp.getReplaceStart());
    xw.field("REPLACE_END", cp.getReplaceEnd());
    xw.field("SIGNATURE", cp.getSignature());
    xw.field("TOKEN_START", cp.getTokenStart());
    xw.field("TOKEN_END", cp.getTokenEnd());
    fieldValue(xw, "KIND", cp.getKind(), completion_types);
    if (cp instanceof ICompletionProposalExtension4) {
        ICompletionProposalExtension4 icp4 = (ICompletionProposalExtension4) cp;
        xw.field("AUTO", icp4.isAutoInsertable());
    }

    if (CompletionFlags.isStaticImport(cp.getAdditionalFlags()))
        xw.field("STATICIMPORT", true);

    if (cp.getKind() == CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER
            || cp.getKind() == CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER) {
        xw.field("RECEIVER_SIGN", cp.getReceiverSignature());
        xw.field("RECEIVER_START", cp.getReceiverStart());
        xw.field("RECEIVER_END", cp.getReceiverEnd());
    }
    xw.field("RCVR", cp.getReceiverSignature());

    xw.cdataElement("DESCRIPTION", cp.toString());

    CompletionProposal[] rq = cp.getRequiredProposals();
    if (rq != null) {
        xw.begin("REQUIRED");
        for (CompletionProposal xcp : rq)
            outputCompletion(xcp, xw);
        xw.end("REQUIRED");
    }

    xw.end("COMPLETION");
}