Blog

Debug/Run configurations

I just ran into a problem where the old emfstore browser plugin showed during debug although I did not have that in my workspace (org.unicase.esbrowser). The esbrowser views have been moved to workspace.ui recently. The problem was that I had previously installed a release version of unicase that still contained the plugin (0.3.18.internal). Since Eclipse never deletes previously installed plugins it got loaded in every debug session because it was no longer was masked by a .qualifier plugin in my workspace. To fix this problem you can change your debug configuration. Goto the "Plug-ins" tab, change the drop-down "Launch with" to "plugins selected below only" and deselect all previous plugin versions of unicase there, all with .internal, in particular "esbrowser 0.3.18.internal" in my case. That fixed the problem.


0 comments

Huh?

0 comments

Extension points

I guess it was high time that I take a closer look at the extension point declaration in Eclipse...
As you might expect this post would be another h8er-entry, so if you're not in the mood, just skip it ;)

First thing's first - there is no useful single page offered by Eclipse on how to declare an ext. point, what all its attributes and options mean etc - but I guess I should get used to that.
Let's say you've looked somewhere, found some proper examples and created your ext. point. Eclipse kindly offers to take you to the ext. point schema. Of course this doesn't mean that you'll get directly there :) You're presented to an overview page, which includes all the unnecessary (by this moment) information - description, API, examples, copyright... How do you expect to write the API or examples when you haven't defined the schema yet ?! You have to get the idea of looking for the other two pages for this editor (someone said some time ago, that these pages should be more prominent - he was right!).
Ok, you're finally in the correct place - defining you schema. Somehow there is an element that is already there - "extension". And you ask - why do we need an extenstion element in the ext. point itself - can't really tell, but deleting it was a biiig mistake :) It then gets a bit clearer until the point when you try to reorder some attributes and you can't do it - luckily, they've put the good old xml editor to do it manually. I made the mistake of renaming my schema file, so half of the buttons in the plugin.xml stopped working until reopening the plugin editor and eventually the whole project....
And now we come to the good part - you've defined your ext. point and want to use it. You were extra diligent and wrote a short description for every element and its attributes. Then you go to the Extensions page and try to read these descriptions... You expect to have them on the side - mm, no.... may be as a tooltip on the attribute name - nno ... may be on the input field .... no.
You can go to the extension point group (the node in the tree view that noone actually uses) and you can click on a link to show a specific page for the whole extension point. OR you can open your favourite browser and google for some examples. I really wonder if Eclipse would still be so popular if Google wasn't there to help out every 10 minutes..

0 comments

Software Metrics

We are growing:


unicase lines of code

0 comments

No comment

0 comments

Eclipse Galileo

Ready or not, here we come back from EclipseCon!!
The first gift we bring you is a configured Version of Eclipse Galileo (Everythink pre installed)
Have fun!!


http://www1.in.tum.de/static/shared/unicase/Eclipse/eclipseGalileo.zip





0 comments

Are you freaking kiddin' me?!

As most of you have probably noticed, we had a problem with the name of the opened element not showing in the title bar of the Eclipse workbench window. The most curious thing was, however, that this should be automatically set when the editor input is properly initiated - in other words: the standard title for Eclipse is <perspective> - <element name> - <Eclipse product>. For some particular reason, this did not happen with the MEEditor...

After looking for a decent solution (just for about a week or so...), including writing to the PDE newsgroup and not receiving any answer, I noticed something worth checking - the Dashboard (also an Editor) does set the correct title, in spite of being derived from the MEEditor itself. So I, having written both editors, am asking myself - how the *bleem* does this happen?!
After a couple of minutes looking at the call hierarchy of the getName() method, something strange occured to me - the one and only difference in both editors was that MEEditor uses "" as its tooltip, whereas the Dashboard uses its name.
Replacing the standard stub in MEEditorInput solved the problem, but raised another question - SINCE WHEN DOES TOOLTIP MEAN TITLE BAR ?!?!?!

1 comment

RCP Runtime font size

If you have started our client as a runtime RCP application (OS X users only), you have probably noticed that the fonts are a bit larger than your other Eclipse instance. I tried to set the font size manually , but it seemed that this exact option isn't available in the settings. A quick googling about it showed a useful hint:

Just set this VM argument in your build configuration: -Dorg.eclipse.swt.internal.carbon.smallFonts

Enjoy!

0 comments

Maclipse

Since we are developing primarily on Macs, I thought this might be interesting for some of you. I came across some odd attempts to optimize/adapt Eclipse as a Mac application:

The first one being Maclipse which tries to bundle Eclipse as a single .app
(including plugins, features, etc.). The project seems a bit old and there is a bug report suggesting this Mac philosophy won't be accepted officially by Eclipse (https://bugs.eclipse.org/bugs/show_bug.cgi?id=57349).

The next one is also called Maclipse (http://mschrag.blogspot.com/2008/06/maclipse.html), although I don't think it has anything to do with the previous one. It is actually an upgrade of the standard SWT and some workbench parts of Eclipse that make it look a lot like the Carbon look and feel. Once again there are no official news on the topic, but as far as I'm concerned, it shouldn't be that difficult to include some optional widget properties for the Mac edition of SWT ...... I mean ... swing does it :P

0 comments

EclipseCon 2009


Yeah! Our proposal for a presentation on the EMFStore was accepted for the EclipseCon 2009 in San Francisco. See here for the announcement: https://www.eclipsecon.org/submissions/2009/view_talk.php?id=625
If you´re going to San Fran-cisco...




Picture 1.png

0 comments

Action Items in the code: TaskTags

To add ActionItems to the code we use to use TaskTags. A TaskTag is a magic comment, preconfigured are "TODO", "FIXME" and "XXX". You can define your own task tags in the Preferences, Java -> Compiler -> TaskTags (see screenshot below). Unfortunatelly the tags can not be exported to my knowledge. You should add at least a TaskTag for your initials, in my case MK and set its priority to high. To see the tasks open the task view (Windows -> Show View -> Tasks).





0 comments

Final warning: no more warnings

Almost done with the warnings:
workspace: 0
emfstore: 2
model: 54
ui except meeditor: 30
meeditor: 757 (<- this is mostly because of the strange rich text library)


1 comment

Wiki code formating

Finally I found out how to format code with this wiki; there´s two ways, personally I prefer the first one:

1. Write "begin end" into a line, format the line as monospace (see screenshot below) and then paste your code inbetween "begin" and "end". You can then safely remove begin and end. Still it is sometimes better to replace the tabs with whitespace beforehand since the Wiki wastes quite some space for a single tab.






2. Open the page in question for editing, select "Edit HTML" and add the following to the code to html:
<pre> your source code here </pre>

Remove all tabs from the code and replace them by spaces (use TextEdit, Search&Replace). Note: After adding the above mentioned tags to html, you can also edit the code in the normal wiki edit mode.


Picture 3.png


0 comments

Wiki code formating

To format code in the wiki I found out about two ways. Personally I prefer the second:

1:
Open the page in question for editing, select "Edit HTML" and add the following to the code to html:

<pre> your source code here </pre>

Remove all tabs from the code and replace them by spaces (use TextEdit, Search&Replace).
Note: After adding the above mentioned tags to html, you can also edit the code in the normal wiki edit mode.

2:
Write "start end" in a line, format the line as monospace (click on the paragraph symbol). Then paste your source code in between start and end. You can then safely remove start and end, voila!
Note: In some situations it still makes sense to replace the tabs by spaces since the tabs take too much space in the wiki.



0 comments

JavaDoc Templates

In the Eclipse Preferences in Java -> Code Style -> Code Templates you can change the default code templates that are used by content assist. Of special interest to me are the settings in Comments since they are used whenever you ask for JavaDoc content assist. The default for Overriding Methods is not very useful in our context, so I recommend changing it from a normal comment to a java doc comment and add the @inherit-doc tag (see screenshot below). I also attached the exported setting, so you can just import it using the import button in the same dialog.



Picture 2.png



Download file "overriding.xml"

0 comments

unicase.org went public

The unicase.org domain went public today. Our Wiki, Blog and MailinglistArchive is now available also for non-authenticated users. I reornganized the index page a bit and added a section on what unicase is and who we are...



0 comments

Warnings, warnings, warnings...

In the Coding Guidelines we specified how we setup our workspace in terms of Eclipse warnings and checkstyle configuration. Code following the Coding Guidelines must not show any warnings with these settings. Since we are currently in a consolidation sprint we are also currently removing all the warnings from the code to conform to the coding guidelines.
We have dropped some of the warnings in the Eclipse warnings configuration, since these warnings are also checked by checkstyle and since it is easier to tell checkstyle not to produce warnings on generated code. So please reconfigure your Eclipse warnings according to the new tutorial. Also we changed the configuration for checkstyle as announced earlier on the mailinglist, the checkstyle configuration is now part of our repository in the org.unicase.developer folder.
Checkstyle will automatically supress warnings after an @generated tag followed by a line break, checkstyle will show warnings after an @generated NOT tag followed by a line break.
It is best practice to add a "//begin of custom code" before (including the javadoc) and a "//end of custom code" after your custom code in generated emf classes. This will help checkstyle to exactly match generated and custom code and it also helps a reviewer to identify custom code.



0 comments

Transactions

We decided to use transactions from now to modify the model. See http://www.eclipse.org/modeling/emf/?project=transaction#transaction for an overview. There are two reasons, why we want to use transactions:
1. The GMF Editor needs to do so.
2. It is likely that we will have concurrent threads modifying the model in the future, e.g. for an push update online mode.

The effect is that every modification on the model must be done inside of a transaction. Here is an example:

TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(modelelement);
domain.getCommandStack().execute(new RecordingCommand(domain){
protected void doExecute() {
do sth with the model
}
});


Don´t forget that your plugin needs a dependency to org.eclipse.emf.transaction.
If you are already using Commands, you don not have to change anything. This also applies for databindings.

If you were using a LabelProvider or an ContenProvider, replace them with TransactionProvider, e.g.:
new TransactionalAdapterFactoryContentProvider(TransactionalEditingDomain.Registry.INSTANCE.getEditingDomain
("org.unicase.EditingDomain"),new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE))

NOTE: In this example I choosed the second way to get the TransactionalEditingDomain using the Registry. This is useful if you do not have a reference to a part of the model, our Resource or our ResourceSet. If so you can use TransactionUtil.getEditingDomain(Eobject, Resource or ResourceSet);
For the TransactionalProvider you need to depend on org.eclipse.emf.transaction.ui

If you use modifications which are abstractable, it maybe useful to define you command as a class and reuse it.

If you do not use a transaction, you should get a "Write without transaction" Exception. This should make it very easy to find the places where the code needs to be refactored. I already did this for some components, it is applyable very fast!

0 comments

Ganymede RC2 Installation

These are the steps I took to install Ganymede RC2.

1. Download 'Eclipse Modeling Tools' Package from http://www.eclipse.org/downloads/packages/
3. Install missing eclipse packages (see screenshot, remember to uncheck "Include items that have already been installed")
Additional_Packages.png4. Install Subclipse, Checkstyle and Findbugs (see Getting started)


Possible optimization of the installation process:
1. Step 1. from above
2. Open the "Software Updates" Dialog and clear all update sites (some of the default sites aren't valid at present)
3. Add update sites for Ganymede, Subclipse, Checkstyle and Findbugs
4. Perform Steps 3. and 4. from above

3 comments

Running Eclipse with Maven

After "years of research" we discovered that...well...it can't be done!

There is a plugin indeed, that should take care of this, but it is a maven plugin. The idea behind the RCP development for Eclipse is to create plugins based on the very same Eclipse installation one is using - thus you must provide maven with information about your Eclipse installation. Now there are 3 possible scenarios:
  • your application works fine
  • your application works fine, but every single pom.xml is different for every developer/pc and you can't add it to a versioning system
  • your application doesn't compile, because the structure of the host Eclipse application has changed
As in the case of Eclipse Ganymede we fall in the 3rd scenario...

0 comments