Monday, June 25, 2007

ToolBar paths and Archimedes news

The end of the semester is always a disaster. Tons of things to do and not enough time.
For once I don't have tons of tests, the only hard work is to maintain the job, the work on Archimedes, the studies and the corrections going.

Anyway, enough complaining.
I got some news about Archimedes:
This release is coming to an end but I am proud to say that most of the work that should have been done is complete. There are a few details missing but those are mostly related to difficulties we are finding with RCP.
Both the import and the export feature that will become the save and open one are finished, all that is left to do is to integrate this with the platform so that the users can enjoy all the flexibility of Eclipse's wizards.

Also, Mariana is now responsible for releasing updates for the old 0.17.x version and get our bug fixes and new features ported to that platform until the RCP one is not perfect. I wish her luck and hope to see a lot of report from you guys when she does.

Most of the reported bugs have been correct so far and I even learned how to organize the action icons on the toolbar. This means that, from now on, Archimedes' toolbar will be a bit more organized than it was before.

Since I found absolutely NO documentation about this, I wanted to write a little bit about how to make it work. It is quite simple but worth saying.

Mainly, when you extend org.eclipse.ui.actionSet and create an action, you can add two attributes: menubarPath and toolbarPath. The first one is quite decently documented so you can find several tutorial that will explain you that you should add some MenuManagers in your ApplicationActionBarAdvisor and then refer to the paths you set on those managers to decide where the actions should appear.

Regarding the latter, you will find almost nothing. I've search a lot and very little is published to explain you one very tiny and simple thing: It works EXACTLY the same way. May sound stupid for me to say it like that but if you have no documentation or example, this may not be evident because when you create ToolBarManagers, you cannot add slots within those to specify boxes where the actions should appear. However, you must pretend that you did. In most cases, this will mean that you will simply copy paste whatever you did on the menubarPath to the toolbarPath.

I am pasting a simplified version of the fillMenuBar method and the fillCoolBar one as well as a couple of plugins that add actions to those slots.


protected void fillCoolBar (ICoolBarManager coolBar) {
  IToolBarManager fileBar = new ToolBarManager(coolBar.getStyle());
  coolBar.add(new ToolBarContributionItem(fileBar, "file"));
}


and


protected void fillMenuBar (IMenuManager menuBar) {
  MenuManager fileMng = new MenuManager("File", "file");
  fileMng.add(new GroupMarker("start"));
  fileMng.add(new Separator());
  fileMng.add(new GroupMarker("end"));
  menuBar.add(fileMng);
}


With those method set up, you can add plugins (or just your RCP application xml descriptor) that use those paths:


<actionSet description="The action set containing some file actions."
  id="br.org.archimedes.example.actionSet" label="File Action Set"
  visible="true">
    <action icon="icons/my_icon.png" style="push"
      id="br.org.archimedes.example.action"
      label="My Action" tooltip="An example action"
      menubarPath="file/end"
      class="br.org.archimedes.example.MyAction"
      toolbarPath="file/end"/>
</actionset>


If you just add a couple more of those plugins, you will see that all the actions will be grouped both on the menu and on the toolbar.

And that's about it for now. Have fun guys.

Thursday, June 7, 2007

A tutorial for programmer

I think I will just have to admit that no mather how often I hope to publish news on this blog, I will always be late. But the fact is, running late is the only thing that pushes me to write here so I will keep trying to keep a reasonable pace and I will keep complaining about being late. I hope you guys don't mind.

As for now, I have some news although not many. Archimedes is quite stuck this week since today (thursday) is a holiday and it was half of our programming time. The other half was monday and we didn't used it to program for once. It was burned down making up a talk and a demonstration about how to develop plugins for Archimedes.
I've tried to keep all the documents in english so I could share them later on the internet but I still have a big work to do: the screencast.
The talk was composed of three parts, two of which I made and the first one was made by an Archimedes collaborator (Julien Renaut). It is mostly focused on programming problems and how people can add features to Archimedes. His talk was about extensions and extension points which are some concepts used by eRCP to allow plugins to add functionality to the main software. His work was done in Portuguese but I will translate it and insert it into the main talk I will upload.
The second part was my talk which was a lot more about Archimedes and how our main structure works. It tries to let people understand the flow of information within the software. It has a couple of "UML" (those are not really UML but kind of) figures and a nice review about Archimedes' main classes. I need to add the notes on this talk so that people can look at the talk and understand what I was trying to talk about.
The third and last part was a small example of how to create a plugin project that would add a new element to the software. This is quite a long work and I want to have a screencast of that with my voice explaining what is going on. So it will probably take me some time (maybe a month) to have it all working fine.

Also, there is a volunteer architect building up a user guide much better than anything we could ever produce. It is currently ongoing and is in Portuguese but as soon as it is finished, I will ask for help on translating this to several languages.

Speaking of languages, I am getting desperate to have Archimedes' build system working with maven 2 has said before. This would allow me to have a src.zip deploy once more as well as a nice translation zip file to have people translating the software more frequently and easily.

So that's what I've been doing. I've also been working hard to try to solve the problems from the uva gadget but I've been failing a lot which is not really keeping my moral up. :( Also, my desktop seems to have died on me. This doesn't means many loses at the moment but makes me quite upset and will probably take me some precious time to fix. Until then I might just not have anything to test Archimedes on Windows or Linux so I hope you guys keep sending us reports.

That's it. Bye bye!