Skip to content

SimonScholz/eclipse4simon

Repository files navigation

Eclipse 4 additions and enhancements Build Status

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.

Obtain the libraries

Using the services

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.

UI Freeze Monitoring

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.

Using default Freeze Monitoring

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)
}
  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.

Using IEclipsePreferences for Freeze Monitoring

@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.

Using IPreferenceStore for Freeze Monitoring

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.

UI for setting the preferences

You can have your custom org.eclipse.jface.preference.PreferenceDialog in an Eclipse application and use an IPreferenceStore as described earlier.

Or you can for instance use the PreferenceWindow from Nebula.

Working with this code

These chapters are for developers, who are willing work with the code in this repository.

Building the projects

The projects can be build by using the maven wrapper.

./mvnw clean verify

Uploading the update site to Bintray

curl -T ./releng/update-site/target/updatesite.zip -u<user-id>:<api-token> -H "X-Bintray-Explode: 1" -H "X-Bintray-Package:eclipse4simon" -H "X-Bintray-Version:0.1.0" https://api.bintray.com/content/simon-scholz/eclipse-apps/eclipse4simon/0.1.0/

About

Useful additions or enhancements for Eclipse 4

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published