Package com.vf.apex.editor

Source Code of com.vf.apex.editor.XMLDocumentProvider

package com.vf.apex.editor;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentPartitioner;
import org.eclipse.jface.text.rules.FastPartitioner;
import org.eclipse.ui.editors.text.FileDocumentProvider;

import com.vf.apex.editor.scanners.XMLPartitionScanner;

public class XMLDocumentProvider extends FileDocumentProvider {

  protected IDocument createDocument(Object element) throws CoreException {
    IDocument document = super.createDocument(element);
    if (document != null) {
      IDocumentPartitioner partitioner =
        new FastPartitioner(
          new XMLPartitionScanner(),
          new String[] {
            XMLPartitionScanner.XML_TAG,
            XMLPartitionScanner.XML_COMMENT });
      partitioner.connect(document);
      document.setDocumentPartitioner(partitioner);
    }
    return document;
  }
}
TOP

Related Classes of com.vf.apex.editor.XMLDocumentProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.