99
1010import com .intellij .codeInsight .daemon .DaemonCodeAnalyzer ;
1111import com .intellij .ide .util .PropertiesComponent ;
12- import com .intellij .notification .Notification ;
13- import com .intellij .notification .NotificationListener ;
14- import com .intellij .notification .NotificationType ;
15- import com .intellij .notification .Notifications ;
12+ import com .intellij .notification .*;
1613import com .intellij .openapi .actionSystem .ActionManager ;
1714import com .intellij .openapi .actionSystem .ActionPopupMenu ;
1815import com .intellij .openapi .application .ApplicationManager ;
@@ -74,6 +71,9 @@ public class MethodListTree extends Tree {
7471 private ResourceBundle resource ;
7572 public static boolean TREE_EXPANDED ;
7673
74+ private static final NotificationGroup TOOL_GROUP = new NotificationGroup (Constants .PLUGIN_GROUP_DISPLAY_ID ,
75+ NotificationDisplayType .TOOL_WINDOW , true );;
76+
7777 /**
7878 * Initialises method list tree
7979 *
@@ -297,7 +297,6 @@ public void addNewExistingMethod(MethodWrapper newMethod) {
297297
298298 break ;
299299 case JSONFileLoader .NEW_METHOD :
300-
301300 addNode (newMethod );
302301 break ;
303302 }
@@ -378,10 +377,9 @@ public void launchSwan(HashMap<String, String> values) {
378377 public void launchSwan (HashMap <String , String > values ) {
379378
380379 JSONFileLoader .setReloading (false );
381- NotificationType notificationType = NotificationType .INFORMATION ;
382380
383- String message = "<html>"
384- + values . get ( Constants . ANALYSIS_RESULT );
381+ Notification analysisCompleted = TOOL_GROUP . createNotification ( "" , "SRM List updated" , NotificationType . INFORMATION );
382+ Notifications . Bus . notify ( analysisCompleted , project );
385383
386384 ConfigurationFileNotifier fileNotifier = bus .syncPublisher (ConfigurationFileNotifier .FILE_NOTIFIER_TOPIC );
387385 fileNotifier .loadUpdatedFile (values .get (Constants .OUTPUT_FILE ));
@@ -569,7 +567,7 @@ private void loadMethods() {
569567
570568 DefaultMutableTreeNode classNode = new DefaultMutableTreeNode (new Pair <>(classname , methodCount ));
571569
572- ArrayList <MethodWrapper > sortedList = methods .get (classname );
570+ ArrayList <MethodWrapper > sortedList = methods .get (classname );
573571 Collections .sort (sortedList );
574572 for (MethodWrapper method : sortedList ) {
575573
@@ -581,7 +579,7 @@ private void loadMethods() {
581579 String pattern = "###,###" ;
582580 DecimalFormat decimalFormat = new DecimalFormat (pattern );
583581
584- root .setUserObject ("<html><b>SRMs</b> <font color='gray'>(" + decimalFormat .format (totalMethods ) + " in " + decimalFormat .format (methods .size ())+ " classes)</font></html>" );
582+ root .setUserObject ("<html><b>SRMs</b> <font color='gray'>(" + decimalFormat .format (totalMethods ) + " in " + decimalFormat .format (methods .size ()) + " classes)</font></html>" );
585583
586584 treeModel .setRoot (root );
587585 TREE_EXPANDED = false ;
0 commit comments