IDEA-76142: Gradle support - cannot update IDEA projects once one of build.gradle...
[idea/community.git] / plugins / gradle / src / org / jetbrains / plugins / gradle / diff / GradleProjectStructureHelperImpl.java
1 package org.jetbrains.plugins.gradle.diff;
2
3 import com.intellij.openapi.application.ex.ApplicationInfoEx;
4 import com.intellij.openapi.module.Module;
5 import com.intellij.openapi.module.ModuleManager;
6 import com.intellij.openapi.project.Project;
7 import com.intellij.openapi.roots.LanguageLevelProjectExtension;
8 import com.intellij.openapi.roots.ModuleRootManager;
9 import com.intellij.openapi.roots.OrderEntry;
10 import com.intellij.openapi.util.IconLoader;
11 import com.intellij.pom.java.LanguageLevel;
12 import org.jetbrains.annotations.NotNull;
13
14 import javax.swing.*;
15 import java.util.Arrays;
16 import java.util.Collection;
17
18 /**
19  * @author Denis Zhdanov
20  * @since 1/26/12 11:54 AM
21  */
22 public class GradleProjectStructureHelperImpl implements PlatformFacade {
23
24   @NotNull
25   @Override
26   public LanguageLevel getLanguageLevel(@NotNull Project project) {
27     return LanguageLevelProjectExtension.getInstance(project).getLanguageLevel();
28   }
29
30   @NotNull
31   @Override
32   public Collection<Module> getModules(@NotNull Project project) {
33     return Arrays.asList(ModuleManager.getInstance(project).getModules());
34   }
35
36   @NotNull
37   @Override
38   public Collection<OrderEntry> getOrderEntries(@NotNull Module module) {
39     return Arrays.asList(ModuleRootManager.getInstance(module).getOrderEntries());
40   }
41
42   @NotNull
43   @Override
44   public Icon getProjectIcon() {
45     return IconLoader.getIcon(ApplicationInfoEx.getInstanceEx().getSmallIconUrl());
46   }
47 }