Twitter github

Posts Tagged with “jface”

The PixelConverter party is over…

Sometimes when your browsing for types in Eclipse, your head wants to explode:

Good news though, the PixelConverter party is finally over and has been declared as an API in JFace. The next stop is the abundance of “SWTUtil” classes throughout the Platform and friends.

JFace Databinding is Cool

I have been getting to know JFace Databinding lately. It was on my TODO list of Eclipse technologies to learn and although things were rough in the beginning, I’m starting really appreciate things. For example, I had a use case where I was binding a value to a text control. By default, the model was being updated on every keystroke which could be fine. However, if you have a complex UI that does fancy validation, it can cause unexpected results like refreshes that you just don’t want. A simple and more natural thing is only to commit a change to the model after the user is done typing instead of every keystroke. The solution in JFace Databinding is simple…

SWTObservables.observeDelayedValue(400, myObservable)

There’s also a nice code snippet that you can run to see how the code works.