use of org.eclipse.jface.text.IDocumentPartitioner in project cubrid-manager by CUBRID.
the class XMLDocumentProvider method getDocument.
/**
* Retrieves the document to be edited.
*
* @param element Object
* @return IDocument
*/
public IDocument getDocument(Object element) {
IDocument document = null;
if (element instanceof IEditorInput) {
IEditorInput ei = ((IEditorInput) element);
DocumentProvider dp = (DocumentProvider) ei.getAdapter(DocumentProvider.class);
if (dp != null) {
document = dp.getDocument(element);
}
}
if (document == null) {
document = new Document();
}
IDocumentPartitioner partitioner = new FastPartitioner(new XMLPartitionScanner(), new String[] { XMLPartitionScanner.XML_TAG, XMLPartitionScanner.XML_COMMENT });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
return document;
}
Aggregations