Search in sources :

Example 1 with ProjectStructureConfigurable

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

the class PsLibraryDependencyNavigationPath method getHtmlText.

@NotNull
private String getHtmlText() {
    Place place = new Place();
    ProjectStructureConfigurable mainConfigurable = myContext.getMainConfigurable();
    DependenciesPerspectiveConfigurable target = mainConfigurable.findConfigurable(DependenciesPerspectiveConfigurable.class);
    assert target != null;
    putPath(place, target);
    target.putNavigationPath(place, myModuleName, myNavigationText);
    String href = GO_TO_PATH_TYPE + serialize(place);
    return String.format("<a href='%1$s'>%2$s</a> (%3$s)", href, myDependency, myModuleName);
}
Also used : DependenciesPerspectiveConfigurable(com.android.tools.idea.gradle.structure.configurables.DependenciesPerspectiveConfigurable) Place(com.intellij.ui.navigation.Place) ProjectStructureConfigurable(com.android.tools.idea.structure.dialog.ProjectStructureConfigurable) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ProjectStructureConfigurable

use of com.android.tools.idea.structure.dialog.ProjectStructureConfigurable 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

ProjectStructureConfigurable (com.android.tools.idea.structure.dialog.ProjectStructureConfigurable)2 AndroidProjectStructureConfigurable (com.android.tools.idea.gradle.structure.AndroidProjectStructureConfigurable)1 DependenciesPerspectiveConfigurable (com.android.tools.idea.gradle.structure.configurables.DependenciesPerspectiveConfigurable)1 ProjectStructureChangeListener (com.android.tools.idea.structure.dialog.ProjectStructureConfigurable.ProjectStructureChangeListener)1 Place (com.intellij.ui.navigation.Place)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 NotNull (org.jetbrains.annotations.NotNull)1