Eclipse4 and @PostConstruct and @PreDestroy not called (javax.annotation)

Posted on November 23, 2012 by Lars Vogel

We are getting some error reports that @PostConstruct and @PreDestroy methods in Eclipse 4 RCP applications are not called by the framework.

If you are building Eclipse 4 RCP applications you shoudl enter the javax.annotation package as package dependency instead of plug-in dependency, otherwise you plug-in will be using a different @PostConstruct than the framework and your methods may not be called.

Wim Jongman fixed already the e4 tools in Bug 394327 , so a new version of the tools will also generate a package dependency.

If you are wondering where you can find the latest version of the tools, just build the e4 tools locally. spacer

[EDIT - UPDATED entry to describe that import package is always required]

Posted in Eclipse | 2 Comments

vogella company profile

Posted on November 19, 2012 by Lars Vogel

I guess at some point it is good to note down what you think is important and what is not for you. Therefore we posted our company values. See vogella company profile.

We decided to follow a similar theme as the Manifesto for Agile Software Development.

Posted in vogella | 1 Comment

Eclipse 4.3 integration build is now 27 % faster than Eclipse 3.8 for the average user case

Posted on November 15, 2012 by Lars Vogel

I just downloaded the Eclipse 4.3 integration build and I’m stunned by its performance improvements. You find the currently download for the Eclipse 4.3M3 build under the following link: Eclipse downloads. I selected I20121113-0800.

I measured the performance improvements and here are the results visualized as a nice graphic.

spacer

I should probably add that I made the above numbers completely up. spacer

But the integration build feels much faster to me. I think the main change was done in Bug 391868. Also Mylyn seems to have solved there performance issues in Bug report in their latest build, so for me the Eclipse IDE is lightening fast again.

I suggest you download the latest build and test it. Please report additional performance problems in the platform via Eclipse platform bug, if possible with a pre-analysis of the performance problem.

Posted in Eclipse | 10 Comments

Migrating plug-ins from Eclipse 3.x to Eclipse 4 – getting ready for Eclipse 4

Posted on November 13, 2012 by Lars Vogel

To migrate your Views and Editors to Eclipse 4 you can choice to use org.eclipse.e4.tools.compat plug-in from the e4 tooling projects. This bridge was developed by Tom Schindl a while ago.

To use this bridge in Eclipse 4.2 or Eclipse 3.8 install the org.eclipse.e4.tools.e3x.bridge feature into your Eclipse IDE.

Afterwards add the following plug-ins to your MANIFEST.MF.

org.eclipse.e4.tools.compat;bundle-version=”0.12.0″,
org.eclipse.e4.core.contexts;bundle-version=”1.1.0″

You can now develop your Parts as Pojos:

package example.compat.parts;

import javax.annotation.PostConstruct;

import org.eclipse.e4.ui.di.Focus;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;

public class View {
	public static final String ID = "example.compat.view";

	private TableViewer viewer;

	@PostConstruct
	public void createPartControl(Composite parent) {
		viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
				| SWT.V_SCROLL);
		viewer.setContentProvider(ArrayContentProvider.getInstance());
		TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
		column.getColumn().setWidth(100);
		column.setLabelProvider(new ColumnLabelProvider(){
			@Override
			public String getText(Object element) {
				return element.toString();
			}
		});
		
		// Provide the input to the ContentProvider
		viewer.setInput(new String[] { "One", "Two", "Three" });
	}

	@Focus
	public void setFocus() {
		viewer.getControl().setFocus();
	}
}

You only have to wrap them into an instance of DIViewPart:

package example.compat;

import org.eclipse.e4.tools.compat.parts.DIViewPart;

import example.compat.parts.View;

public class ViewWrapper extends DIViewPart<View> {

	public ViewWrapper() {
		super(View.class);
	}

}

In your plugin.xml you use ViewWrapper to define your Views.

This way you can use the dependency injection already in your Eclipse 3.x plugin, have a better possibility to test your user interface components in plain JUnit test (they are just POJO) and get ready for for a full Eclipse 4 migration.

Posted in Eclipse | Tagged E4, Eclipse 4 | Leave a comment

How to define a Android Multiline EditText

Posted on November 7, 2012 by Lars Vogel

Defining an Android Mulitline EditText Field is done via the inputType=”textMultiline”. Unfortunately the text looks strangely aligned. To solve that also use the gravity=”left|top” attribute.

 <EditText
        android:id="@+id/editText1"
        android:layout_"match_parent"
        android:layout_"match_parent"
        android:ems="10"
        android:gravity="left|top"
        android:inputType="textMultiLine" >

        <requestFocus />
    </EditText>

With the gravity flag it looks like the following.

spacer

Without it, it looks like the following.

spacer

Posted in Android | Tagged Android | Leave a comment

Building the e4 tools locally with CBI

Posted on October 31, 2012 by Lars Vogel

In case you are building Eclipse4 RCP applications (which you should Eclipse 3.x RCP is just legacy these days), you may want to use the latest and greatest version of your e4 tooling.

I updated the description how to build the e4 tools locally you can find it here:

Local build of the e4 tools

You should really try this. The additional update of building the e4 tools locally, is that you can now fix issue here youself, test them locally and provide patches.

Posted in Eclipse | Tagged E4 | 2 Comments

My EclipseCon Europe talk

Posted on October 30, 2012 by Sopot Çela

This year was my first EclipseCon ever. I have to say that I really enjoyed it. I met a lot of virtual coworkers and also new and old committer friends.

I also gave a talk about Eclipse 4 Context Functions. I really enjoyed it. I saw a lot of interest although it was a deep technical topic around the Eclipse 4 Application Platform.

My slides are here although I decided to keep the talk short and give more spaces to the demos.

To demo and illustrate the topic I used Tom’s JavaFx renderers to build an e4 on JavaFX application with animations and cool stuff. You can find them in my GitHub repo here.

I look forward to be part of other EclipseCon-s as, in spite of being great technical conferences they are also the place where the Eclipse community brings out its spirit and passion at its best.

Posted in Sopot Çela thoughts about Eclipse | Leave a comment

Improved JDT Filtered PackageExplorer (for Eclipse 4.2.1)

Posted on October 29, 2012 by Lars Vogel

I updated my JDT Filtered Package Explorer. It should now also work with ‘Top Level Elements > Working Sets’ as top level and should also the native “Cancel” button of the platform.

spacer

Just for reference to use the native cancel you can implement your text fields with the following flags.


filtertext= new Text(newParent, SWT.SEARCH | SWT.ICON_CANCEL);
		filtertext.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true,
				false));

filtertext.addSelectionListener(new SelectionAdapter() {
	public void widgetDefaultSelected(SelectionEvent e) {
				filtertext.setText("");
				fProjectFilter.setSearchText(filtertext.getText());
				fViewer.refresh();
			}
		});

I basically re-wrote the whole code to use a ViewerFilter, so you may want to de-install the old one before installing the new one.

p2 Update Site:

www.vogella.com/updatesite/jdt

Posted in Eclipse | Tagged JDT | 9 Comments

Eclipse 4 and RAP – Continue the port

Posted on October 16, 2012 by Lars Vogel

Last week Ralf Sternberg, Markus Knauer and I spend a second day in porting RAP to Eclipse4. Our start was a bit slow as we redid the changes we did the last time because we wanted to fork the org.eclipse.platform.ui instead of copying it as we did the last time.

But we had a few hour to implement new stuff. I make toolbars and menus work and added a first version of multi-user support. We also used a patch from Tom Schindl for the EventAdmin service to limit events to the client session.

Overall we are very convinced that a port of RAP to Eclipse4 is possible. After approx. 1.5 days we have all the important bits in place and polishing the remainder seem definitely possible.
spacer

To test is you can clone the following repos:

https://github.com/eclipsesource/eclipse.platform.ui -> Contains small modifications to the platform to support RAP
https://github.com/eclipsesource/rap-e4 -> Example application

If you add EclipseCon Europe you should join Ralfs and my talk about the topic.

Posted in Eclipse | Leave a comment

Honored to be a Java Champion –

Posted on October 15, 2012 by Lars Vogel

I’m very honored to be now part of the Java Champions Group.

The website describes the group as following:

The Java Champions are an exclusive group of passionate Java technology and community leaders who are community-nominated and selected under a project sponsored by Oracle. Java Champions get the opportunity to provide feedback, ideas, and direction that will help Oracle grow the Java Platform. This interchange may be in the form of technical discussions and/or community-building activities with Oracle’s Java Development and Developer Program teams.

It is a honor to join this group of excellent people. Everyone in this group has archived great things for the Java community.

A special thanks goes to Eberhard Wolff and Markus Eisele for suggesting me for this group and preparing the suggestion material.

Posted in Android, Eclipse, Java, vogella | 8 Comments