Package org.mevenide.idea.project.actions

Source Code of org.mevenide.idea.project.actions.RefreshPomToolWindowAction

package org.mevenide.idea.project.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import org.mevenide.idea.Res;
import org.mevenide.idea.project.PomManager;
import org.mevenide.idea.project.ui.PomManagerPanel;
import org.mevenide.idea.util.actions.AbstractAnAction;
import org.mevenide.idea.util.ui.images.Icons;

/**
* @author Arik
*/
public class RefreshPomToolWindowAction extends AbstractAnAction {
    /**
     * Resources
     */
    private static final Res RES = Res.getInstance(RefreshPomToolWindowAction.class);

    public RefreshPomToolWindowAction() {
        super(RES.get("refresh.pom.win.action.name"),
              RES.get("refresh.pom.win.action.desc"),
              Icons.SYNC);
    }

    public void actionPerformed(final AnActionEvent pEvent) {
        final Project project = getProject(pEvent);
        if (project == null) {
            pEvent.getPresentation().setEnabled(false);
            return;
        }

        final PomManager pomMgr = PomManager.getInstance(project);
        final PomManagerPanel ui = pomMgr.getToolWindowComponent();
        if (ui != null)
            ui.refresh();
    }
}
TOP

Related Classes of org.mevenide.idea.project.actions.RefreshPomToolWindowAction

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.