88import com .intellij .openapi .extensions .ExtensionPointName ;
99import com .intellij .openapi .project .Project ;
1010import com .intellij .openapi .vfs .VfsUtil ;
11- import com .intellij .openapi .wm .StatusBar ;
12- import com .intellij .openapi .wm .WindowManager ;
1311import com .intellij .psi .PsiElement ;
1412import fr .adrienbrault .idea .symfony2plugin .dic .ContainerFile ;
1513import fr .adrienbrault .idea .symfony2plugin .dic .container .util .ServiceContainerUtil ;
1614import fr .adrienbrault .idea .symfony2plugin .extension .PluginConfigurationExtension ;
1715import fr .adrienbrault .idea .symfony2plugin .extension .ServiceContainerLoader ;
1816import fr .adrienbrault .idea .symfony2plugin .extension .ServiceContainerLoaderParameter ;
19- import fr .adrienbrault .idea .symfony2plugin .profiler .widget .SymfonyProfilerWidget ;
2017import fr .adrienbrault .idea .symfony2plugin .routing .RouteHelper ;
2118import fr .adrienbrault .idea .symfony2plugin .util .IdeHelper ;
2219import fr .adrienbrault .idea .symfony2plugin .util .ProjectUtil ;
@@ -38,50 +35,22 @@ public class Symfony2ProjectComponent implements ProjectComponent {
3835 private static final ExtensionPointName <ServiceContainerLoader > SERVICE_CONTAINER_POINT_NAME = new ExtensionPointName <>("fr.adrienbrault.idea.symfony2plugin.extension.ServiceContainerLoader" );
3936 public static final ExtensionPointName <PluginConfigurationExtension > PLUGIN_CONFIGURATION_EXTENSION = new ExtensionPointName <>("fr.adrienbrault.idea.symfony2plugin.extension.PluginConfigurationExtension" );
4037
41- private Project project ;
38+ private final Project project ;
4239
4340 public Symfony2ProjectComponent (Project project ) {
4441 this .project = project ;
4542 }
4643
47- public void initComponent () {
48- //System.out.println("initComponent");
49- }
50-
51- public void disposeComponent () {
52- //System.out.println("disposeComponent");
53- }
54-
5544 @ NotNull
5645 public String getComponentName () {
5746 return "Symfony2ProjectComponent" ;
5847 }
5948
60-
61-
6249 public void projectOpened () {
6350 this .checkProject ();
64-
65- // attach toolbar popup (right bottom)
66- StatusBar statusBar = WindowManager .getInstance ().getStatusBar (this .project );
67- if (statusBar == null ) {
68- return ;
69- }
70-
71- // clean bar on project open; we can have multiple projects att some time
72- if (statusBar .getWidget (SymfonyProfilerWidget .ID ) != null ) {
73- statusBar .removeWidget (SymfonyProfilerWidget .ID );
74- }
75-
76- if (isEnabled ()) {
77- SymfonyProfilerWidget symfonyProfilerWidget = new SymfonyProfilerWidget (this .project );
78- statusBar .addWidget (symfonyProfilerWidget );
79- }
80-
8151 }
8252
8353 public void projectClosed () {
84-
8554 ServiceXmlParserFactory .cleanInstance (project );
8655
8756 // clean routing
@@ -99,7 +68,7 @@ public void showInfoNotification(String content) {
9968 Notifications .Bus .notify (errorNotification , this .project );
10069 }
10170
102- public boolean isEnabled () {
71+ private boolean isEnabled () {
10372 return Settings .getInstance (project ).pluginEnabled ;
10473 }
10574
0 commit comments