// Path: src/mobi/hsz/idea/latex/LatexBundle.java
// public class LatexBundle {
// 
//     /** Gitignore plugin ID. */
//     @NonNls
//     public static final String PLUGIN_ID = "mobi.hsz.idea.latex";
//     
//     /** The {@link java.util.ResourceBundle} path. */
//     @NonNls
//     private static final String BUNDLE_NAME = "messages.LatexBundle";
// 
//     /** The {@link java.util.ResourceBundle} instance. */
//     private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
// 
//     /** Plugin name. */
//     @NonNls
//     public static final String NAME = "LaTeX";
// 
//     /** {@link LatexBundle} is a non-instantiable static class. */
//     private LatexBundle() {
//     }
// 
//     /**
//      * Loads a {@link String} from the {@link #BUNDLE} {@link java.util.ResourceBundle}.
//      *
//      * @param key    the key of the resource
//      * @param params the optional parameters for the specific resource
//      * @return the {@link String} value or {@code null} if no resource found for the key
//      */
//     public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
//         return CommonBundle.message(BUNDLE, key, params);
//     }
// 
//     /**
//      * Loads a {@link String} from the {@link #BUNDLE} {@link java.util.ResourceBundle}.
//      *
//      * @param key          the key of the resource
//      * @param defaultValue the default value that will be returned if there is nothing set
//      * @param params       the optional parameters for the specific resource
//      * @return the {@link String} value or {@code null} if no resource found for the key
//      */
//     public static String messageOrDefault(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, String defaultValue, Object... params) {
//         return CommonBundle.messageOrDefault(BUNDLE, key, defaultValue, params);
//     }
// 
// }


import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import mobi.hsz.idea.latex.LatexBundle;
import mobi.hsz.idea.latex.psi.LatexFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
        return false;
    }

    /**
     * Checks if action related type matched to the given element in document.
     *
     * @param element to check
     * @return element matches to the action related type
     */
    @Nullable
    protected PsiElement getMatchedElement(@Nullable PsiElement element) {
        while (element != null && !(element instanceof LatexFile)) {
            if (isMatching(element)) {
                return element;
            }
            element = element.getParent();
        }
        return null;
    }

    /**
     * Runs write action.
     *
     * @param project current project
     * @param action to run
     */
    final protected void runWriteAction(@NotNull final Project project, @NotNull final Runnable action) {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            @Override
            public void run() {
// Path: src/mobi/hsz/idea/latex/LatexBundle.java
// public class LatexBundle {
// 
//     /** Gitignore plugin ID. */
//     @NonNls
//     public static final String PLUGIN_ID = "mobi.hsz.idea.latex";
//     
//     /** The {@link java.util.ResourceBundle} path. */
//     @NonNls
//     private static final String BUNDLE_NAME = "messages.LatexBundle";
// 
//     /** The {@link java.util.ResourceBundle} instance. */
//     private static final ResourceBundle BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
// 
//     /** Plugin name. */
//     @NonNls
//     public static final String NAME = "LaTeX";
// 
//     /** {@link LatexBundle} is a non-instantiable static class. */
//     private LatexBundle() {
//     }
// 
//     /**
//      * Loads a {@link String} from the {@link #BUNDLE} {@link java.util.ResourceBundle}.
//      *
//      * @param key    the key of the resource
//      * @param params the optional parameters for the specific resource
//      * @return the {@link String} value or {@code null} if no resource found for the key
//      */
//     public static String message(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, Object... params) {
//         return CommonBundle.message(BUNDLE, key, params);
//     }
// 
//     /**
//      * Loads a {@link String} from the {@link #BUNDLE} {@link java.util.ResourceBundle}.
//      *
//      * @param key          the key of the resource
//      * @param defaultValue the default value that will be returned if there is nothing set
//      * @param params       the optional parameters for the specific resource
//      * @return the {@link String} value or {@code null} if no resource found for the key
//      */
//     public static String messageOrDefault(@PropertyKey(resourceBundle = BUNDLE_NAME) String key, String defaultValue, Object... params) {
//         return CommonBundle.messageOrDefault(BUNDLE, key, defaultValue, params);
//     }
// 
// }


// Path: src/mobi/hsz/idea/latex/actions/editor/base/EditorAction.java
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.TextEditor;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import mobi.hsz.idea.latex.LatexBundle;
import mobi.hsz.idea.latex.psi.LatexFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;

        return false;
    }

    /**
     * Checks if action related type matched to the given element in document.
     *
     * @param element to check
     * @return element matches to the action related type
     */
    @Nullable
    protected PsiElement getMatchedElement(@Nullable PsiElement element) {
        while (element != null && !(element instanceof LatexFile)) {
            if (isMatching(element)) {
                return element;
            }
            element = element.getParent();
        }
        return null;
    }

    /**
     * Runs write action.
     *
     * @param project current project
     * @param action to run
     */
    final protected void runWriteAction(@NotNull final Project project, @NotNull final Runnable action) {
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            @Override
            public void run() {
                CommandProcessor.getInstance().executeCommand(project, action, getName(), LatexBundle.NAME);