disable project profiles in platform

This commit is contained in:
Anna Kozlova
2009-08-19 22:36:56 +04:00
parent 5528cdb00f
commit f8d1b6a48f
2 changed files with 6 additions and 15 deletions
@@ -51,7 +51,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
private final String myProfileType;
public String PROJECT_PROFILE;
public boolean USE_PROJECT_PROFILE = true;
public boolean USE_PROJECT_PROFILE = !isPlatform();
protected ApplicationProfileManager myApplicationProfileManager;
@@ -168,7 +168,7 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
@NotNull
public Profile getProjectProfileImpl(){
if (!USE_PROJECT_PROFILE) return myApplicationProfileManager.getRootProfile();
if (isPlatform() || !USE_PROJECT_PROFILE) return myApplicationProfileManager.getRootProfile();
if (PROJECT_PROFILE == null || myProfiles.isEmpty()){
@NonNls final String projectProfileName = "Project Default";
setProjectProfile(projectProfileName);
@@ -186,6 +186,10 @@ public abstract class DefaultProjectProfileManager extends ProjectProfileManager
return profile;
}
private static boolean isPlatform() {
return System.getProperty("idea.platform.prefix") != null;
}
public void addProfilesListener(ProfileChangeAdapter profilesListener) {
myProfilesListener.add(profilesListener);
}
@@ -33,7 +33,6 @@ import com.intellij.openapi.wm.impl.status.TogglePopupHintsPanel;
import com.intellij.packageDependencies.DependencyValidationManager;
import com.intellij.profile.DefaultProjectProfileManager;
import com.intellij.profile.Profile;
import com.intellij.profile.codeInspection.ui.ProjectInspectionToolsConfigurable;
import com.intellij.psi.PsiElement;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
@@ -214,18 +213,6 @@ public class InspectionProjectProfileManager extends DefaultProjectProfileManage
super.readExternal(element);
}
@NotNull
@Override
public Profile getProjectProfileImpl() {
try {
ProjectInspectionToolsConfigurable.getInstance(myProject);
}
catch (IllegalStateException e) { //disable project profile in platform
USE_PROJECT_PROFILE = false;
}
return super.getProjectProfileImpl();
}
public void writeExternal(final Element element) throws WriteExternalException {
super.writeExternal(element);
mySeverityRegistrar.writeExternal(element);