package nl.rubensten.texifyidea.structure;

import nl.rubensten.texifyidea.psi.LatexCommands;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * @author Ruben Schellekens
 */
public class LatexOtherCommandPresentation implements EditableHintPresentation {

    private final String commandName;
    private final Icon icon;
    private String hint = "";

    public LatexOtherCommandPresentation(LatexCommands command, Icon icon) {
        this.commandName = command.getName();
        this.icon = icon;
    }

    @Nullable
    @Override
    public String getPresentableText() {
        return commandName;
    }

    @Nullable
    @Override
    public String getLocationString() {
        return hint;
    }

    @Nullable
    @Override
    public Icon getIcon(boolean b) {
        return icon;
    }

    @Override
    public void setHint(@NotNull String hint) {
        this.hint = hint;
    }
}

@@ -33,24 +33,73 @@
 structure;%0A%0A
+import com.intellij.navigation.ItemPresentation;%0A
 import nl.ru
@@ -147,40 +147,46 @@
 ort 
-org.jetbrains.annotations.NotNul
+nl.rubensten.texifyidea.util.TexifyUti
 l;%0Ai
@@ -346,20 +346,12 @@
 nts 
-EditableHint
+Item
 Pres
@@ -445,24 +445,35 @@
 ate 
+final 
 String 
-hint = %22%22
+locationString
 ;%0A%0A 
@@ -615,24 +615,315 @@
 icon = icon;
+%0A%0A        LatexCommands firstNext = TexifyUtil.getNextCommand(command);%0A        if (firstNext == null) %7B%0A            locationString = %22%22;%0A            return;%0A        %7D%0A%0A        String lookup = firstNext.getCommandToken().getText();%0A        this.locationString = lookup == null ? %22%22 : lookup;
 %0A    %7D%0A%0A    
@@ -1105,20 +1105,30 @@
  return 
-hint
+locationString
 ;%0A    %7D%0A
@@ -1189,24 +1189,24 @@
 oolean b) %7B%0A
+
         retu
@@ -1223,102 +1223,7 @@
    %7D
-%0A%0A    @Override%0A    public void setHint(@NotNull String hint) %7B%0A        this.hint = hint;%0A    %7D
 %0A%7D%0A

Structure view contains value of \def or \let definition.