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
- Host: GitHub
- URL: https://github.com/simonscholz/eclipse4simon
- Owner: SimonScholz
- License: epl-2.0
- Created: 2018-12-04T12:42:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-05T18:37:01.000Z (over 6 years ago)
- Last Synced: 2025-02-05T05:41:32.918Z (4 months ago)
- Topics: eclipse, eclipse-plugin, eclipse-rcp, eclipse4
- Language: Java
- Size: 219 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
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 valuesAlternatively 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/
----