It seems to be almost impossible to do this without having to do a ton of work. So I guess I am better of violating the DRY principle - Grrrr!
The main problem being that the ViewerFilter instance is only known at runtime by the CommonFilterDescriptorManager.
This class binds the ViewerFilter instances to a CommonFilterDescriptor (contains the info from plugin.xml).
public class CommonFilterDescriptorManager {
private static final CommonFilterDescriptorManager INSTANCE = new CommonFilterDescriptorManager();
private static final CommonFilterDescriptor[] NO_FILTER_DESCRIPTORS = new CommonFilterDescriptor[0];
private final Set filters = new HashSet();
However everything about this class is private.
What I need is a getViewerFilter(CommonFilterDescriptor) method - or an alternative way to this.
I already spent to much time on this - so I am off to duplicating my filter code.
[Updated on: Wed, 03 February 2010 08:59] by Moderator