// Copyright 2015 ThoughtWorks, Inc. // This file is part of getgauge/Intellij-plugin. // getgauge/Intellij-plugin is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // getgauge/Intellij-plugin is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with getgauge/Intellij-plugin. If not, see <http://www.gnu.org/licenses/>. package com.thoughtworks.gauge.annotator; import com.intellij.ide.actions.CreateClassAction; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiClass; import java.util.Map; public class GaugeCreateClassAction extends CreateClassAction { private PsiClass createdElement; @Override protected void postProcess(PsiClass createdElement, String templateName, Map<String, String> customProperties) { super.postProcess(createdElement, templateName, customProperties); this.createdElement = createdElement; } public VirtualFile getCreatedFile() { if (createdElement == null) { return null; } return createdElement.getContainingFile().getVirtualFile(); } }