-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically open the talkthrough after installation
- Loading branch information
1 parent
61ccce4
commit 062931f
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/main/java/org/sonarlint/intellij/OpenWelcomePageOnceOneProjectOpened.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.sonarlint.intellij; | ||
|
||
import com.intellij.ide.util.PropertiesComponent; | ||
import com.intellij.openapi.application.ApplicationManager; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.startup.StartupActivity; | ||
import com.intellij.openapi.wm.ToolWindowManager; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class OpenWelcomePageOnceOneProjectOpened implements StartupActivity { | ||
|
||
@Override | ||
public void runActivity(@NotNull Project project) { | ||
if (ApplicationManager.getApplication().isUnitTestMode()) { | ||
return; | ||
} | ||
|
||
var properties = PropertiesComponent.getInstance(); | ||
var hasWalkthroughRunOnce = "hasWalkthroughRunOnce"; | ||
|
||
if (!properties.getBoolean(hasWalkthroughRunOnce, false)) { | ||
properties.setValue(hasWalkthroughRunOnce, true); | ||
openWelcomePage(project); | ||
} | ||
} | ||
|
||
private static void openWelcomePage(Project project) { | ||
var toolWindow = ToolWindowManager.getInstance(project).getToolWindow("Welcome to SonarQube for IDE"); | ||
|
||
if (toolWindow == null) { | ||
return; | ||
} | ||
|
||
toolWindow.show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters