@Override
 protected void loadTemplates(NabuccoToJavaVisitorContext visitorContext)
     throws NabuccoTransformationException {
   try {
     JavaTemplateLoader loader = JavaTemplateLoader.getInstance();
     JavaTemplate template = loader.loadTemplate(NabuccoJavaTemplateConstants.MESSAGE_TEMPLATE);
     visitorContext.putTemplate(NabuccoJavaTemplateConstants.MESSAGE_TEMPLATE, template);
   } catch (MdaExeception e) {
     throw new NabuccoVisitorException("Error loading java message templates.", e);
   }
 }
  @Override
  protected void loadTemplates(NabuccoToJavaVisitorContext visitorContext)
      throws NabuccoTransformationException {
    try {
      // template for Search View
      JavaTemplate template = JavaTemplateLoader.getInstance().loadTemplate(SEARCH_VIEW_TEMPLATE);
      visitorContext.putTemplate(SEARCH_VIEW_TEMPLATE, template);

      // template for Widget factory
      template = JavaTemplateLoader.getInstance().loadTemplate(SEARCH_VIEW_WIDGET_FACTORY_TEMPLATE);
      visitorContext.putTemplate(SEARCH_VIEW_WIDGET_FACTORY_TEMPLATE, template);
      // template for Widget factory - reusing functionality from edit view widget factory
      template =
          JavaTemplateLoader.getInstance()
              .loadTemplate(EDIT_WIDGET_FACTORY_WIDGET_DECLARATION_TEMPLATE);
      visitorContext.putTemplate(EDIT_WIDGET_FACTORY_WIDGET_DECLARATION_TEMPLATE, template);
      // template for layouter
      template = JavaTemplateLoader.getInstance().loadTemplate(SEARCH_VIEW_LAYOUTER_TEMPLATE);
      visitorContext.putTemplate(SEARCH_VIEW_LAYOUTER_TEMPLATE, template);

      // template for model
      template = JavaTemplateLoader.getInstance().loadTemplate(SEARCH_VIEW_MODEL_TEMPLATE);
      visitorContext.putTemplate(SEARCH_VIEW_MODEL_TEMPLATE, template);

      // template for common model parts
      template = JavaTemplateLoader.getInstance().loadTemplate(COMMON_VIEW_MODEL_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_MODEL_TEMPLATE, template);

      // template for common model method parts
      template = JavaTemplateLoader.getInstance().loadTemplate(COMMON_VIEW_MODEL_METHOD_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_MODEL_METHOD_TEMPLATE, template);

      // template for common ui method parts
      template = JavaTemplateLoader.getInstance().loadTemplate(COMMON_VIEW_VIEW_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_VIEW_TEMPLATE, template);

      // templates for comboBox generation
      template =
          JavaTemplateLoader.getInstance()
              .loadTemplate(COMMON_VIEW_COMBO_BOX_CONTENT_PROVIDER_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_COMBO_BOX_CONTENT_PROVIDER_TEMPLATE, template);

      template =
          JavaTemplateLoader.getInstance().loadTemplate(COMMON_VIEW_COMBO_BOX_HANDLER_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_COMBO_BOX_HANDLER_TEMPLATE, template);

      template =
          JavaTemplateLoader.getInstance()
              .loadTemplate(COMMON_VIEW_COMBO_BOX_LABEL_PROVIDER_TEMPLATE);
      visitorContext.putTemplate(COMMON_VIEW_COMBO_BOX_LABEL_PROVIDER_TEMPLATE, template);

    } catch (JavaTemplateException e) {
      throw new NabuccoTransformationException("Error loading java edit view templates.", e);
    }
  }