I recommend Netbeans Platfrom's screencast about Lookup, available
here.
Many tutorials about Netbeans Platfrom can be found on the
website.
There is no extensive use of Lookup in the Preview modules, except for PreviewController. However that must change with the planned refactoring, as more modularity will be developed. Just an exemple applied to Preview, one can imagine Properties class implementing
PreviewProperty and setting the annotation
Code: Select all
@ServiceProvider(service=PreviewProperty.class)
and the UI doing
Code: Select all
for(PreviewProperty p : Lookup.getDefault().lookupAll(PreviewProperty.class)) {
//display property
}
for knowing about declared properties.
The power of this system is that any plug-in just create a
PreviewProperty implementation and use
@ServiceProvider to be integrated.