Ubuntu 11.10 Eclipse Packages

December 13, 2011

It’s been a long since I didn’t post here. The main reason is that I didn’t have the opportunity to use Eclipse in the last month. Yes I have a new really cool “Job” called PhD: These times I am reading a lot.

Today I decided to fix that and to install an Eclipse SDK on my Ubuntu 11.10 laptop using apt configured on the default Ubuntu repositories. Here is the list of packages related to Eclipse:

As you can see (or not) there is no Eclipse standard SDK package, the one I was used to start with. There is an eclipse-pde package: it should be the same but unfortunately it doesn’t work as expected: no PDE perspective available.

I finally went to http://www.eclipse.org/downloads/  in order to find my favourite package.


Let’s move !

October 17, 2011

After 6 years working as Eclipse plug-ins developer I decided to take a new big challenge: start a PhD. I will still blog about Eclipse (but certainly less often) here because my PhD subject is about SOA and I’m sure that Eclipse is somewhere linked to it because Eclipse is everywhere, isn’t it ?

I would like also to take the opportunity of this post to THANK publicly Jerome  for his help during these 6 years: “thanks”.

Stay tuned for this new story


Object instances reuse and Eclipse API

October 3, 2011

Reading one of my colleague’s code I saw this:

GridLayout gl = new GridLayout();
gl .numColumns = 1;
gl .verticalSpacing = 0;
gl .marginHeight = 0;
gl .marginWidth = 0;

Composite c1 = new Composite(parent);
Composite c2 = new Composite(parent);
c1.setLayout(gl);
c2.setLayout(gl);

Personally I always create a new layout for each one of my GUI component. It is in my opinion more easy to read that the piece of code above and because there is a small number of such objects (having a UI with thousands of GUI component needing a layout is bad idea I think ;-) ), creating a new one for each component doesn’t impact performances.

To go further in the probleme, reading this code lead me to the following question:

How do I know if a given class instance can be “shared” in several contexts ?

In the particular case of the GridLayout above, I was not able to find the answer in the Javadoc here: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/layout/GridLayout.html. After looking at the source code of GridLayout it seems that there is no internal state saved anywhere, and thus it’s possible to use the same layout instance for several components.

May be I missed something or maybe it should be interesting to indicate this information in the Javadoc. For sure, I’ll take care of that when writing the documentation for my own libraries.


Increase memory of Eclipse Ant Runner

September 20, 2011

I am running the Eclipse ant runner from command line in the following way:

set LAUNCHER=xx\xx\org.eclipse.equinox.launcher_1.1.3.0.jar
xx\xx\java.exe -jar %LAUNCHER% -application org.eclipse.ant.core.antRunner -buildfile build.xml

I am facing OutOfMemory errors in the heap space. Adding -vmargs -Xmx512m to the command line or and changing the properties of my eclipse installation eclipse.ini file didn’t fixed the issue.

In order to be sure that the vmargs are taken into account I simply wrote the folowing task:

public class DisplayTask extends Task {
@Override
public void execute() throws BuildException {
System.out.println(Runtime.getRuntime().maxMemory() / 1000000);
}
}

and just launch it in my build.xml (using taskedf to define the task). The output is always 66 whatever I put in -vmargs -Xmx ….
After several tests I got the solution by adding -Xmx512m  only (without -vmargs) option just after the java.exe as folowing:

xx\xx\java.exe -Xmx512m -jar %LAUNCHER% -application org.eclipse.ant.core.antRunner -buildfile build.xml

Conclusion: the ant runner application doesn’t read neither the -vmargs command line options nor the eclipse.ini file options. Thus the only solution to increase memory for it is to directly pass the option to the Java virtual machine.


Sequential Jobs

September 8, 2011

Following this post about RCP application progress report  we have the following use case:

  1. User Action
  2. Start first Job (unknown length)
  3. Wait for first Job to finish and start second Job (known length)
  4. Wait for second Job to finish and start third Job (known length)

We want to show this to the user in the following way:

  1. Have a main “User Action” dialog without global progress bar (because of the 1st job length is unknown and really variable upon executions length I can’t get an accurate total length) or with an “unknown” length
  2. In this dialog have 3 sub parts one for each job with one progress bar for each one of this jobs and off course with IProgressMonitor.UNKNOWN style for the first job.
  3. In this dialog the progress bars will be updated sequentially as the underlying jobs.

This will allow the end user to immediately see that its action is divided into 3 sub-tasks (the sub-tasks are meaningful for end users) and each time a new sub-task is started he can see the length of this sub-task (unknown for the first).

After many searches we were not able to implement that using the Eclipse Job API,  and today we are reporting these 3 sub-tasks as 3 individual successive dialogs with the drawback that the end user may initially thinks that his action will be completed at the end of the first unknown sub-task.

How does the Eclipse workbench’s team and YOU handle such situations ?


Build command line tools on top of Eclipse

July 8, 2011

Eclipse is great! Isn’t it ?

Recently some of my RCP application customers asked me to have a command line version of the application. This application parses some binary trace files and provides analyses of it which results are displayed in several Eclipse views. The point here was to output “CSV versions” of this views through a command line tool.

Thanks to the modularity of Eclipse it was really easy to add in the following architecture:

a new Command Line tool plugin contributing a command line application through the org.eclipse.core.runtime.applications extension point.

Yes it is as simple as it looks like excepted may be the following tips to remember:

  1. Always remove useless dependencies in all your plugins
  2. Ensure that Activators of plugins not contributing to the workbench extends AbstractPlugin and not AbstractUIPlugin
  3. Always isolate UI code in a dedicated plugin, otherwise it’ll be a nightmare to have a command line tool.
  4. Keep in mind that almost everything can be done with Eclipse ;-)

Manu

 

 


Analogical Computer

April 4, 2011

Today looking at my desktop books I decided to build the first analogical embeded computer system of the world: from the hardware to the top level user interface software.

What do you think about it ?

20110404-113758.jpg


Follow

Get every new post delivered to your Inbox.