Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavery2005-04-01 21:09:29 +0000
committerpavery2005-04-01 21:09:29 +0000
commit40dd89ea147e353bc3559f130246c887e7c6ffff (patch)
tree64372abaa16ac977b112bf04bcb4e4fb46519bca /bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst
parent89f4f03964b704dcfcfa41b7e46f7e3333b6eb93 (diff)
downloadwebtools.sourceediting-40dd89ea147e353bc3559f130246c887e7c6ffff.tar.gz
webtools.sourceediting-40dd89ea147e353bc3559f130246c887e7c6ffff.tar.xz
webtools.sourceediting-40dd89ea147e353bc3559f130246c887e7c6ffff.zip
more API cleanup (mostly partition types)
Diffstat (limited to 'bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst')
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java4
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java16
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java43
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitionTypes.java (renamed from bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java)7
4 files changed, 30 insertions, 40 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
index 32c235e121..55bf775609 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/document/PageDirectiveAdapterImpl.java
@@ -33,7 +33,7 @@ import org.eclipse.wst.sse.core.IStructuredModel;
import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistry;
import org.eclipse.wst.sse.core.internal.modelhandler.EmbeddedTypeRegistryImpl;
import org.eclipse.wst.sse.core.modelhandler.EmbeddedTypeHandler;
-import org.eclipse.wst.sse.core.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.text.IStructuredPartitioning;
import org.eclipse.wst.sse.core.util.Debug;
import org.eclipse.wst.sse.core.util.StringUtils;
import org.eclipse.wst.xml.core.document.XMLNode;
@@ -485,7 +485,7 @@ public class PageDirectiveAdapterImpl implements PageDirectiveAdapter {
*/
public void setLanguage(String newLanguage) {
this.cachedLanguage = newLanguage;
- IDocumentPartitioner partitioner = ((IDocumentExtension3) model.getStructuredDocument()).getDocumentPartitioner(IStructuredDocument.DEFAULT_STRUCTURED_PARTITIONING);
+ IDocumentPartitioner partitioner = ((IDocumentExtension3) model.getStructuredDocument()).getDocumentPartitioner(IStructuredPartitioning.DEFAULT_STRUCTURED_PARTITIONING);
if (partitioner instanceof StructuredTextPartitionerForJSP) {
((StructuredTextPartitionerForJSP) partitioner).setLanguage(newLanguage);
}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java
index fd932d35cd..3fae7869db 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/NullStructuredDocumentPartitioner.java
@@ -16,7 +16,7 @@ import org.eclipse.jface.text.ITypedRegion;
import org.eclipse.wst.sse.core.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.text.IStructuredTextPartitioner;
import org.eclipse.wst.sse.core.text.ITextRegion;
-import org.eclipse.wst.sse.core.text.StructuredTypedRegion;
+import org.eclipse.wst.sse.core.text.IStructuredTypedRegion;
/**
* To be used when no known partitioner is available.
@@ -24,7 +24,7 @@ import org.eclipse.wst.sse.core.text.StructuredTypedRegion;
*/
public class NullStructuredDocumentPartitioner implements IStructuredTextPartitioner {
- public class NullStructuredTypedRegion implements StructuredTypedRegion {
+ public class NullStructuredTypedRegion implements IStructuredTypedRegion {
private int fOffset;
@@ -70,8 +70,8 @@ public class NullStructuredDocumentPartitioner implements IStructuredTextPartiti
// nothing to do
}
- public StructuredTypedRegion createPartition(int offset, int length, String type) {
- StructuredTypedRegion result = new NullStructuredTypedRegion();
+ public IStructuredTypedRegion createPartition(int offset, int length, String type) {
+ IStructuredTypedRegion result = new NullStructuredTypedRegion();
result.setOffset(offset);
result.setLength(length);
result.setType(type);
@@ -82,7 +82,7 @@ public class NullStructuredDocumentPartitioner implements IStructuredTextPartiti
// nothing to do
}
- public String getDefault() {
+ public String getDefaultPartitionType() {
return ST_UNKNOWN_PARTITION;
}
@@ -94,7 +94,7 @@ public class NullStructuredDocumentPartitioner implements IStructuredTextPartiti
return ST_UNKNOWN_PARTITION;
}
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, ITextRegion previousStartTagNameRegion, IStructuredDocumentRegion nextNode, ITextRegion nextEndTagNameRegion) {
+ public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
return ST_UNKNOWN_PARTITION;
}
@@ -111,11 +111,11 @@ public class NullStructuredDocumentPartitioner implements IStructuredTextPartiti
}
public String getContentType(int offset) {
- return getDefault();
+ return getDefaultPartitionType();
}
public ITypedRegion getPartition(int offset) {
- return createPartition(offset, 1, getDefault());
+ return createPartition(offset, 1, getDefaultPartitionType());
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
index 25f487c72b..066584f80e 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/text/StructuredTextPartitionerForJSP.java
@@ -24,7 +24,7 @@ import org.eclipse.jst.jsp.core.contentmodel.tld.JSP12TLDNames;
import org.eclipse.jst.jsp.core.encoding.JSPDocumentHeadContentDetector;
import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
import org.eclipse.jst.jsp.core.model.parser.DOMJSPRegionContexts;
-import org.eclipse.jst.jsp.core.text.IJSPPartitions;
+import org.eclipse.jst.jsp.core.text.IJSPPartitionTypes;
import org.eclipse.wst.html.core.internal.text.StructuredTextPartitionerForHTML;
import org.eclipse.wst.sse.core.internal.parser.ForeignRegion;
import org.eclipse.wst.sse.core.internal.text.rules.StructuredTextPartitioner;
@@ -173,7 +173,7 @@ public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
private static final String XHTML_MIME_TYPE = "text/xhtml"; //$NON-NLS-1$
private static final String XML_MIME_TYPE = "text/xml"; //$NON-NLS-1$
- private final static String[] fConfiguredContentTypes = new String[]{IJSPPartitions.JSP_DEFAULT, IJSPPartitions.JSP_DEFAULT_EL, IJSPPartitions.JSP_DIRECTIVE, IJSPPartitions.JSP_CONTENT_DELIMITER, IJSPPartitions.JSP_CONTENT_JAVA, IJSPPartitions.JSP_CONTENT_JAVASCRIPT, IJSPPartitions.JSP_COMMENT};
+ private final static String[] fConfiguredContentTypes = new String[]{IJSPPartitionTypes.JSP_DEFAULT, IJSPPartitionTypes.JSP_DEFAULT_EL, IJSPPartitionTypes.JSP_DIRECTIVE, IJSPPartitionTypes.JSP_CONTENT_DELIMITER, IJSPPartitionTypes.JSP_CONTENT_JAVA, IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT, IJSPPartitionTypes.JSP_COMMENT};
/**
* @return
@@ -296,8 +296,8 @@ public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
super.disconnect();
}
- public String getDefault() {
- return getEmbeddedPartitioner().getDefault();
+ public String getDefaultPartitionType() {
+ return getEmbeddedPartitioner().getDefaultPartitionType();
}
/**
@@ -363,24 +363,24 @@ public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
result = getPartitionTypeForDocumentLanguage();
}
else if (region_type == DOMJSPRegionContexts.JSP_COMMENT_TEXT || region_type == DOMJSPRegionContexts.JSP_COMMENT_OPEN || region_type == DOMJSPRegionContexts.JSP_COMMENT_CLOSE)
- result = IJSPPartitions.JSP_COMMENT;
+ result = IJSPPartitionTypes.JSP_COMMENT;
else if (region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN || region_type == DOMJSPRegionContexts.JSP_DIRECTIVE_CLOSE)
- result = IJSPPartitions.JSP_DIRECTIVE;
+ result = IJSPPartitionTypes.JSP_DIRECTIVE;
else if (region_type == DOMJSPRegionContexts.JSP_CLOSE || region_type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN || region_type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN || region_type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN)
- result = IJSPPartitions.JSP_CONTENT_DELIMITER;
+ result = IJSPPartitionTypes.JSP_CONTENT_DELIMITER;
else if (region_type == DOMJSPRegionContexts.JSP_ROOT_TAG_NAME)
- result = IJSPPartitions.JSP_DEFAULT;
+ result = IJSPPartitionTypes.JSP_DEFAULT;
else if (region_type == DOMJSPRegionContexts.JSP_EL_OPEN || region_type == DOMJSPRegionContexts.JSP_EL_CONTENT || region_type == DOMJSPRegionContexts.JSP_EL_CLOSE || region_type == DOMJSPRegionContexts.JSP_EL_DQUOTE
|| region_type == DOMJSPRegionContexts.JSP_EL_SQUOTE || region_type == DOMJSPRegionContexts.JSP_EL_QUOTED_CONTENT)
- result = IJSPPartitions.JSP_DEFAULT_EL;
+ result = IJSPPartitionTypes.JSP_DEFAULT_EL;
else if (region_type == XMLRegionContext.XML_CONTENT) {
// possibly between <jsp:scriptlet>, <jsp:expression>,
- // <jsp:declration>
+ // <jsp:declaration>
IStructuredDocumentRegion sdRegion = this.structuredDocument.getRegionAtCharacterOffset(offset);
if (isJspJavaActionName(getParentName(sdRegion)))
result = getPartitionTypeForDocumentLanguage();
else
- result = getDefault();
+ result = getDefaultPartitionType();
}
else {
result = getEmbeddedPartitioner().getPartitionType(region, offset);
@@ -388,27 +388,20 @@ public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
return result;
}
- /**
- * @see com.ibm.sed.structuredDocument.partition.StructuredTextPartitioner#getPartitionType(com.ibm.sed.structuredDocument.ITextRegion,
- * com.ibm.sed.structuredDocument.ITextRegion)
- */
- public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, ITextRegion previousStartTagNameRegion, IStructuredDocumentRegion nextNode, ITextRegion nextEndTagNameRegion) {
- return getEmbeddedPartitioner().getPartitionTypeBetween(previousNode, previousStartTagNameRegion, nextNode, nextEndTagNameRegion);
+ public String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode) {
+ return getEmbeddedPartitioner().getPartitionTypeBetween(previousNode, nextNode);
}
- /**
- * @return
- */
private String getPartitionTypeForDocumentLanguage() {
String result;
if (fLanguage == null || fLanguage.equalsIgnoreCase("java")) { //$NON-NLS-1$
- result = IJSPPartitions.JSP_CONTENT_JAVA;
+ result = IJSPPartitionTypes.JSP_CONTENT_JAVA;
}
else if (fLanguage.equalsIgnoreCase("javascript")) { //$NON-NLS-1$
- result = IJSPPartitions.JSP_CONTENT_JAVASCRIPT;
+ result = IJSPPartitionTypes.JSP_CONTENT_JAVASCRIPT;
}
else {
- result = IJSPPartitions.JSP_SCRIPT_PREFIX + getLanguage().toUpperCase(Locale.ENGLISH);
+ result = IJSPPartitionTypes.JSP_SCRIPT_PREFIX + getLanguage().toUpperCase(Locale.ENGLISH);
}
return result;
}
@@ -454,11 +447,11 @@ public class StructuredTextPartitionerForJSP extends StructuredTextPartitioner {
String documentRegionContext = sdRegion.getType();
if (containedChildRegion != null) {
if (documentRegionContext.equals(DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) || documentRegionContext.equals(DOMJSPRegionContexts.JSP_ROOT_TAG_NAME)) {
- setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
+ setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitionTypes.JSP_DIRECTIVE);
return true;
}
if (fEnableJSPActionPartitions && isAction(sdRegion, offset)) {
- setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitions.JSP_DIRECTIVE);
+ setInternalPartition(offset, containedChildRegion.getLength(), IJSPPartitionTypes.JSP_DIRECTIVE);
return true;
}
}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitionTypes.java
index 9f14225d6d..52fe6d4f26 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitions.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/text/IJSPPartitionTypes.java
@@ -1,18 +1,15 @@
package org.eclipse.jst.jsp.core.text;
-import org.eclipse.wst.sse.core.text.IStructuredPartitions;
/**
* This interface is not intended to be implemented.
- * It defines the partitioning for JSP and all its partitions.
+ * It defines the partition types for JSP.
* Clients should reference the partition type Strings defined here directly.
*
* @since 1.0
*/
-public interface IJSPPartitions {
+public interface IJSPPartitionTypes {
- String JSP_PARTITIONING = IStructuredPartitions.STRUCTURED_PARTITIONING;
-
String JSP_DEFAULT = "org.eclipse.jst.jsp.DEFAULT_JSP"; //$NON-NLS-1$
String JSP_COMMENT = "org.eclipse.jst.jsp.JSP_COMMENT"; //$NON-NLS-1$

Back to the top