Package com.dci.intellij.dbn.code.common.lookup

Examples of com.dci.intellij.dbn.code.common.lookup.LookupItemFactory


    @Override
    public void consume(Object object) throws ConsumerStoppedException {
        check();

        LookupItemFactory lookupItemFactory = null;
        if (object instanceof DBObject) {
            DBObject dbObject = (DBObject) object;
            lookupItemFactory = dbObject.getLookupItemFactory(context.getLanguage());

        } else if (object instanceof TokenElementType) {
            TokenElementType tokenElementType = (TokenElementType) object;
            lookupItemFactory = tokenElementType.getLookupItemFactory(context.getLanguage());
        }

        if (lookupItemFactory != null) {
            lookupItemFactory.createLookupItem(object, this);
        }

    }
View Full Code Here


                Set<LeafElementType> firstPossibleLeafs = elementTypeBundle.getRootElementType().getLookupCache().getFirstPossibleLeafs();
                for (LeafElementType firstPossibleLeaf : firstPossibleLeafs) {
                    if (firstPossibleLeaf instanceof TokenElementType) {
                        TokenElementType tokenElementType = (TokenElementType) firstPossibleLeaf;
                        if (context.getCodeCompletionFilterSettings().acceptReservedWord(tokenElementType.getTokenTypeCategory())) {
                            LookupItemFactory lookupItemFactory = tokenElementType.getLookupItemFactory(language);
                            lookupItemFactory.createLookupItem(tokenElementType, consumer);
                        }
                    }
                }
            } else {
                leafBeforeCaret = (LeafPsiElement) leafBeforeCaret.getOriginalElement();
View Full Code Here

                                if (psiElement instanceof IdentifierPsiElement) {
                                    IdentifierPsiElement identifierPsiElement = (IdentifierPsiElement) psiElement;
                                    PsiElement referencedPsiElement = identifierPsiElement.resolve();
                                    if (referencedPsiElement instanceof DBObject) {
                                        DBObject object = (DBObject) referencedPsiElement;
                                        LookupItemFactory lookupItemFactory = object.getLookupItemFactory(identifierElementType.getLanguage());
                                        lookupItemFactory.createLookupItem(object, consumer);
                                    }
                                }
                            }
                        }
                       
                        if (connectionHandler != null && !connectionHandler.isVirtual()) {
                            if (parentObject == null) {
                                BasePsiElement scope = element.getEnclosingScopePsiElement();
                                collectObjectMatchingScope(consumer, identifierElementType, filterSettings, scope, context);
                            } else {
                                for (DBObject object : parentObject.getChildObjects(identifierElementType.getObjectType())) {
                                    consumer.check();
                                    consumer.consume(object);
                                }
                            }
                        }

                    } else if (identifierElementType.isAlias()) {
                        PsiLookupAdapter lookupAdapter = new AliasDefinitionLookupAdapter(null, objectType,  null);
                        Set<BasePsiElement> aliasDefinitions = lookupAdapter.collectInParentScopeOf(element);
                        if (aliasDefinitions != null) {
                            for (PsiElement psiElement : aliasDefinitions) {
                                IdentifierPsiElement identifierPsiElement = (IdentifierPsiElement) psiElement;
                                AliasLookupItemFactory lookupItemFactory = new AliasLookupItemFactory(identifierPsiElement.getChars(), true);
                                lookupItemFactory.createLookupItem(identifierPsiElement, consumer);
                            }
                        }
                    } else if (identifierElementType.isVariable()) {
                        PsiLookupAdapter lookupAdapter = new VariableDefinitionLookupAdapter(null, objectType, null);
                        Set<BasePsiElement> aliasDefinitions = lookupAdapter.collectInParentScopeOf(element);
                        if (aliasDefinitions != null) {
                            for (BasePsiElement psiElement : aliasDefinitions) {
                                IdentifierPsiElement identifierPsiElement = (IdentifierPsiElement) psiElement;
                                VariableLookupItemFactory lookupItemFactory = new VariableLookupItemFactory(identifierPsiElement.getChars(), true);
                                lookupItemFactory.createLookupItem(identifierPsiElement, consumer);
                            }
                        }
                    }
                } else if (identifierElementType.isDefinition()) {
                    if (identifierElementType.isAlias()) {
                        String[] aliasNames = buildAliasDefinitionNames(element);
                        for (String aliasName : aliasNames) {
                            AliasLookupItemFactory lookupItemFactory = new AliasLookupItemFactory(aliasName, true);
                            lookupItemFactory.createLookupItem(aliasName, consumer);
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.code.common.lookup.LookupItemFactory

Copyright © 2018 www.massapicom. 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.