當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。