Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] How should I allow my plugin to accept multiple template content types?

Hi all,

I have defined my ScriptTemplatePreferencePage. This needs a ScriptTemplateAccess, which I have implemented as well. But this latter class is bound to one single templace content type do to the method: ScriptTemplateAccess.getContextTypeId().

The ScriptTemplateAccess clas defined the registry of template context types, and, since the same class is also needed for the code completion (in ScriptTemplateCompletionProcessor.getTemplates()), I have extended my ScriptTemplateAccess implementation to accept multiple context types.

Now I am overriding the ScriptTemplateCompletionProcessor.computeCompletionProposals() implementation not to filter the templates by this processor's context type.


Is there a better way to do this? If I implement multiple template processors, I will have to implement multiple Template Access classes. This propagates further to the template preference page which is also bound to one template access.


Which way do you think is better to go?

Thanks!
--
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034

Back to the top