Search in sources :

Example 1 with ProjectStructureChangeListener

use of com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.ProjectStructureChangeListener in project android by JetBrains.

the class AndroidShowStructureSettingsAction method showAndroidProjectStructure.

private static void showAndroidProjectStructure(@NotNull Project project) {
    if (GradleExperimentalSettings.getInstance().USE_NEW_PROJECT_STRUCTURE_DIALOG) {
        ProjectStructureConfigurable projectStructure = ProjectStructureConfigurable.getInstance(project);
        AtomicBoolean needsSync = new AtomicBoolean();
        ProjectStructureChangeListener changeListener = () -> needsSync.set(true);
        projectStructure.add(changeListener);
        projectStructure.showDialog();
        projectStructure.remove(changeListener);
        if (needsSync.get()) {
            GradleSyncInvoker.getInstance().requestProjectSyncAndSourceGeneration(project, null);
        }
        return;
    }
    AndroidProjectStructureConfigurable.getInstance(project).showDialog();
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ProjectStructureChangeListener(com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.ProjectStructureChangeListener) AndroidProjectStructureConfigurable(com.android.tools.idea.gradle.structure.AndroidProjectStructureConfigurable) ProjectStructureConfigurable(com.android.tools.idea.structure.dialog.ProjectStructureConfigurable)

Aggregations

AndroidProjectStructureConfigurable (com.android.tools.idea.gradle.structure.AndroidProjectStructureConfigurable)1 ProjectStructureConfigurable (com.android.tools.idea.structure.dialog.ProjectStructureConfigurable)1 ProjectStructureChangeListener (com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.ProjectStructureChangeListener)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1