Archive for the ‘Technology’ Category

CSS, Cascading Styled Sudoku…

Monday, June 1st, 2009

I have a (bad) reputation of overscoping…


The above is what one of my supervisors have commented about me during an internship for an unnamed employer.

So what have I been doing now? The latest thing I’ve been dabbling my fingers in is the CSS styling support that’s part of e4. I wanted to see what state the CSS engine’s API was in so I decided to try and extend it to style something beyond simple SWT widgets. I mean, really, just how hard could it be to style some SWT GC code? Behold what a little bit of work can get you…


Please note that some colours are not “perfect” because alpha values are set on the GC.

As you can see, just because the CSS code is in the e4 repository doesn’t necessarily mean it’s just half-baked. Please give the code a spin and try to style your current 3.x code! :) Make a difference by contributing your feedback to help the e4 team evolve this API. And of course, if you’re feeling a little adventurous, feel free to join the e4 team. ;)

Extending real-time shared editing to projects…

Sunday, May 10th, 2009

Now that finals are over, I’ve been able to spend more time hacking on Eclipse. One of the things I’ve been working on recently is extending the shared editing work that Mustafa showed in his screencast about a year ago to encompass an entire project. Two of the most common issues that users have with the current functionality is its inability to share multiple documents and that it is not “workspace aware” on the receiver’s end. I collected both of these concerns along with the request to distribute resource changes and proceeded to try to hack something out.

My screencast should hopefully demonstrate what I’ve managed thus far. It’s about seven megabytes so it might take a while to load. There’s no audio but I think that the text narration on the screen should be sufficient.

I’m not sure what the next step is (well, beyond what I’ve outlined here), so if you have any suggestions, feel free to comment on the bug. Without a doubt, the concept of distributing resource changes is intrusive and controversial so I’m probably going to have to do more investeigating as to how turning that off will interfere with the shared editor. In any case, I hope that this will be useful to others in the future, particularly those that are interested in trying out pair programming. I’ve only pair programmed a few times (during some late evenings with Igor to meet deadlines :)) but I found it really, really helpful.

Please note that this will not make Galileo.

Eclipse and installers…

Friday, March 20th, 2009

Is it time to change our releng game plan and/or how the downloads page is setup to provide more visibility for the p2 installer?

* energetic (n=opera@ip82-139-119-221.lijbrandt.net) has joined #eclipse
energetic: Hi all
energetic: Am I with stupid or does eclipse does not have an installer?
rcjsuen: energetic: The builds from eclipse.org don’t, no.
energetic: I would expect any decent program created has an installer
energetic: now i am 1. really wondering why eclipse oesnt have an…. installer…. and 2. wondering why I am discussing this
rcjsuen: energetic: Well, not Eclipse anyway. If that bothers you, then feel free to not use Eclipse.
energetic: but for #$%^&* sake! why!
nitind: You don’t need an installer.
Orangebat: energetic: m’eh, it’s one directory, put it in program files, it’s installed
energetic: an installer! something we have solved for years!
rcjsuen: energetic: unzip and go, pretty straightforward to me
rcjsuen: I don’t even next to click ‘Next’ or ‘Finish’.
energetic: so an batch scripts to xcopy files was too hard
rcjsuen: Just double-click my eclipse.exe and I’m good to go.
* energetic removes eclipse. Devvers coding an IDE without an installer, have high chances of being unable to code a decent IDE
nitind: energetic: Or, see http://wiki.eclipse.org/Equinox_p2_Installer
nitind: energetic: And you are making a LOT of invalid assumptions and conclusions.
rcjsuen: energetic: Good luck on your project using another IDE then.
rcjsuen: Perhaps we will see you around again someday.
energetic: cya guys in 2-3 years
* energetic (n=opera@ip82-139-119-221.lijbrandt.net) has left #eclipse

New additions for the ‘Infobox’ template…

Sunday, December 14th, 2008

I’d imagine that some of you Eclipsepedia users out there may be familiar with the ‘Infobox‘ template. It’s featured prominently on a couple of project wiki pages like PDE, Equinox, and ECF. I’ve recently added a new ‘Contribute’ section for people to add a link to their repository on ViewVC and to their project’s PSF. The usage of the new ‘viewvc’ and ‘psf’ attributes are described on the template’s page so I’m not going to reiterate it here.

The primary driver behind this new addition was that Rob was having problems locating the source code to PDE. From what I understand, PDE recently moved its assets over to a new pde/ folder under /cvsroot/eclipse and was apparently causing grief for people that were unaware of the move (as they were now seeing duplicate projects in CVS). I offered to help Rob by locating a PSF for PDE for him.

Much to my surprise, I didn’t get anywhere after snooping around the wiki and at www.eclipse.org/pde. This sounded like a good excuse to make Chris’s inbox even bigger than it already is as payback for the abuse I was dealt during GSOC 2006 so I quickly shot him an email inquiring about the whereabouts of PDE’s elusive PSF. Chris replied and I systematically forwarded the information over to Rob. Based on Rob’s “Hey, thanks. You learn something every day.” and “Wow, that’s excellent.”, I think we just might have a PDE contributor in the making here. :)

So, what better way is there to encourage contributions from the community than to give them a one-stop (and *cough* consistent *cough*) location for checking out an Eclipse project’s source code? Update your wiki pages today and use the template to help promote and attract contributions from the community!

Synchronizing workspace resources with remote peers using ECF…

Monday, December 1st, 2008

I’ve been hacking on an implementation of Platform/Team’s synchronization API for the past couple of days using ECF’s datashare API as the transport and I have to say that I think I’ve made some great progress so far. I’m really quite surprised by how little work was required on my part to get everything working. Like most other Eclipse extension points, it was really just a matter of implementing a couple of interfaces and doing a bit of subclassing here and there. The rest just kind of fell into place as they say. I really am quite pleased. So, thanks for the great work and great design, Workspace team (both former and current members)! :)

Anyway, back to what I was talking about, the idea is that this plug-in is going to let you synchronize arbitrary resources in you workspace against the same copy on your friend’s workspace. If you’re having problems visualizing what I’m talking about here, you should check out the screencast and see it in action for yourself. Please note that the file is around 14 megabytes so it may take a while for it to finish loading. Don’t click the stop button before it’s done as it appears to stop the rendering also. And oh, there is audio commentary with this video but I think it might be a little low so you may have to amp up your volume settings.

If you have any comments, use cases, or whatever, please make them known by commenting on bug 257017. Thanks!

Binding editors to perspectives…

Sunday, November 16th, 2008

In 3.5M3, we introduced two new API methods, showEditor(IEditorReference) and hideEditor(IEditorReference), in IWorkbenchPage. This is an interim solution that was proposed as an attempt to resolve bug 11001. Paul has provided a great description about what those two methods do and what we’re trying to achieve here in his comment so I suggest you read that and familiarize yourself with the details.

Essentially, these two methods provide plug-in developers with the ability to (unsurprisingly) show and hide editors at will. This seems to be a somewhat common use case in the RCP world as there appears to be a tendency to define rigid perspectives that are only intended to perform certain actions and those actions alone. Clicking something brings an editor up but when they switch to another perspective this “irrelevant” editor is still there and people get upset and so on and so forth.

The notion of restricting editors to a perspective is not unheard of in the IDE space either as I hear people ask for this feature every once in a while on IRC. These users don’t seem to like having their Java editors show up in the ‘C/C++’ perspective. This sounds like a fair requirement I suppose (I wouldn’t know since I only do Java development). Some users also want this filtering functionality extended onto views by filtering out projects based on current perspective. Now this all sounds like something Mylyn (and/or Tasktop?) can help the user with although I’m not positive as to whether Mylyn can be made perspective-aware or not in this regard…but what do I know, I don’t even use Mylyn.

In any case, even if a plug-in was perspective-aware and was achieving the functionality offered by these two methods, I’d imagine that the developers are probably using internal classes and methods and/or are having a tough time getting the behaviour to work right. If you haven’t been having any problems, we would love to know how and you can let us know how by leaving a comment on the bug. For the rest of you, if the idea of showing and hiding editors, perspective-related or otherwise, are relevant to your project or plug-in, please, download 3.5M3, give the API a spin and try integrating it into your code and let us know how it’s working out for you. The response we have had thus far since Paul committed the code has been underwhelming to say the least and I am shocked to say that this request actually has 18 votes! Of course, that number was only applicable at the time of this posting because this post may or may not cause that number to fluctuate. ;)

Taking p2’s mirroring and file distribution capabilities to the next level…

Tuesday, November 4th, 2008

“Taking it to the next level” is a phrase we often used amongst the Extreme Blue teams and staff at the IBM Ottawa Software Lab in 2007 and I think it is quite fitting for this post. Whenever we didn’t know what to do next, we’d just ask ourselves, “how do we take [our project] to the next level?”. Thanks, Marcellus!

Back in 2006, Philippe and I had a dream of using BitTorrent to distribute plug-ins and updates for Eclipse and I participated in the Google Summer of Code program in 2006 in an attempt to realize that. The keyword here is “attempt”, because, needless to say, since this post isn’t entitled “Taking the Update Manager’s mirroring and file distribution capabilities to the next level…”, I didn’t get that far. But last night, I rolled up my sleeves and began to hard code values all over the place in an attempt to write my own implementations of the IArtifactRepository and IMetadataRepository interfaces and concrete subclasses of ArtifactRepositoryFactory and MetadataRepositoryFactory.

That did not go well. Quite simply, there were just too many methods to implement and I just gave up after it decided to call my metadata repository’s query method.

What I ended up doing was I subclassed p2’s implementations of these interfaces and abstract classes for handling update sites. By doing this, p2’s user interface would render things properly in its tree and actually allow me to click ‘Install’ (instead of throwing thousands of RuntimeExceptions when I was trying it the other way). Then I simply just overrode getArtifacts to retrieve the artifacts via BitTorrent.

What you see above is my Azureus instance seeding and sharing some plug-in jars of Subclipse and my BitTorrent protocol implementation at work downloading away in the ‘Progress’ view. Of course, the files didn’t actually even go to the right place (I had to hard code that too), but hey, I really just wanted to familiarize myself with p2’s (non-existent) APIs and I think that hacking something like this up together in a couple of hours has certainly helped me out on that front. :)

And before you ask, while the implementation of the BitTorrent protocol is in ECF’s CVS repository, this hack is not publicly accessible and will likely remain that way for a while. More to come later if this hack ever stops being just a hack.

Oh right, I’m going to ESE 2008…

Friday, October 31st, 2008

I don’t know who would ever want to talk to me but I’m Chinese, about 5′8″, and I wear glasses. Since that probably doesn’t help since we know all Asians wear glasses, you will probably find me manning the Versant booth (#2 on the map) with Markus and Christian if I’m not currently attending a session or talk somewhere.

Help, I can’t use Eclipse to do my homework…

Friday, October 3rd, 2008

Every once in a while, someone will come on IRC asking for help setting up his or her project for some homework assignment. Paul and I usually have our hands full here (not that they’re never not full) because the teachers seem to enjoy giving out .class files to the students and it’s not always immediately obvious how to set things up properly with JDT. I hope that this blog entry will streamline the setup process for my fellow students.

Before we get going, make sure you are in the ‘Java’ perspective. You can switch to it by going ‘Window > Open Perspective > Other… > Java’ and then clicking ‘OK’.

Now, the first thing you have to do in Eclipse before you start hacking on your Java files is to create a Java project. I too had difficulties accepting this back when I started using Eclipse in 2005 for my own homework assignments. For those of you that are reading this, well, it’s time to accept it too and just get over it, I really don’t know what else to say. :O I got over it and so can you!

To create a new ‘Java Project’, you should go ‘File > New > Java Project’ and then click the ‘Next’ button. Enter in a name for your project and then click the ‘Finish’ button, the defaults shall suffice.

Now I have my fancy ‘StackAssignment’ project in my ‘Package Explorer’ view!

Alright, let’s start writing that stack implementation right away then. Select the ’src’ folder in the ‘Package Explorer’, and then go ‘File > New > Class’. Type in a name for your stack implementation and then click ‘Finish’.

Okay, now we have an editor open. Let’s start coding then! Since our teacher told us to implement his Stack interface, let’s get right to it, shall we?

Woah, what’s this? “Stack cannot be resolved to a type”? It seems I can’t compile my code. What’s a “type” anyway? I don’t think I had this problem when I was using ‘javac’ on the command line. Hm, could this be because the teacher’s Stack.class file isn’t in my project? Let’s try pasting it into the project then!

Well, it’s there now but it doesn’t seem to be taking effect. I still see that nasty red X mark on my beautiful StackImpl.java file! :( Why isn’t the compiler picking it up? The problem here is that the Stack.class file is not in this project’s Java classpath. If the term Java classpath doesn’t make any sense to you, now would be a good time to ask your teacher. It’s okay, I’ll wait.

Or I won’t, because we will now fast forward to five minutes before the assignment is due so I’ll quickly explain how to add the Stack.class file to your project’s classpath so our assignment starts compiling properly. Select your project and then right-click (or left-click where applicable for the left-handed mouse users out there) on it, and select ‘Properties’ at the bottom. Go to ‘Java Build Path > Libraries > Add Class Folder…’.

I’d suggest clicking the ‘Create New Folder…’ button and entering in a name of your choice.

Click ‘OK’ to close the dialog and then ‘OK’ again to close the properties dialog. You should now see that the ‘Package Explorer’ view has been updated with our latest changes. Drag your class files and then drop it into your created class folder.

Notice now that the “Stack cannot be resolved to a type” error has now disappeared! In its place, we are now told to implement the methods that our teacher told us to implement.

Alright, let’s do this!

Well, not really, since I can’t do your homework for you. I’m a student too, so I know how it feels. ;)

Before I sign off, I’ll do a plug here for Wayne and encourage both teachers and students to take a gander at the IDE4EDU project. Thanks for reading and good luck with those assignments.

Customizing that Eclipse toolbar…

Wednesday, July 16th, 2008

Did you ever wish your toolbar looked like this?

Or maybe you’ve always wanted an Eclipse lite or something?

Please voice your opinion on the issue on bug 64746. While the bug is about forcing the presence of both text and images for org.eclipse.ui.actionSets contributions, I suspect a workbench-wide setting in the preferences to switch between the three options would probably need to be supported to please the RCP crowd.