com.twitter.intellij.pants.ui.PantsProjectRefresh.java Source code

Java tutorial

Introduction

Here is the source code for com.twitter.intellij.pants.ui.PantsProjectRefresh.java

Source

// Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

package com.twitter.intellij.pants.ui;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.twitter.intellij.pants.util.PantsUtil;

public class PantsProjectRefresh extends AnAction {
    @Override
    public void actionPerformed(AnActionEvent e) {
        Project project = e.getProject();
        if (project == null) {
            Messages.showInfoMessage("Project not found.", "Error");
            return;
        }
        PantsUtil.refreshAllProjects(project);
    }
}