Examples of LookupElementBuilder


Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

    }

    private LookupElementBuilder getNodeAttributeLookupElement(Node node, Map<String, String> nodeVars, boolean isShortcut) {

        String nodeName = getNodeName(node);
        LookupElementBuilder lookupElementBuilder = LookupElementBuilder.create(nodeName).withIcon(Symfony2Icons.CONFIG_VALUE);

        String textContent = node.getTextContent();
        if(StringUtils.isNotBlank(textContent)) {
            lookupElementBuilder = lookupElementBuilder.withTailText("(" + textContent + ")", true);
        }
       
        if(nodeVars.containsKey(nodeName)) {
            lookupElementBuilder = lookupElementBuilder.withTypeText(StringUtil.shortenTextWithEllipsis(nodeVars.get(nodeName), 100, 0), true);
        }

        if(isShortcut) {
            lookupElementBuilder = lookupElementBuilder.withIcon(Symfony2Icons.CONFIG_VALUE_SHORTCUT);
        }

        return lookupElementBuilder;
    }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        // prototype "connection" must be "connections" so pluralize
        if(prototype) {
            nodeName = StringUtil.pluralize(nodeName);
        }

        LookupElementBuilder lookupElementBuilder = LookupElementBuilder.create(nodeName).withIcon(Symfony2Icons.CONFIG_PROTOTYPE);

        if(prototype) {
            lookupElementBuilder = lookupElementBuilder.withTypeText("Prototype", true);
        }

        if(isShortcut) {
            lookupElementBuilder = lookupElementBuilder.withIcon(Symfony2Icons.CONFIG_VALUE_SHORTCUT);
        }

        return lookupElementBuilder;
    }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        List<LookupElement> lookupElements = new ArrayList<LookupElement>();

        for(Field field: constraintPhpClass.getFields()) {
            if(!field.isConstant() && field.getModifier().isPublic()) {

                LookupElementBuilder lookupElement = LookupElementBuilder.create(field.getName()).withIcon(Symfony2Icons.SYMFONY);

                String defaultValue = PhpElementsUtil.getStringValue(field.getDefaultValue());
                if(defaultValue != null) {
                    lookupElement = lookupElement.withTypeText(defaultValue, true);
                }

                lookupElements.add(lookupElement);
            }
        }
View Full Code Here

Examples of com.intellij.codeInsight.lookup.LookupElementBuilder

        for(MethodReference methodReference: formBuilderTypes) {
            String fieldName = PsiElementUtils.getMethodParameterAt(methodReference, 0);
            if(fieldName != null) {

                LookupElementBuilder lookup = LookupElementBuilder.create(fieldName).withIcon(Symfony2Icons.FORM_TYPE);
                String fieldType = PsiElementUtils.getMethodParameterAt(methodReference, 1);
                if(fieldType != null) {
                    lookup = lookup.withTypeText(fieldType, true);
                }

                lookupElements.add(lookup);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.