Code Monkey home page Code Monkey logo

eclipse4simon's Introduction

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/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.