OpenChrom 1.0.0 “Aston” Preview

I proudly announce the preview release of OpenChrom 1.0.0 “Aston”.
Some new data converters and a lot of improvements have been added. Stay tuned.

https://www.openchrom.net/download
https://en.wikipedia.org/wiki/OpenChrom

OpenChrom 1.0.0 Preview

Posted in Uncategorized | Leave a comment

Eclipse Hackathon Hamburg – Greetings

Yesterday, we had our second Eclipse Hackathon in Hamburg, Germany. It was a great meeting :-).

Hackathon-2015-Q2

Stay tuned, the next Hackathon will be in approx. three month.

Posted in Uncategorized | 1 Comment

Setting profiles in the preferences dialog

I wondered if it’s possible to allow users to work with different profile settings. That would be beneficial, cause users then don’t have to remember different plug-in settings for various analytical scenarios. Eclipse offers to export/import *.epf files, hence there should be a way to automate this. Here’s the solution:

Profiles

The preference service allows to export the currently used preferences:

public static void exportProfile(File file, IPreferenceFilter[] preferenceFilters) throws FileNotFoundException, CoreException {

	FileOutputStream fileOutputStream = new FileOutputStream(file);
	IPreferencesService preferencesService = Platform.getPreferencesService();
	preferencesService.exportPreferences(preferencesService.getRootNode(), preferenceFilters, fileOutputStream);
}

Importing stored preferences works similarly:

public static IStatus importProfile(File file) throws FileNotFoundException, CoreException {

	FileInputStream fileInputStream = new FileInputStream(file);
	IPreferencesService preferencesService = Platform.getPreferencesService();
	return preferencesService.importPreferences(fileInputStream);
}

It depends on you where to store the preference profiles. There’s only a small drawback when loading a profile within the preferences dialog. All pages are displaying the old and not updated profile values. Hence, the dialog needs to be restarted. This can be automated too from within a page.

IPreferencePageContainer preferencePageContainer = getContainer();
if(preferencePageContainer instanceof PreferenceDialog) {
	PreferenceDialog preferenceDialog = (PreferenceDialog)preferencePageContainer;
	preferenceDialog.close();
	preferenceDialog = PreferencesUtil.createPreferenceDialogOn(null, null, null, null);
	preferenceDialog.open();
}

The more better it would be reload all page values without re-opening the preference dialog. But I didn’t find a way how to do it. Anyhow, it works so far.

Posted in Uncategorized | Leave a comment

Eclipse Hackathon Hamburg – 2015/04/24

Folks,

the next Eclipse Hackathon will be in Hamburg, Germany soon :-). Feel free to join:
https://wiki.eclipse.org/Hackathon_Hamburg_2015_Q2

Posted in Uncategorized | Leave a comment

It’s the table sorter stupid

Today, I just trapped into those pitfalls where thinking in terms of complexity fails. I got the following error message when sorting entries of a JFace TableViewer:

!MESSAGE Workaround for comparator violation:
    - set system property java.util.Arrays.useLegacyMergeSort=true
    - use a 1.6 JRE
message: Comparison method violates its general contract!

Here’s a part of the stack trace:

java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at java.util.TimSort.mergeLo(TimSort.java:747)
    at java.util.TimSort.mergeAt(TimSort.java:483)
    at java.util.TimSort.mergeCollapse(TimSort.java:408)
    at java.util.TimSort.sort(TimSort.java:214)
    at java.util.TimSort.sort(TimSort.java:173)
    at java.util.Arrays.sort(Arrays.java:659)
    at org.eclipse.jface.viewers.ViewerComparator.sort(ViewerComparator.java:189)

I thought that something with the TableViewer is wrong, … or with the data, … or with the label provider, … or with the content provider. Finally, I had a look at the sort algorithm:

int sortOrder = 0;
int size2 = result2.size();
int size1 = result1.size();
sortOrder = (size2 > size1) ? 1 : -1;

If size2 and size1 are the same it crashes, cause 0 shall be returned but in all cases -1 was returned. The following fix made it work.

int sortOrder = 0;
int size2 = result2.size();
int size1 = result1.size();
if(size2 != size1) {
	sortOrder = (size2 > size1) ? 1 : -1;
}

Stupid little mistake :-)!

Posted in Uncategorized | 2 Comments

Eclipse meets Europe

Eclipse-Europe
Foto (C) by Dany Gellert

But Hamburg got foggy again … :-(

Posted in Uncategorized | Leave a comment

Gimp 2.8 – Eclipse Splash

I was wondering why the splash screen is not visible anymore after using Gimp 2.8 to create the *.bmp file. It’s the color profile option that needs to be deactivated. Here’s the workflow:

Create a splash design with Inkscape:

Width: 455 px
Height: 295 px

Export the design to *.png format (90 dpi).

Splash Inkscape

Then open the *.png file with Gimp and export it to *.bmp format.

Splash Gimp

Use the options:

Compatitbility:
> Don’t write color information
24 Bit
> R8 G8 B8

That’s it :-).

Posted in Uncategorized | Leave a comment