4
4
import com .intellij .openapi .project .DumbAware ;
5
5
import com .intellij .openapi .project .Project ;
6
6
import com .intellij .openapi .startup .StartupActivity ;
7
+ import com .neueda .jetbrains .plugin .graphdb .jetbrains .component .analytics .Analytics ;
7
8
import com .neueda .jetbrains .plugin .graphdb .jetbrains .component .settings .SettingsComponent ;
8
9
import com .neueda .jetbrains .plugin .graphdb .jetbrains .util .PluginUtil ;
9
10
import com .neueda .jetbrains .plugin .graphdb .platform .GraphBundle ;
10
11
import com .neueda .jetbrains .plugin .graphdb .platform .GraphConstants ;
11
12
import org .jetbrains .annotations .NotNull ;
12
13
14
+ import javax .swing .event .HyperlinkEvent ;
15
+
13
16
public class PluginUpdateActivity implements StartupActivity , DumbAware {
14
17
15
18
private static final String NOTIFICATION_ID = "GraphDatabaseSupportUpdateNotification" ;
@@ -36,9 +39,22 @@ private void showNotification(Project project, String currentVersion) {
36
39
GraphBundle .message ("updater.title" , currentVersion ),
37
40
GraphBundle .message ("updater.notification" ),
38
41
NotificationType .INFORMATION ,
39
- new NotificationListener . UrlOpeningListener (false )
42
+ new UrlOpeningListenerWithAnalytics (false )
40
43
);
41
44
Notifications .Bus .notify (notification , project );
42
45
}
43
46
47
+ static class UrlOpeningListenerWithAnalytics extends NotificationListener .UrlOpeningListener {
48
+
49
+ UrlOpeningListenerWithAnalytics (boolean expireNotification ) {
50
+ super (expireNotification );
51
+ }
52
+
53
+ @ Override
54
+ protected void hyperlinkActivated (@ NotNull Notification notification , @ NotNull HyperlinkEvent event ) {
55
+ Analytics .event ("landingPage" , "landFromNotification" );
56
+ super .hyperlinkActivated (notification , event );
57
+ }
58
+ }
59
+
44
60
}
0 commit comments