Package de.janthomae.leiningenplugin.navigator

Source Code of de.janthomae.leiningenplugin.navigator.RefreshProjectsAction

package de.janthomae.leiningenplugin.navigator;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import de.janthomae.leiningenplugin.project.LeiningenProject;
import de.janthomae.leiningenplugin.project.LeiningenProjectException;
import de.janthomae.leiningenplugin.project.LeiningenProjectsManager;

import java.util.List;

/**
* @author <a href="janthomae@janthomae.de">Jan Thom&auml;</a>
* @version $Id:$
*/
public class RefreshProjectsAction extends AnAction {
    @Override
    public void actionPerformed(AnActionEvent e) {
        final Project theProject = e.getData(PlatformDataKeys.PROJECT);
        final LeiningenProjectsManager manager =
                LeiningenProjectsManager.getInstance(theProject);

        final List<LeiningenProject> projects = manager.getLeiningenProjects();
        for (LeiningenProject project : projects) {
            try {
                project.reimport(theProject);
            } catch (LeiningenProjectException e1) {
                // Just ignore it for now
            }
        }
    }
}
TOP

Related Classes of de.janthomae.leiningenplugin.navigator.RefreshProjectsAction

TOP
Copyright © 2018 www.massapi.com. 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.