An open API service indexing awesome lists of open source software.

https://github.com/simonscholz/eclipse4simon

Useful additions or enhancements for Eclipse 4
https://github.com/simonscholz/eclipse4simon

eclipse eclipse-plugin eclipse-rcp eclipse4

Last synced: 2 months ago
JSON representation

Useful additions or enhancements for Eclipse 4

Awesome Lists containing this project

README

        

= Eclipse 4 additions and enhancements image:https://travis-ci.org/SimonScholz/eclipse4simon.svg?branch=master["Build Status", link="https://travis-ci.org/SimonScholz/eclipse4simon"]

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

A p2 update site can be found here: https://dl.bintray.com/simon-scholz/eclipse-apps/eclipse4simon/

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

[source,java]
----
@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

[source, java]
----
@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.

[source, console]
----
./mvnw clean verify
----

=== Uploading the update site to Bintray

[source, curl]
----
curl -T ./releng/update-site/target/updatesite.zip -u: -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/
----