Java Code Examples for com.intellij.ide.highlighter.JavaFileType#INSTANCE

The following examples show how to use com.intellij.ide.highlighter.JavaFileType#INSTANCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NoPolAction.java    From nopol with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	Project project = event.getData(PlatformDataKeys.PROJECT);
	Editor editor = event.getData(PlatformDataKeys.EDITOR);
	PsiFile currentFile = PsiUtilBase.getPsiFileInEditor(editor, project);

	if (JavaFileType.INSTANCE != currentFile.getFileType())
		return;

	try {
		File outputZip = File.createTempFile(project.getName(), ".zip");
		VirtualFile file = buildTestProject(project, editor, currentFile);
		Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(file);
		Ziper ziper = new Ziper(outputZip.getAbsolutePath(), project);

		//sources folder
		buildSources(ziper, module);

		//Classpath
		buildClasspath(ziper, module);

		ProgressManager.getInstance().run(new NoPolTask(project, "NoPol is Fixing", outputZip.getAbsolutePath()));
		ziper.close();
		this.parent.close(0);
	} catch (IOException e1) {
		throw new RuntimeException(e1);
	}
}
 
Example 2
Source File: AtMappingModel.java    From NutzCodeInsight with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
protected FileType filterValueFor(NavigationItem navigationItem) {
    return JavaFileType.INSTANCE;
}