本文整理汇总了Java中com.jetbrains.php.PhpIcons类的典型用法代码示例。如果您正苦于以下问题:Java PhpIcons类的具体用法?Java PhpIcons怎么用?Java PhpIcons使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PhpIcons类属于com.jetbrains.php包,在下文中一共展示了PhpIcons类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExceptionTypes
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
private List<Trinity> getExceptionTypes() {
List<Trinity> types = new ArrayList<Trinity>();
types.add(new Trinity("Exception", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("Error", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("BadFunctionCallException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("BadMethodCallException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("DomainException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("InvalidArgumentException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("LengthException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("LogicException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("OutOfBoundsException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("OutOfRangeException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("OverflowException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("RangeException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("RuntimeException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("UnderflowException", PhpIcons.EXCEPTION, "PHP Exception"));
types.add(new Trinity("UnexpectedValueException", PhpIcons.EXCEPTION, "PHP Exception"));
return types;
}
示例2: getAvailableTemplates
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
private List<Trinity> getAvailableTemplates() {
List<Trinity> templates = new ArrayList<Trinity>();
FileTemplate classTemplate = FileTemplateManager.getInstance(this.myProject).getInternalTemplate("PHP Class");
for (FileTemplate template : FileTemplateManager.getInstance(this.myProject).getAllTemplates()) {
if (template.getExtension().equals("class.php")) {
templates.add(new Trinity(template.getName(), PhpIcons.CLASS, template));
}
}
if (templates.size() < 1) {
templates.add(new Trinity(classTemplate.getName(), PhpIcons.CLASS, classTemplate));
}
return templates;
}
示例3: addCompletions
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}
Collection<String> keys = LayoutIndex.getAllKeys(ContainerNameIndex.KEY, position.getProject());
for (String key: keys) {
result.addElement(
LookupElementBuilder.create(key).withIcon(PhpIcons.XML_TAG_ICON)
);
}
}
示例4: addCompletions
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}
Collection<String> keys = LayoutIndex.getAllKeys(BlockNameIndex.KEY, position.getProject());
for (String key: keys) {
result.addElement(
LookupElementBuilder.create(key).withIcon(PhpIcons.XML_TAG_ICON)
);
}
}
示例5: addCompletions
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}
String prefix = result.getPrefixMatcher().getPrefix();
DiIndex index = DiIndex.getInstance(position.getProject());
Collection<String> elements = index.getAllVirtualTypeElementNames(new PlainPrefixMatcher(prefix), position.getResolveScope());
for (String elementName:elements) {
result.addElement(
LookupElementBuilder
.create(elementName)
.withIcon(PhpIcons.CLASS_ICON)
);
}
}
示例6: addCompletions
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull CompletionResultSet result) {
PsiElement position = parameters.getPosition().getOriginalElement();
if (position == null) {
return;
}
List<XmlFile> targets = LayoutIndex.getLayoutFiles(position.getProject());
if (targets.size() > 0) {
for (XmlFile file : targets) {
result.addElement(
LookupElementBuilder
.create(file.getVirtualFile().getNameWithoutExtension())
.withIcon(PhpIcons.XML_TAG_ICON)
);
}
}
}
示例7: getVariants
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@NotNull
@Override
public Object[] getVariants() {
List<LookupElement> variants = new ArrayList<LookupElement>();
List<String> definedArguments = getAlreadyConfiguredArguments();
for (Parameter parameter: getParameters()) {
String argumentName = parameter.getName();
if (definedArguments.contains(argumentName)) {
continue;
}
variants.add(
LookupElementBuilder
.create(argumentName)
.withIcon(PhpIcons.PARAMETER)
.withTypeText(parameter.getDeclaredType().toStringResolved())
);
}
return variants.toArray();
}
示例8: getPresentation
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Nullable
@Override
public ProviderPresentation getPresentation() {
return new ProviderPresentation() {
@Nullable
@Override
public Icon getIcon() {
return PhpIcons.FUNCTION;
}
@Nullable
@Override
public String getDescription() {
return "Functions";
}
};
}
示例9: collectPushOverwrites
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
/**
* Support: @push('foobar')
*/
@NotNull
private Collection<LineMarkerInfo> collectPushOverwrites(@NotNull LeafPsiElement psiElement, @NotNull String sectionName) {
final List<GotoRelatedItem> gotoRelatedItems = new ArrayList<>();
BladeTemplateUtil.visitUpPath(psiElement.getContainingFile(), 10, parameter -> {
if(sectionName.equalsIgnoreCase(parameter.getContent())) {
gotoRelatedItems.add(new RelatedPopupGotoLineMarker.PopupGotoRelatedItem(parameter.getPsiElement()).withIcon(LaravelIcons.LARAVEL, LaravelIcons.LARAVEL));
}
}, BladeTokenTypes.STACK_DIRECTIVE);
if(gotoRelatedItems.size() == 0) {
return Collections.emptyList();
}
return Collections.singletonList(
getRelatedPopover("Stack Section", "Stack Overwrites", psiElement, gotoRelatedItems, PhpIcons.OVERRIDES)
);
}
示例10: attachTemplateBlocks
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
public void attachTemplateBlocks(PsiElement psiElement, Collection<LineMarkerInfo> lineMarkerInfos) {
SmartyBlockGoToHandler goToHandler = new SmartyBlockGoToHandler();
PsiElement[] gotoDeclarationTargets = goToHandler.getGotoDeclarationTargets(psiElement, 0, null);
if(gotoDeclarationTargets == null || gotoDeclarationTargets.length == 0) {
return;
}
List<PsiElement> psiElements = Arrays.asList(gotoDeclarationTargets);
if(psiElements.size() == 0) {
return;
}
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(PhpIcons.OVERRIDES).
setTargets(psiElements).
setTooltipText("Navigate to block");
lineMarkerInfos.add(builder.createLineMarkerInfo(psiElement));
}
示例11: attachExtends
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
public void attachExtends(final SmartyFile smartyFile, final List<GotoRelatedItem> gotoRelatedItems) {
final String templateName = TemplateUtil.getTemplateName(smartyFile.getProject(), smartyFile.getVirtualFile());
if(templateName == null) {
return;
}
FileBasedIndexImpl.getInstance().getFilesWithKey(SmartyExtendsStubIndex.KEY, new HashSet<>(Arrays.asList(templateName)), virtualFile -> {
PsiFile psiFile = PsiManager.getInstance(smartyFile.getProject()).findFile(virtualFile);
if(psiFile != null) {
gotoRelatedItems.add(new RelatedPopupGotoLineMarker.PopupGotoRelatedItem(psiFile, TemplateUtil.getTemplateName(psiFile.getProject(), psiFile.getVirtualFile())).withIcon(PhpIcons.IMPLEMENTED, PhpIcons.IMPLEMENTED));
}
return true;
}, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(smartyFile.getProject()), SmartyFileType.INSTANCE));
}
示例12: getVariants
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@NotNull
@Override
public Object[] getVariants() {
final List<LookupElement> lookupElements = new ArrayList<>();
PhpClass phpClass = PsiTreeUtil.getParentOfType(getElement(), PhpClass.class);
if(phpClass == null) {
return lookupElements.toArray();
}
for(Method method: phpClass.getMethods()) {
if(method.getModifier().isPublic() && !method.getName().startsWith("_")) {
lookupElements.add(LookupElementBuilder.create(method.getName()).withIcon(PhpIcons.METHOD).withTypeText("Method", true));
}
}
return lookupElements.toArray();
}
示例13: renderElement
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
super.renderElement(presentation);
presentation.setItemTextBold(withBoldness);
presentation.setIcon(Symfony2Icons.DOCTRINE);
presentation.setTypeGrayed(true);
if(this.doctrineModelField.getTypeName() != null) {
presentation.setTypeText(this.doctrineModelField.getTypeName());
}
if(this.doctrineModelField.getRelationType() != null) {
presentation.setTailText(String.format("(%s)", this.doctrineModelField.getRelationType()), true);
}
if(this.doctrineModelField.getRelation() != null) {
presentation.setTypeText(this.doctrineModelField.getRelation());
presentation.setIcon(PhpIcons.CLASS_ICON);
}
}
示例14: renderRequestDetails
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
private void renderRequestDetails(@NotNull ProfilerRequestInterface profilerRequest) {
DefaultListModel<RequestDetails> listModel = (DefaultListModel<RequestDetails>) listRequestDetails.getModel();
listModel.removeAllElements();
DefaultDataCollectorInterface defaultDataCollector = profilerRequest.getCollector(DefaultDataCollectorInterface.class);
if(defaultDataCollector != null) {
if(defaultDataCollector.getRoute() != null) {
listModel.addElement(new RequestDetails(defaultDataCollector.getRoute(), Symfony2Icons.ROUTE));
}
if(defaultDataCollector.getController() != null) {
listModel.addElement(new RequestDetails(defaultDataCollector.getController(), PhpIcons.METHOD_ICON));
}
if(defaultDataCollector.getTemplate() != null) {
listModel.addElement(new RequestDetails(defaultDataCollector.getTemplate(), TwigIcons.TwigFileIcon));
}
}
}
示例15: getPresentation
import com.jetbrains.php.PhpIcons; //导入依赖的package包/类
@Nullable
@Override
public ProviderPresentation getPresentation() {
return new ProviderPresentation() {
@Nullable
@Override
public Icon getIcon() {
return PhpIcons.METHOD_ICON;
}
@Nullable
@Override
public String getDescription() {
return "Controller";
}
};
}