Iterate over a JFace selection in a for each loop

Just a tiny JFace helper for today: I added SelectionUtils to rcputils. You can use this to iterate over an ISelection using a for each loop:

ISelection selection = someViewer.getSelection();
for (SomeObject obj : SelectionUtils.getIterable(selection, SomeObject.class)) {
    // ...
}
Ralf Ebert

Ralf Ebert is an independent software developer, technical writer and trainer. He makes apps for Mac OS X and iOS and builds software solutions for companies using Eclipse RCP and Ruby on Rails. He offers training courses for software developers and writes books and articles about software development.