File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
src/main/java/com/shuzijun/leetcode/plugin/timer Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 1
1
package com .shuzijun .leetcode .plugin .timer ;
2
2
3
3
import com .intellij .openapi .project .Project ;
4
- import com .intellij .openapi .util .Disposer ;
5
4
import com .intellij .openapi .wm .StatusBar ;
6
5
import com .intellij .openapi .wm .StatusBarWidget ;
7
6
import com .intellij .openapi .wm .StatusBarWidgetFactory ;
16
15
*/
17
16
public class TimerStatusBarWidgetProvider implements StatusBarWidgetFactory {
18
17
19
- private TimerBarWidget timerBarWidget ;
20
18
21
19
@ Override
22
20
public @ NonNls @ NotNull String getId () {
@@ -35,21 +33,15 @@ public boolean isAvailable(@NotNull Project project) {
35
33
36
34
@ Override
37
35
public @ NotNull StatusBarWidget createWidget (@ NotNull Project project ) {
38
- if (timerBarWidget == null ) {
39
- timerBarWidget = new TimerBarWidget (project );
40
- }
41
- return timerBarWidget ;
36
+ return new TimerBarWidget (project );
42
37
}
43
38
44
39
@ Override
45
40
public void disposeWidget (@ NotNull StatusBarWidget widget ) {
46
- if (timerBarWidget != null ) {
47
- Disposer .dispose (timerBarWidget );
48
- }
49
41
}
50
42
51
43
@ Override
52
44
public boolean canBeEnabledOn (@ NotNull StatusBar statusBar ) {
53
- return false ;
45
+ return true ;
54
46
}
55
47
}
You can’t perform that action at this time.
0 commit comments