Package de.janthomae.leiningenplugin.project

Examples of de.janthomae.leiningenplugin.project.LeiningenProjectsManager


*/
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
View Full Code Here


*/
public class AddManagedFilesAction extends AnAction {
    @Override
    public void actionPerformed(AnActionEvent e) {
        final Project ideaProject = e.getData(PlatformDataKeys.PROJECT);
        final LeiningenProjectsManager manager =
                LeiningenProjectsManager.getInstance(ideaProject);

        FileChooserDescriptor leinProjectFileDescriptor = new FileChooserDescriptor(true, false, false, false, false, true) {
            @Override
            public boolean isFileSelectable(VirtualFile file) {
                return super.isFileSelectable(file) && !manager.isManagedFile(file);
            }

            @Override
            public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
                return (file.isDirectory() || LeiningenProjectsManager.isProjectFile(file)) &&
                        super.isFileVisible(file, showHiddenFiles);
            }
        };

        VirtualFile fileToSelect = e.getData(PlatformDataKeys.VIRTUAL_FILE);

        FileChooserDialog dialog = FileChooserFactory.getInstance().createFileChooser(leinProjectFileDescriptor, ideaProject,null);

        VirtualFile[] files = dialog.choose(fileToSelect,ideaProject);
        if (files.length == 0) return;

        for (VirtualFile file : files) {
            manager.importLeiningenProject(file, ideaProject);
        }
    }
View Full Code Here

TOP

Related Classes of de.janthomae.leiningenplugin.project.LeiningenProjectsManager

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.