The purpose of this repository is to provide additions and enhancements for Eclipse 4, especially for features, which were available in Eclipse 3 and not in Eclipse 4.
A p2 update site can be found here: https://dl.bintray.com/simon-scholz/eclipse-apps/eclipse4simon/
The interfaces for the services are defined in the com.simonscholz.e4.services bundle, so in case you want to use a certain service the com.simonscholz.e4.services bundle has to be added as dependency.
To make use of the freeze monitoring the com.simonscholz.e4.services and com.simonscholz.e4.monitoring has to be added to the runtime.
Caution
|
The FreezeMonitorService has 3 methods, but only one should be invoked depending on your needs.
|
Eclipse 4 applications can obtain an instance of a FreezeMonitorService
by simply injecting it into the lifecycle class or an addon.
@PostContextCreate
void postContextCreate(Display display, FreezeMonitorService freezeMonitorService) {
freezeMonitorService.createAndStartMonitorThread(display); (1)
}
-
This will simply start the Freeze Monitoring with default values
Alternatively the FreezeMonitorService
can also be obtained by using a BundleContext
, e.g., in a bundle activator.
Warning
|
Bundle activators can cause performance issues therefore it is better to use other approaches. |
@PostContextCreate
void postContextCreate(IEclipseContext workbenchContext, Display display, FreezeMonitorService freezeMonitorService, @Preference IEclipsePreferences prefs) {
freezeMonitorService.setPreferencesAndStartIfNecessary(prefs, display); (1)
}
This registers a listener, which will start the freeze monitoring once the com.simonscholz.services.monitoring.PreferenceConstants.MONITORING_ENABLED
value is set to true
.
Tip
|
See other values in com.simonscholz.services.monitoring.PreferenceConstants .
|
In case you’re still using the IPreferenceStore
the FreezeMonitorService
also provides a setPreferencesAndStartIfNecessary
,
which accepts an IPreferenceStore
.
Everything else is similar to the approach with the IEclipsePreferences
.
These chapters are for developers, who are willing work with the code in this repository.