October 23, 2009
I spent lot of time today to find how to zip an eclipse directory with ANT WHILE KEEPING the root directory in the archive, thus when unziping, clients get only one directory called eclipse containing all eclipse’s stuff.
Here’s my directories structure:
Here is the ant code to zip the eclipse directory into a zip called eclipse.zip containing the eclipse directory as root:
<zip destfile="eclipse.zip">
<zipfileset dir="buildfolder">
<include name="eclipse/**/**" />
</zipfileset>
</zip>
Leave a Comment » |
Eclipse Misc |
Permalink
Posted by Manuel
October 15, 2009
Hi there,
After pressing accidentally several keys on my keyboard I lost the Auto Completion in my PDE environment !!!
I already had the same problem long time ago but I wasn’t able to remember how I solved it. In order to solve it quickly next time and of course for others encountering it here is the solution:
Window -> Preferences -> Java -> Editor ->Content Assist Advanced -> Restore Defaults in order to have Java Proposals checked.
On a side note, I am curious to understand how I disabled this feature with my keyboard ….
Leave a Comment » |
Eclipse Misc |
Permalink
Posted by Manuel
July 10, 2009
Hi all,
Before leaving in a 4 days week end (July 14th is Bastille Day ;o)) I would like to like to get your inputs regarding -Xms Sun JVM’s option.
This week I tried to find the best way to manage memory usage of our Eclipse’s based product. This work led me to ask my self How should I manage OutOfMemoryErrors and also bring me to -Xmx and to the mysterious (to my blinded eyes) -Xms option.
In our product we are setting -Xmx to 512m. All is clear and works perfectly with this option.
Regarding -Xms things are more complicate (once again, to my blinded eyes).
Sun “Tuning Garbage Collection” document says: “If the value of -Xms is smaller than the value of the -Xmx parameter, not all of the space that is reserved is immediately committed to the virtual machine”
I am wondering :
- What “is immediately committed” exactly means ? Does it concern other running applications to the system ?
- What’s the best value for -Xms is order to increase product performances and in order to not decrease other system applications performances ?
- Is there any drawback to set this -Xms option to the same value than -Xmx ?? I am not a system expert at all, but it seems that setting this -Xms option to an high value doesn’t affect other running applications …
- Is there any Virtual memory management relationship there ?
I would appreciate any Java expert comment on that topic in order to have a clear view of what this -Xms option really do and to use it.
Thanks in advance and have a nice week end.
Manu
3 Comments |
Java | Tagged: Java |
Permalink
Posted by Manuel
July 6, 2009
Sometimes, depending on a lot of circumstances, Eclipse user can face the famous OutOfMemoryError. Unfortunately our users sometime face this error.
Eclipse default handling for such errors prompts the user as following:

Out Of Memory handling
I am asking myself: is there any more useful information we can provide to the end user in order to prevent such errors to occur again ???
May be I can parse the Error message to check if it’s a heap or permanent generation out of memory ? Thus I will be able to tell the user: add the following option when launching the product.
It also appears that sometimes this dialog is not opened, and the error is only logged in the .log file. Does it depends on the thread throwing the error …
Do you handle these errors differently than Eclipse in you custom products ? If yes, how ?
I would be interested in any comments suggestions on that topic.
Manu
9 Comments |
Eclipse Misc | Tagged: eclipse, OutOfMemoryError |
Permalink
Posted by Manuel
June 23, 2009
For interested people I opened an enhancement request in bugzilla regarding “Labels on Polylines” in Draw2d.
As mentioned in the bugzilla entry the patch provided is a FIRST ugly patch and should be really improved. Any help, comments, enhancements are welcome ;o)
The next post regarding Draw2d Enhancements will concern a Graphics class able to scale according to x OR y independently.
Manu
Leave a Comment » |
Eclipse Misc | Tagged: Draw2d |
Permalink
Posted by Manuel
June 12, 2009
I recently discovered http://stackoverflow.com/ a very cool and dynamic “programming Q & A site that’s free”. This site is note specific to a given programming language and guess what …. ???? There is an eclipse section here.
I know the Eclipse foundation provides dynamic newsgroups, but for users as me behind enterprise firewalls who can access newsgroups only through the basic user interface I think it would be nice to see this Eclipse’s section more and more active.
Hope to see you on stackoverflow to give our Eclipse’s community more pertinent questions and answers.
Manu
5 Comments |
Eclipse Misc |
Permalink
Posted by Manuel
May 6, 2009
Long time ago I blogged about Draw2d here. In fact I have been working with Draw2d, without GEF, during the last 2 years.
I’ll try through several posts to show the “missing features required for my needs” I implemented from my side. “Missing” is quoted because it was until today, ALWAYS possible to implement these features thanks to Draw2d flexibility ;o)
The first one I want to share is “Label Decoration For Polylines“. Because A picture is worth a thousand words here it is:

May be this feature can be interesting for some of you and thus can be contributed ? May be it’s already existing somewhere and I missed it ?
Next post will show XYScaledGraphics able to scale X axis independtly from Y axis and vice versa.
Manu
3 Comments |
Eclipse Misc |
Permalink
Posted by Manuel
April 29, 2009
Several weeks ago I blogged a lot about headless build and mainly about the problems I encountered to set up this build. I must admit that it was difficult and long to have the final build working properly but I also MUST admit than the benefits are now really appreciable.
These benefits are mainly :
- Each time we have to release our features I feel confident. First, I am confident about the content of the packages thanks to automation. Then I am also confident about the compiled code build in the packages thanks to the integration of our J-Unit tests in the build.
- The workload to perform the release thanks to the headless build can be summed-up by: ./manu-linux-build.sh build.all. In other words, it’s FREE. Who wants a release ?? You or you ? You ? No problem I can do that in one click !! You need an engineering release ? Ok here it is !!!
If your are not already building your Eclipse’s product automatically I strongly encourage you to get started with headless build.
Manu
3 Comments |
Eclipse Tools |
Permalink
Posted by Manuel
April 9, 2009
Today I refactored one long action of our product in order to use jobs.
In one of our custom views the end user can click on an “Open Statistics Views” action. This action asks to a Statistics module to compute some stats. These statistics are computed from a local database and the computation can take several seconds (up to ~30s). Before today all the action was performed directly in the UI thread. I am already earing most of you saying: “What ??!!! You are freezing the UI for 30 seconds ??? Yes I am (shame on me), and yes I know it’s bad and that’s why I decided to change that.
The first thing I looked to fix this issue was Eclipse’s Jobs. The API is straightforward and quite easy to learn. Quickly I had my call to statistic module performing stats computation running in a Job using an IProgressMonitor of type UNKNOWN.
Here is the code
StatJob statJob = new StatJob("Computing Statistics");
statJob.setUser(false);
statJob.addJobChangeListener(new JobChangeAdapter() {
public void done(final IJobChangeEvent event) {
if (event.getResult().isOK()) {
// UI update using job run method result
PlatformUI.getWorkbench().getDisplay().syncExec(
new Runnable() {
public void run() {
StatJob statJob = (StatJob) event.getJob();
setInput(statJob.sessionStat);
}
});
}
}
});
statJob.schedule();
Notice the use of an IJobChangeListener in order to update the view when the Job’s work will be done.
This solution is better than performing stats computation in the UI thread but there is still an “issue”: what about progress feedback to the user ??. The UNKNOWN type only says to the user: “Something is happening, I am working but I can’t tell you when I’ll finish”
Since the stats are performed using mainly 2 SQL requests through JDBC I can only divide my Job in 2 amount of work . Moreover one of this two SQL request is longer than the other so dividing 30 seconds of work into 2 seconds and 28 seconds will not help the user.
After browsing the JDBC Api and mainly the Statement’s one “I discovered” the cancel() method documented as following: “Cancels this Statement object if both the DBMS and driver support aborting an SQL statement. This method can be used by one thread to cancel a statement that is being executed by another thread.“
First attempts using this methods didn’t succeeded and resulted in SQLException. I’ll investigate more on the subject (for info we are using an SQLite database with Zentus JDBC driver) but I would be interested about the way you provide progress feedback to the user when accessing database ?
Manu
3 Comments |
Eclipse Technical Tips |
Permalink
Posted by Manuel
April 1, 2009
Several times ago one of our user asked for us to add keyboard shortcuts for our plugins actions. Our answer was: Easy !!!
Quickly, using Eclipse command “framework” (bindings extension point) this feature was implemented.
Now ……………………………. the problems we encountered since there
- Due to our plugins name our keyboard shortcuts appeared at the top position in the in the “help” providing list of available plug-ins. This can be a “problem” for users which doesn’t use a lot our plug-ins
- More tricky, some of our shortcuts were hiding Eclipse’s default shortcuts !!!!!
After quick investigations it seems only really important actions are binded by default with keyboard. Other actions CAN be binded by the user later through the Eclipse preferences pages. We should decide if we change our shortcuts in order to not interfer with others or to simply remove them …
I would be interested to know the way you manage your keyboard shortcuts,and to have any links pointing to that topic (I didn’t find anything after quick googling) ??
I know that there is an associated “rule” in the “Building Quality Plug-ins” book but I don’t have the book here at home and I can’t rember the exact rule saying: “your plug-ins should only provide “additional / optional” features “
Manu
Leave a Comment » |
Eclipse Misc |
Permalink
Posted by Manuel