Switch default document partioning to a private SSE value
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
index 0385fd0..81e27ff 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/text/BasicStructuredDocument.java
@@ -1015,7 +1015,7 @@
public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
ITypedRegion[] typedRegions = null;
try {
- typedRegions = computePartitioning(IDocumentExtension3.DEFAULT_PARTITIONING, offset, length, false);
+ typedRegions = computePartitioning(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING, offset, length, false);
} catch (BadPartitioningException e) {
// impossible in this context
throw new Error(e);
@@ -1041,7 +1041,7 @@
return ((IDocumentPartitionerExtension2) partitioner).computePartitioning(offset, length, includeZeroLengthPartitions);
else if (partitioner != null)
return partitioner.computePartitioning(offset, length);
- else if (DEFAULT_PARTITIONING.equals(partitioning))
+ else if (IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
return new TypedRegion[]{new TypedRegion(offset, length, DEFAULT_CONTENT_TYPE)};
else
throw new BadPartitioningException();
@@ -1294,7 +1294,7 @@
return ((IDocumentPartitionerExtension2) partitioner).getContentType(offset, preferOpenPartitions);
else if (partitioner != null)
return partitioner.getContentType(offset);
- else if (DEFAULT_PARTITIONING.equals(partitioning))
+ else if (IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
return DEFAULT_CONTENT_TYPE;
else
throw new BadPartitioningException();
@@ -1306,7 +1306,7 @@
* @see IDocumentPartitioner
*/
public IDocumentPartitioner getDocumentPartitioner() {
- return getDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING);
+ return getDocumentPartitioner(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING);
}
/*
@@ -1354,7 +1354,7 @@
public String[] getLegalContentTypes() {
String[] result = null;
try {
- result = getLegalContentTypes(IDocumentExtension3.DEFAULT_PARTITIONING);
+ result = getLegalContentTypes(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING);
} catch (BadPartitioningException e) {
// impossible in this context
throw new Error(e);
@@ -1370,7 +1370,7 @@
IDocumentPartitioner partitioner = getDocumentPartitioner(partitioning);
if (partitioner != null)
return partitioner.getLegalContentTypes();
- if (DEFAULT_PARTITIONING.equals(partitioning))
+ if (IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning))
return new String[]{DEFAULT_CONTENT_TYPE};
throw new BadPartitioningException();
}
@@ -1514,7 +1514,7 @@
public ITypedRegion getPartition(int offset) throws BadLocationException {
ITypedRegion partition = null;
try {
- partition = getPartition(IDocumentExtension3.DEFAULT_PARTITIONING, offset, false);
+ partition = getPartition(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING, offset, false);
} catch (BadPartitioningException e) {
throw new Error(e);
}
@@ -1540,7 +1540,7 @@
result = ((IDocumentPartitionerExtension2) partitioner).getPartition(offset, preferOpenPartitions);
} else if (partitioner != null) {
result = partitioner.getPartition(offset);
- } else if (DEFAULT_PARTITIONING.equals(partitioning)) {
+ } else if (IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING.equals(partitioning)) {
result = new TypedRegion(0, getLength(), DEFAULT_CONTENT_TYPE);
} else
throw new BadPartitioningException();
@@ -2352,7 +2352,7 @@
public void setDocumentPartitioner(IDocumentPartitioner partitioner) {
Assert.isNotNull(getStore(), "text store must be set before document partitioner"); //$NON-NLS-1$
IDocumentPartitioner oldPartioner = null;
- oldPartioner = getDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING);
+ oldPartioner = getDocumentPartitioner(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING);
if (oldPartioner != null) {
oldPartioner.disconnect();
}
@@ -2362,7 +2362,7 @@
if (partitioner != null) {
partitioner.connect(this);
}
- setDocumentPartitioner(IDocumentExtension3.DEFAULT_PARTITIONING, partitioner);
+ setDocumentPartitioner(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING, partitioner);
}
/*
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocument.java
index 2891320..39e7821 100644
--- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocument.java
+++ b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/text/IStructuredDocument.java
@@ -31,6 +31,8 @@
*/
public interface IStructuredDocument extends IEncodedDocument, IDocumentExtension, IAdaptable {
+ String DEFAULT_STRUCTURED_PARTITIONING = "___structured_text_partitioning";
+
void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener);
/**
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
index d487758..152c2fe 100644
--- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
+++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/StructuredTextViewerConfiguration.java
@@ -145,6 +145,13 @@
public Map getAutoEditStrategies(ISourceViewer sourceViewer) {
return new HashMap();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredDocumentPartitioning(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ public String getConfiguredDocumentPartitioning(ISourceViewer sourceViewer) {
+ return IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING;
+ }
/*
* @see SourceViewerConfiguration#getConfiguredTextHoverStateMasks(ISourceViewer,