<commit_before>package nl.rubensten.texifyidea.editor;

import com.intellij.ide.projectView.PresentationData;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.projectView.ProjectViewNodeDecorator;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packageDependencies.ui.PackageDependenciesNode;
import com.intellij.ui.ColoredTreeCellRenderer;
import nl.rubensten.texifyidea.TexifyIcons;

/**
 * @author <NAME>
 */
public class TeXiFyProjectViewNodeDecorator implements ProjectViewNodeDecorator {

    @Override
    public void decorate(ProjectViewNode projectViewNode, PresentationData presentationData) {
        VirtualFile file = projectViewNode.getVirtualFile();
        if (file.isDirectory()) {
            return;
        }

        if (file.getExtension().equalsIgnoreCase("pdf")) {
            presentationData.setIcon(TexifyIcons.PDF_FILE);
        }
    }

    @Override
    public void decorate(PackageDependenciesNode packageDependenciesNode, ColoredTreeCellRenderer coloredTreeCellRenderer) {
        // Do nothing.
    }
}<commit_msg>Forgot to mention Fixed #44. Refactored the node decorator a tad.<commit_after>package nl.rubensten.texifyidea.editor;

import com.intellij.ide.projectView.PresentationData;
import com.intellij.ide.projectView.ProjectViewNode;
import com.intellij.ide.projectView.ProjectViewNodeDecorator;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.packageDependencies.ui.PackageDependenciesNode;
import com.intellij.ui.ColoredTreeCellRenderer;
import nl.rubensten.texifyidea.TexifyIcons;

import javax.swing.*;
import java.util.HashMap;
import java.util.Map;

/**
 * @author <NAME>
 */
public class TeXiFyProjectViewNodeDecorator implements ProjectViewNodeDecorator {

    private static final Map<String, Icon> FILE_ICONS = new HashMap<>();
    static {
        FILE_ICONS.put("pdf", TexifyIcons.PDF_FILE);
    }

    private void setIcon(ProjectViewNode projectViewNode, PresentationData presentationData) {
        VirtualFile file = projectViewNode.getVirtualFile();
        if (file.isDirectory()) {
            return;
        }

        String extension = file.getExtension();
        if (extension == null) {
            return;
        }

        Icon icon = FILE_ICONS.get(file.getExtension().toLowerCase());
        if (icon == null) {
            return;
        }

        presentationData.setIcon(icon);
    }

    @Override
    public void decorate(ProjectViewNode projectViewNode, PresentationData presentationData) {
        setIcon(projectViewNode, presentationData);
    }

    @Override
    public void decorate(PackageDependenciesNode packageDependenciesNode, ColoredTreeCellRenderer coloredTreeCellRenderer) {
        // Do nothing.
    }
}
{'fraction_non_alphanumeric': 0.09057971014492754, 'fraction_numerical': 0.0007246376811594203, 'mean_word_length': 3.818499127399651, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3404162', 'n_tokens_mistral': 806, 'n_tokens_neox': 784, 'n_words': 143}