1
1
/******************************************************************************
2
- * Copyright (c) 2006-2021 The IndentGuide Authors.
2
+ * Copyright (c) 2006-2023 The IndentGuide Authors.
3
3
* All rights reserved.
4
4
*
5
5
* This program and the accompanying materials are made available under the
@@ -39,7 +39,7 @@ public class Activator extends AbstractUIPlugin {
39
39
private static Activator plugin ;
40
40
41
41
private final IEclipsePreferences [] scopes = new IEclipsePreferences [2 ];
42
- private final EventHandler themeEventHandler = event -> {
42
+ private final EventHandler themeChange = event -> {
43
43
disposeLineColor ();
44
44
log ("Theme change '%s'" , event );
45
45
};
@@ -51,22 +51,22 @@ public Activator() {
51
51
}
52
52
53
53
/** Returns the shared instance */
54
- public static Activator getDefault () {
55
- return plugin ;
56
- }
54
+ public static Activator getDefault () { return plugin ; }
57
55
58
56
@ Override
59
57
public void start (BundleContext context ) throws Exception {
60
58
super .start (context );
61
59
plugin = this ;
62
60
61
+ log ("Indent guide: startup" );
62
+
63
63
scopes [0 ] = InstanceScope .INSTANCE .getNode (EditorsID );
64
64
scopes [1 ] = DefaultScope .INSTANCE .getNode (EditorsID );
65
65
66
66
IWorkbench wb = PlatformUI .getWorkbench ();
67
67
IEventBroker broker = wb .getService (IEventBroker .class );
68
68
if (broker != null ) {
69
- broker .subscribe (IThemeEngine .Events .THEME_CHANGED , themeEventHandler );
69
+ broker .subscribe (IThemeEngine .Events .THEME_CHANGED , themeChange );
70
70
}
71
71
}
72
72
@@ -75,12 +75,11 @@ public void stop(BundleContext context) throws Exception {
75
75
IWorkbench wb = PlatformUI .getWorkbench ();
76
76
IEventBroker broker = wb .getService (IEventBroker .class );
77
77
if (broker != null ) {
78
- broker .unsubscribe (themeEventHandler );
78
+ broker .unsubscribe (themeChange );
79
79
}
80
80
81
81
disposeLineColor ();
82
82
scopes [0 ] = scopes [1 ] = null ;
83
-
84
83
plugin = null ;
85
84
super .stop (context );
86
85
}
@@ -99,9 +98,8 @@ public Color getColor() {
99
98
}
100
99
101
100
/**
102
- * Returns {@code true} if the current theme is 'dark', defined as where the
103
- * foreground color is relatively darker than the background color. (black ->
104
- * '0'; white -> '255*3')
101
+ * Returns {@code true} if the current theme is 'dark', defined as where the foreground color is
102
+ * relatively darker than the background color. (black -> '0'; white -> '255*3')
105
103
*/
106
104
public boolean isDarkTheme () {
107
105
RGB fg = getRawRGB (AbstractTextEditor .PREFERENCE_COLOR_FOREGROUND );
0 commit comments