当前位置: 首页>>代码示例>>Java>>正文


Java PhpCompletionUtil类代码示例

本文整理汇总了Java中com.jetbrains.php.completion.PhpCompletionUtil的典型用法代码示例。如果您正苦于以下问题:Java PhpCompletionUtil类的具体用法?Java PhpCompletionUtil怎么用?Java PhpCompletionUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PhpCompletionUtil类属于com.jetbrains.php.completion包,在下文中一共展示了PhpCompletionUtil类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addCompletions

import com.jetbrains.php.completion.PhpCompletionUtil; //导入依赖的package包/类
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {

        if(!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
            return;
        }

        PhpIndex phpIndex = PhpIndex.getInstance(parameters.getOriginalFile().getProject());
        Map<String, String> entityNamespaces = ServiceXmlParserFactory.getInstance(parameters.getOriginalFile().getProject(), EntityNamesServiceParser.class).getEntityNameMap();

        // copied from PhpCompletionUtil::addClassesInNamespace looks the official way to find classes in namespaces
        // its a really performance nightmare

        Collection<String> names = phpIndex.getAllClassNames(new CamelHumpMatcher(resultSet.getPrefixMatcher().getPrefix()));
        for (String name : names) {
            Collection<PhpClass> classes = phpIndex.getClassesByName(name);

            for(Map.Entry<String, String> entry: entityNamespaces.entrySet()) {
                String namespaceFqn = PhpLangUtil.toFQN(entry.getValue());
                Collection<PhpClass> filtered = PhpCompletionUtil.filterByNamespace(classes, namespaceFqn);
                for (PhpClass phpClass : filtered) {
                    resultSet.addElement(new PhpClassLookupElement(phpClass, true, PhpClassReferenceInsertHandler.getInstance()));
                }
            }
        }
    }
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:26,代码来源:PhpEntityClassCompletionProvider.java

示例2: init

import com.jetbrains.php.completion.PhpCompletionUtil; //导入依赖的package包/类
private void init() {
    this.field = new EditorTextField("", project, com.jetbrains.php.lang.PhpFileType.INSTANCE);

    PhpCompletionUtil.installClassCompletion(this.field, null, getDisposable());

    this.field.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        public void documentChanged(DocumentEvent e) {
            String text = field.getText();
            if (StringUtil.isEmpty(text) || StringUtil.endsWith(text, "\\")) {
                return;
            }

            addUpdateRequest(250, () -> consumer.consume(field.getText()));
        }
    });

    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.fill = 1;
    gbConstraints.weightx = 1.0D;
    gbConstraints.gridx = 1;
    gbConstraints.gridy = 1;

    panel.add(field, gbConstraints);
}
 
开发者ID:Haehnchen,项目名称:idea-php-symfony2-plugin,代码行数:26,代码来源:ClassCompletionPanelWrapper.java

示例3: getPropertyValueCompletions

import com.jetbrains.php.completion.PhpCompletionUtil; //导入依赖的package包/类
@Override
public void getPropertyValueCompletions(AnnotationPropertyParameter parameter, AnnotationCompletionProviderParameter completionParameter) {
    if(!supports(parameter)) {
        return;
    }

    String className = "";
    PsiElement element = parameter.getElement();
    if(element instanceof StringLiteralExpression) {
        className = ((StringLiteralExpression) element).getContents();
    }

    PhpIndex phpIndex = PhpIndex.getInstance(parameter.getProject());
    PhpCompletionUtil.addClasses(className, completionParameter.getResult(), phpIndex, null);
}
 
开发者ID:Haehnchen,项目名称:idea-php-annotation-plugin,代码行数:16,代码来源:ClassCompletionProviderAbstract.java

示例4: createUIComponents

import com.jetbrains.php.completion.PhpCompletionUtil; //导入依赖的package包/类
private void createUIComponents() {
    namespaceField = new EditorTextField("", project, null);
    PhpCompletionUtil.installNamespaceCompletion(namespaceField, null, () -> {});
}
 
开发者ID:jiripudil,项目名称:intellij-nette-tester,代码行数:5,代码来源:NamespaceTableCellEditor.java


注:本文中的com.jetbrains.php.completion.PhpCompletionUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。