/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ide.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.options.newEditor.OptionsEditorDialog;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;

public class ShowStructureSettingsAction extends AnAction implements DumbAware {
  public void actionPerformed(AnActionEvent e) {
    Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
    if (project == null) {
      project = ProjectManager.getInstance().getDefaultProject();
    }

    ShowSettingsUtil.getInstance().editConfigurable(project, OptionsEditorDialog.DIMENSION_KEY, ProjectStructureConfigurable.getInstance(project));
  }
}
@@ -629,16 +629,89 @@
 tions;%0A%0A
+import com.intellij.facet.Facet;%0Aimport com.intellij.facet.FacetManager;%0A
 import c
@@ -753,16 +753,16 @@
 Action;%0A
-
 import c
@@ -868,16 +868,109 @@
 taKeys;%0A
+import com.intellij.openapi.module.Module;%0Aimport com.intellij.openapi.module.ModuleManager;%0A
 import c
@@ -1306,16 +1306,57 @@
 gurable;
+%0Aimport com.intellij.openapi.ui.Messages;
 %0A%0Apublic
@@ -1663,150 +1663,1145 @@
     
-ShowSettingsUtil.getInstance().editConfigurable(project, OptionsEditorDialog.DIMENSION_KEY, ProjectStructureConfigurable.getInstance(project))
+// TEMPORARY HACK! DO NOT MERGE INTO INTELLIJ. This just works around a lot%0A    // of confusion caused by the fact that the structure dialog lets you edit%0A    // project state which is ignored by gradle, so temporarily disable this%0A    // dialog for Android-Gradle-based projects.%0A    if (isGradleProject(project)) %7B%0A      Messages.showInfoMessage(%0A        %22We will provide a UI to configure project settings later. %22 +%0A        %22Until then, please manually edit your build.gradle file(s.)%22,%0A        %22Project Structure%22);%0A      return;%0A    %7D%0A%0A    ShowSettingsUtil.getInstance().editConfigurable(project, OptionsEditorDialog.DIMENSION_KEY, ProjectStructureConfigurable.getInstance(project));%0A  %7D%0A%0A  private static boolean isGradleProject(Project project) %7B%0A    ModuleManager moduleManager = ModuleManager.getInstance(project);%0A    for (Module module : moduleManager.getModules()) %7B%0A      FacetManager facetManager = FacetManager.getInstance(module);%0A      for (Facet facet : facetManager.getAllFacets()) %7B%0A        if (%22android-gradle%22.equals(facet.getType().getStringId())) %7B%0A          return true;%0A        %7D%0A      %7D%0A    %7D%0A    return false
 ;%0A  

Disable project structure in Gradle projects (temporary hack)