public HTMLTemplatePreferencePage() {
    HTMLUIPlugin htmlEditorPlugin = HTMLUIPlugin.getDefault();

    setPreferenceStore(htmlEditorPlugin.getPreferenceStore());
    setTemplateStore(htmlEditorPlugin.getTemplateStore());
    setContextTypeRegistry(htmlEditorPlugin.getTemplateContextRegistry());
  }
  public boolean performOk() {
    boolean result = super.performOk();

    HTMLUIPlugin.getDefault().savePluginPreferences();

    return result;
  }
 public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
   final IContentAssistant assistant = super.getContentAssistant(sourceViewer);
   if (assistant instanceof ContentAssistant) {
     ((ContentAssistant) assistant)
         .enableAutoInsert(
             HTMLUIPlugin.getInstance()
                 .getPreferenceStore()
                 .getBoolean(HTMLUIPreferenceNames.INSERT_SINGLE_SUGGESTION));
   }
   return assistant;
 }
 protected IPreferenceStore doGetPreferenceStore() {
   return HTMLUIPlugin.getDefault().getPreferenceStore();
 }
 private void doSavePreferenceStore() {
   HTMLUIPlugin.getDefault().savePluginPreferences(); // UI
   HTMLCorePlugin.getDefault().savePluginPreferences(); // model
 }