blob: 2638e27c615eab2066772628e2cf545f930cbd51 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/*
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
* Jens Lukowski/Innoopract - initial renaming/restructuring
*
*/
package org.eclipse.wst.xml.ui.internal.correction;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.sse.ui.internal.correction.CorrectionAssistantProvider;
import org.eclipse.wst.xml.core.internal.provisional.text.IXMLPartitions;
/**
* Correction assistant for XML
*/
public class CorrectionAssistantProviderXML extends CorrectionAssistantProvider {
public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
IContentAssistant ca = null;
if (sourceViewer != null) {
ContentAssistant assistant = new ContentAssistant();
if (sourceViewer != null) {
IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DEFAULT);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
}
ca = assistant;
}
return ca;
}
}
|