Search in sources :

Example 1 with BuildVariantView

use of com.android.tools.idea.gradle.variant.view.BuildVariantView in project android by JetBrains.

the class SelectBuildVariantAction method doPerform.

@Override
protected void doPerform(@NotNull AnActionEvent e, @NotNull final Project project) {
    final Module module = getSelectedAndroidModule(e);
    if (module != null) {
        ToolWindowManager manager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow = manager.getToolWindow(BuildVariantToolWindowFactory.ID);
        if (toolWindow != null) {
            toolWindow.activate(new Runnable() {

                @Override
                public void run() {
                    BuildVariantView view = BuildVariantView.getInstance(project);
                    view.findAndSelectVariantEditor(module);
                }
            });
        }
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) BuildVariantView(com.android.tools.idea.gradle.variant.view.BuildVariantView) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) AbstractProjectStructureAction.getSelectedAndroidModule(com.android.tools.idea.gradle.actions.AbstractProjectStructureAction.getSelectedAndroidModule) Module(com.intellij.openapi.module.Module)

Example 2 with BuildVariantView

use of com.android.tools.idea.gradle.variant.view.BuildVariantView in project android by JetBrains.

the class SyncProjectActionTest method testDoPerform.

public void testDoPerform() {
    Project project = getProject();
    BuildVariantView buildVariantView = IdeComponents.replaceServiceWithMock(project, BuildVariantView.class);
    myAction.doPerform(myEvent, project);
    assertTrue(myPresentation.isEnabled());
    verify(mySyncInvoker).requestProjectSyncAndSourceGeneration(project, null);
    verify(buildVariantView).projectImportStarted();
}
Also used : Project(com.intellij.openapi.project.Project) BuildVariantView(com.android.tools.idea.gradle.variant.view.BuildVariantView)

Aggregations

BuildVariantView (com.android.tools.idea.gradle.variant.view.BuildVariantView)2 AbstractProjectStructureAction.getSelectedAndroidModule (com.android.tools.idea.gradle.actions.AbstractProjectStructureAction.getSelectedAndroidModule)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 ToolWindow (com.intellij.openapi.wm.ToolWindow)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1