use of com.intellij.navigation.ItemPresentation in project intellij-plugins by JetBrains.
the class DartStructureViewElement method getPresentableText.
@Nullable
@Override
public String getPresentableText() {
final NavigatablePsiElement element = getElement();
final ItemPresentation presentation = element == null ? null : element.getPresentation();
return presentation == null ? null : presentation.getPresentableText();
}
use of com.intellij.navigation.ItemPresentation in project intellij-elixir by KronicDeth.
the class ElixirPsiImplUtil method getPresentation.
@Contract(pure = true)
@Nullable
public static ItemPresentation getPresentation(@NotNull final ElixirIdentifier identifier) {
Parameter parameter = new Parameter(identifier);
Parameter parameterizedParameter = Parameter.putParameterized(parameter);
ItemPresentation itemPresentation = null;
if ((parameterizedParameter.type == Parameter.Type.FUNCTION_NAME || parameterizedParameter.type == Parameter.Type.MACRO_NAME) && parameterizedParameter.parameterized != null) {
final NavigatablePsiElement parameterized = parameterizedParameter.parameterized;
if (parameterized instanceof Call) {
CallDefinitionClause callDefinitionClause = CallDefinitionClause.fromCall((Call) parameterized);
if (callDefinitionClause != null) {
itemPresentation = callDefinitionClause.getPresentation();
}
}
}
return itemPresentation;
}
use of com.intellij.navigation.ItemPresentation in project intellij-elixir by KronicDeth.
the class CallDefinition method getPresentation.
/**
* Returns the presentation of the tree element.
*
* @return the element presentation.
*/
@NotNull
@Override
public ItemPresentation getPresentation() {
ItemPresentation itemPresentation = modular.getPresentation();
String location = null;
if (itemPresentation instanceof Parent) {
Parent parentPresentation = (Parent) itemPresentation;
location = parentPresentation.getLocatedPresentableText();
}
// pseudo-named-arguments
boolean callback = false;
//noinspection ConstantConditions
return new NameArity(location, callback, time, visibility(), overridable, override, name, arity);
}
use of com.intellij.navigation.ItemPresentation in project intellij-elixir by KronicDeth.
the class Quote method getPresentation.
/*
* Methods
*/
/**
* Returns the presentation of the tree element.
*
* @return the element presentation.
*/
@NotNull
@Override
public ItemPresentation getPresentation() {
String location = null;
if (parent != null) {
ItemPresentation parentItemPresentation = parent.getPresentation();
if (parentItemPresentation instanceof Parent) {
Parent parentParentPresentation = (Parent) parentItemPresentation;
location = parentParentPresentation.getLocatedPresentableText();
}
}
return new org.elixir_lang.navigation.item_presentation.Quote(location, navigationItem);
}
use of com.intellij.navigation.ItemPresentation in project intellij-elixir by KronicDeth.
the class Use method getPresentation.
/**
* Returns the presentation of the tree element.
*
* @return the element presentation.
*/
@NotNull
@Override
public ItemPresentation getPresentation() {
ItemPresentation itemPresentation = modular.getPresentation();
String location = null;
if (itemPresentation instanceof Parent) {
Parent parentPresenation = (Parent) itemPresentation;
location = parentPresenation.getLocatedPresentableText();
}
PsiElement[] arguments = ElixirPsiImplUtil.finalArguments(navigationItem);
return new org.elixir_lang.navigation.item_presentation.Use(location, arguments);
}
Aggregations