use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class GriffonFramework method updateProjectStructure.
@Override
public void updateProjectStructure(@NotNull final Module module) {
if (!MvcModuleStructureUtil.isEnabledStructureUpdate())
return;
final VirtualFile root = findAppRoot(module);
if (root == null)
return;
WriteAction.run(() -> {
MvcModuleStructureUtil.updateModuleStructure(module, createProjectStructure(module, false), root);
if (hasSupport(module)) {
MvcModuleStructureUtil.updateAuxiliaryPluginsModuleRoots(module, this);
MvcModuleStructureUtil.updateGlobalPluginModule(module.getProject(), this);
}
});
final Project project = module.getProject();
ChangeListManager.getInstance(project).addFilesToIgnore(IgnoredBeanFactory.ignoreUnderDirectory(getUserHomeGriffon(), project));
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class ExpandAllAction method update.
@Override
public void update(AnActionEvent e) {
final Project project = e.getProject();
if (project == null) {
e.getPresentation().setEnabled(false);
return;
}
e.getPresentation().setEnabled(DynamicToolWindowWrapper.getInstance(project).getTreeTable().getRowCount() > 0);
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class ExpandAllAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
final TreeTableTree tree = DynamicToolWindowWrapper.getInstance(project).getTreeTable().getTree();
TreeUtil.expandAll(tree);
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class SceneBuilderImpl method isCompatibleLanguageLevel.
private static boolean isCompatibleLanguageLevel(@NotNull PsiClass aClass, @Nullable LanguageLevel targetLevel) {
if (targetLevel == null)
return true;
final Project project = aClass.getProject();
final VirtualFile vFile = PsiUtilCore.getVirtualFile(aClass);
if (vFile == null)
return true;
Module module = ProjectRootManager.getInstance(project).getFileIndex().getModuleForFile(vFile);
if (module == null) {
final OrderEntry entry = LibraryUtil.findLibraryEntry(vFile, project);
if (entry != null) {
module = entry.getOwnerModule();
}
}
Sdk jdk = module != null ? ModuleRootManager.getInstance(module).getSdk() : null;
if (jdk == null) {
jdk = ProjectRootManager.getInstance(project).getProjectSdk();
}
if (jdk == null)
return true;
final String versionString = jdk.getVersionString();
if (versionString != null) {
final JavaSdkVersion jdkVersion = JdkVersionUtil.getVersion(versionString);
if (jdkVersion != null) {
return targetLevel.isAtLeast(jdkVersion.getMaxLanguageLevel());
}
}
return true;
}
use of com.intellij.openapi.project.Project in project intellij-community by JetBrains.
the class JavaFxArtifactProperties method onBuildFinished.
@Override
public void onBuildFinished(@NotNull final Artifact artifact, @NotNull final CompileContext compileContext) {
if (!(artifact.getArtifactType() instanceof JavaFxApplicationArtifactType)) {
return;
}
final Project project = compileContext.getProject();
final Set<Module> modules = ReadAction.compute(() -> ArtifactUtil.getModulesIncludedInArtifacts(Collections.singletonList(artifact), project));
if (modules.isEmpty()) {
return;
}
Sdk fxCompatibleSdk = null;
for (Module module : modules) {
final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
if (sdk != null && sdk.getSdkType() instanceof JavaSdk) {
if (((JavaSdk) sdk.getSdkType()).isOfVersionOrHigher(sdk, JavaSdkVersion.JDK_1_7)) {
fxCompatibleSdk = sdk;
break;
}
}
}
if (fxCompatibleSdk == null) {
compileContext.addMessage(CompilerMessageCategory.ERROR, "Java version 7 or higher is required to build JavaFX package", null, -1, -1);
return;
}
final JavaFxArtifactProperties properties = (JavaFxArtifactProperties) artifact.getProperties(JavaFxArtifactPropertiesProvider.getInstance());
final JavaFxPackager javaFxPackager = new JavaFxPackager(artifact, properties, project) {
@Override
protected void registerJavaFxPackagerError(String message) {
compileContext.addMessage(CompilerMessageCategory.ERROR, message, null, -1, -1);
}
};
javaFxPackager.buildJavaFxArtifact(fxCompatibleSdk.getHomePath());
}
Aggregations