use of org.eclipse.jface.text.IDocumentPartitioner in project syncope by apache.
the class HTMLFileDocumentProvider method createDocument.
public IDocument createDocument(final Object element) throws CoreException {
IDocument document = super.createDocument(element);
if (document != null) {
IDocumentPartitioner partitioner = new FastPartitioner(new HTMLPartitionScanner(), new String[] { HTMLPartitionScanner.HTML_TAG, HTMLPartitionScanner.HTML_COMMENT, HTMLPartitionScanner.HTML_SCRIPT, HTMLPartitionScanner.HTML_DOCTYPE, HTMLPartitionScanner.HTML_DIRECTIVE, HTMLPartitionScanner.JAVASCRIPT, HTMLPartitionScanner.HTML_CSS, HTMLPartitionScanner.SYNCOPE_TAG });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
use of org.eclipse.jface.text.IDocumentPartitioner in project usbdm-eclipse-plugins by podonoghue.
the class DocumentProvider method getDocument.
@Override
public IDocument getDocument(Object element) {
IDocument document = super.getDocument(element);
if (document != null) {
IDocumentPartitioner partitioner = new Partitioner(new PartitionScanner(), new String[] { PartitionScanner.C_IGNORED_COMMENT, PartitionScanner.C_COMMENT, PartitionScanner.C_IDENTIFIER, PartitionScanner.C_STRING, PartitionScanner.C_NUMBER });
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
use of org.eclipse.jface.text.IDocumentPartitioner in project titan.EclipsePlug-ins by eclipse.
the class DocumentSetupParticipant method setup.
@Override
public void setup(final IDocument document) {
IDocumentPartitioner partitioner = new FastPartitioner(new PartitionScanner(), PartitionScanner.PARTITION_TYPES);
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
extension3.setDocumentPartitioner(PartitionScanner.CONFIG_PARTITIONING, partitioner);
} else {
document.setDocumentPartitioner(partitioner);
}
partitioner.connect(document);
document.addDocumentListener(new IDocumentListener() {
@Override
public void documentAboutToBeChanged(final DocumentEvent event) {
GlobalIntervalHandler.putInterval(event.getDocument(), null);
}
@Override
public void documentChanged(final DocumentEvent event) {
// Do nothing
}
});
}
use of org.eclipse.jface.text.IDocumentPartitioner in project titan.EclipsePlug-ins by eclipse.
the class DocumentSetupParticipant method setup.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.
* eclipse.jface.text.IDocument)
*/
@Override
public void setup(final IDocument document) {
EditorTracker.remove(editor);
EditorTracker.put((IFile) editor.getEditorInput().getAdapter(IFile.class), editor);
DocumentTracker.put((IFile) editor.getEditorInput().getAdapter(IFile.class), document);
IDocumentPartitioner partitioner = new FastPartitioner(new PartitionScanner(), PartitionScanner.PARTITION_TYPES);
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
extension3.setDocumentPartitioner(PartitionScanner.ASN1_PARTITIONING, partitioner);
} else {
document.setDocumentPartitioner(partitioner);
}
partitioner.connect(document);
document.addDocumentListener(new IDocumentListener() {
@Override
public void documentAboutToBeChanged(final DocumentEvent event) {
GlobalIntervalHandler.putInterval(event.getDocument(), null);
}
@Override
public void documentChanged(final DocumentEvent event) {
IPreferencesService prefs = Platform.getPreferencesService();
if (prefs.getBoolean(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.USEONTHEFLYPARSING, true, null)) {
analyze(document, false);
}
}
});
analyze(document, true);
}
use of org.eclipse.jface.text.IDocumentPartitioner in project titan.EclipsePlug-ins by eclipse.
the class DocumentSetupParticipant method setup.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.filebuffers.IDocumentSetupParticipant#setup(org.
* eclipse.jface.text.IDocument)
*/
@Override
public void setup(final IDocument document) {
DocumentTracker.put((IFile) editor.getEditorInput().getAdapter(IFile.class), document);
IDocumentPartitioner partitioner = new FastPartitioner(new PartitionScanner(), PartitionScanner.PARTITION_TYPES);
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 extension3 = (IDocumentExtension3) document;
extension3.setDocumentPartitioner(PartitionScanner.TTCN3_PARTITIONING, partitioner);
} else {
document.setDocumentPartitioner(partitioner);
}
partitioner.connect(document);
document.addDocumentListener(new IDocumentListener() {
@Override
public void documentAboutToBeChanged(final DocumentEvent event) {
GlobalIntervalHandler.putInterval(event.getDocument(), null);
}
@Override
public void documentChanged(final DocumentEvent event) {
// Do nothing
}
});
}
Aggregations