@Override
 protected void connectPartitioningToElement(IEditorInput input, IDocument document) {
   if (document instanceof IDocumentExtension3) {
     IDocumentExtension3 extension = (IDocumentExtension3) document;
     if (extension.getDocumentPartitioner(IXQueryPartitions.XQUERY_PARTITIONING) == null) {
       XQueryDocumentSetupParticipant participant = new XQueryDocumentSetupParticipant();
       participant.setup(document);
     }
   }
   if (!(input instanceof IFileEditorInput)) {
     // disable folding
     IPreferenceStore store = XQueryUI.getDefault().getPreferenceStore();
     store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, false);
     store.setDefault(PreferenceConstants.EDITOR_COMMENTS_FOLDING_ENABLED, false);
   }
 }
 @Override
 public ScriptTextTools getTextTools() {
   return XQueryUI.getDefault().getTextTools();
 }
 @Override
 public IPreferenceStore getScriptPreferenceStore() {
   return XQueryUI.getDefault().getPreferenceStore();
 }