Package com.intellij.navigation

Examples of com.intellij.navigation.ItemPresentation


    super(haxeNamedComponent, buildPresentationText(haxeNamedComponent), haxeNamedComponent.getIcon(Iconable.ICON_FLAG_VISIBILITY));
  }

  @Nullable
  private static String buildPresentationText(DartComponent haxeNamedComponent) {
    final ItemPresentation presentation = haxeNamedComponent.getPresentation();
    if (presentation == null) {
      return haxeNamedComponent.getName();
    }
    final StringBuilder result = new StringBuilder();
    if (haxeNamedComponent instanceof DartClass) {
      result.append(haxeNamedComponent.getName());
      final String location = presentation.getLocationString();
      if (location != null && !location.isEmpty()) {
        result.append(" ").append(location);
      }
    }
    else {
      result.append(presentation.getPresentableText());
    }
    return result.toString();
  }
View Full Code Here


    return isConstructor && myConstructorCompletion;
  }

  @Override
  public void renderElement(LookupElementPresentation presentation) {
    final ItemPresentation myComponentNamePresentation = myComponentName.getPresentation();
    if (myComponentNamePresentation == null) {
      presentation.setItemText(getLookupString());
      return;
    }
    String text = myComponentNamePresentation.getPresentableText();
    presentation.setItemText(text);
    presentation.setIcon(myComponentNamePresentation.getIcon(true));
    final String pkg = myComponentNamePresentation.getLocationString();
    if (StringUtil.isNotEmpty(pkg)) {
      presentation.setTailText(" " + pkg, true);
    }
  }
View Full Code Here

    return null;
  }

  @Override
  public Icon getIcon(int flags) {
    final ItemPresentation presentation = getPresentation();
    return presentation == null ? super.getIcon(flags) : presentation.getIcon(true);
  }
View Full Code Here

    return null;
  }

  @Override
  public ItemPresentation getPresentation() {
    return new ItemPresentation() {
      @Override
      public String getPresentableText() {
        final StringBuilder result = new StringBuilder();
        result.append(getComponentName());
        final DartComponentType type = DartComponentType.typeOf(AbstractDartComponentImpl.this);
View Full Code Here

    return null;
  }

  @Override
  public Icon getIcon(int flags) {
    final ItemPresentation presentation = getPresentation();
    return presentation == null ? super.getIcon(flags) : presentation.getIcon(true);
  }
View Full Code Here

  @Nullable
  @Override
  public ItemPresentation getPresentation(@NotNull final GrMethodCall item) {
    if (!GrCucumberUtil.isStepDefinition(item)) return null;
    return new ItemPresentation() {
      @Nullable
      @Override
      public String getPresentableText() {
        final String stepRef = GrCucumberUtil.getCucumberStepRef(item).getText();
        final String pattern = GrCucumberUtil.getStepDefinitionPattern(item).getText();
        return CucumberBundle.message("step.definition.0.1", stepRef, pattern);
      }

      @Nullable
      @Override
      public String getLocationString() {
        final PsiFile file = item.getContainingFile();
        final ItemPresentation presentation = ItemPresentationProviders.getItemPresentation(file);
        LOG.assertTrue(presentation != null, file.getClass().getName());
        return presentation.getPresentableText();
      }

      @Nullable
      @Override
      public Icon getIcon(boolean unused) {
View Full Code Here

    return children.length > 0 ? children[0].getPsi() : null;
  }

  @Override
  public ItemPresentation getPresentation() {
    return new ItemPresentation() {
      public String getPresentableText() {
        return GherkinPsiElementBase.this.getPresentableText();
      }

      public String getLocationString() {
View Full Code Here

*/
public class ReferenceExpressionPsiTest extends PsiTestCase {

  public void testSimpleReference() {
    final OgnlReferenceExpression expression = parse("exp");
    final ItemPresentation presentation = expression.getPresentation();
    assertNotNull(presentation);
    assertEquals("exp", presentation.getPresentableText());
    assertNull(expression.getType());

    final PsiReference reference = expression.getReference();
    assertNotNull(reference);
    assertEquals("exp", reference.getCanonicalText());
View Full Code Here

        return processor.execute(this, state);
    }

    @Override
    public ItemPresentation getPresentation() {
        return new ItemPresentation() {
            public String getPresentableText() {
                return getName();
            }

            public TextAttributesKey getTextAttributesKey() {
View Full Code Here

        return "TypeNameDeclaration(" + getName() + ")";
    }

    @Override
    public ItemPresentation getPresentation() {
        return new ItemPresentation() {
          public String getPresentableText() {
            return getName();
          }

          public TextAttributesKey getTextAttributesKey() {
View Full Code Here

TOP

Related Classes of com.intellij.navigation.ItemPresentation

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.