changed names of methods to avoid compiler warning.
See 2 ISSUE: tags in javadoc of DTDNode.
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java
index 7914575..7107139 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Attribute.java
@@ -82,7 +82,7 @@
public String getDefaultKind() {
ITextRegion defaultKindRegion = getDefaultKindRegion();
if (defaultKindRegion != null) {
- return getStructuredDocumentRegion().getText(defaultKindRegion);
+ return getStructuredDTDDocumentRegion().getText(defaultKindRegion);
}
return ""; //$NON-NLS-1$
@@ -141,10 +141,10 @@
}
}
if (typeRegion != null) {
- return getStructuredDocumentRegion().getEndOffset(typeRegion);
+ return getStructuredDTDDocumentRegion().getEndOffset(typeRegion);
} else {
ITextRegion nameRegion = getNameRegion();
- return getStructuredDocumentRegion().getEndOffset(nameRegion);
+ return getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
// // create one
// typeRegion =
// findOrCreateTypeRegion((String)typeHash.get(CDATA));
@@ -158,7 +158,7 @@
if (type == null) {
// just return the text of the type region since this may be
// an entity representing the type;
- return getStructuredDocumentRegion().getText(region);
+ return getStructuredDTDDocumentRegion().getText(region);
}
return type;
} else if (getEnumList() != null) {
@@ -185,7 +185,7 @@
public String getValueFromQuotedRegion(ITextRegion region) {
String type = region.getType();
if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDocumentRegion().getText(region);
+ String text = getStructuredDTDDocumentRegion().getText(region);
return text.substring(1, text.length() - 1);
}
return ""; //$NON-NLS-1$
@@ -198,7 +198,7 @@
while (iter.hasNext()) {
ITextRegion currentRegion = iter.next();
if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- enumList = new AttributeEnumList(getDTDFile(), getStructuredDocumentRegion());
+ enumList = new AttributeEnumList(getDTDFile(), getStructuredDTDDocumentRegion());
}
if (enumList != null) {
enumList.addRegion(currentRegion);
@@ -213,14 +213,14 @@
public void setDefaultKind(Object requestor, String kind) {
ITextRegion defaultKindRegion = getDefaultKindRegion();
- String oldDefaultKind = defaultKindRegion == null ? "" : getStructuredDocumentRegion().getText(defaultKindRegion); //$NON-NLS-1$
+ String oldDefaultKind = defaultKindRegion == null ? "" : getStructuredDTDDocumentRegion().getText(defaultKindRegion); //$NON-NLS-1$
if (!kind.equals(oldDefaultKind)) {
String newText = kind;
int startOffset = 0;
int length = 0;
if (defaultKindRegion != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(defaultKindRegion);
- length = getStructuredDocumentRegion().getEndOffset(defaultKindRegion) - startOffset;
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
+ length = getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) - startOffset;
} else {
startOffset = getOffsetAfterType();
newText = " " + newText; //$NON-NLS-1$
@@ -236,7 +236,7 @@
}
} else {
if (defaultValue != null) {
- length = getStructuredDocumentRegion().getEndOffset(defaultValue) - startOffset;
+ length = getStructuredDTDDocumentRegion().getEndOffset(defaultValue) - startOffset;
}
}
replaceText(requestor, startOffset, length, newText);
@@ -265,14 +265,14 @@
}
if (defaultValue != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(defaultValue);
- endOffset = getStructuredDocumentRegion().getEndOffset(defaultValue);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultValue);
+ endOffset = getStructuredDTDDocumentRegion().getEndOffset(defaultValue);
}
ITextRegion defaultKindRegion = getDefaultKindRegion();
if (defaultKindRegion != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(defaultKindRegion);
- endOffset = endOffset == 0 ? getStructuredDocumentRegion().getEndOffset(defaultKindRegion) : endOffset;
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(defaultKindRegion);
+ endOffset = endOffset == 0 ? getStructuredDTDDocumentRegion().getEndOffset(defaultKindRegion) : endOffset;
} else {
if (startOffset == 0) {
endOffset = startOffset = getOffsetAfterType();
@@ -326,14 +326,14 @@
ITextRegion region = getTypeRegion();
if (region != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(region);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
if (endOffset == 0) {
- endOffset = getStructuredDocumentRegion().getEndOffset(region);
+ endOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
}
} else if (startOffset == 0) {
ITextRegion nameRegion = getNameRegion();
newText += " "; //$NON-NLS-1$
- endOffset = startOffset = getStructuredDocumentRegion().getEndOffset(nameRegion);
+ endOffset = startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
}
String newTypeWord = (String) typeHash.get(type);
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java
index 635c001..4df1d7c 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeEnumList.java
@@ -42,7 +42,7 @@
while (iter.hasNext()) {
ITextRegion name = getNextRegion(iter, DTDRegionTypes.NAME);
if (name != null) {
- list.add(getStructuredDocumentRegion().getText(name));
+ list.add(getStructuredDTDDocumentRegion().getText(name));
}
}
return list;
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java
index b52422c..f798382 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/AttributeList.java
@@ -35,7 +35,7 @@
} else {
ITextRegion nameRegion = getNameRegion();
if (nameRegion != null) {
- replaceText(this, getStructuredDocumentRegion().getEndOffset(nameRegion), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
+ replaceText(this, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, "\n\t" + name + " CDATA #IMPLIED"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@@ -86,7 +86,7 @@
while (iter.hasNext()) {
ITextRegion currentRegion = iter.next();
if (currentRegion.getType().equals(DTDRegionTypes.ATTRIBUTE_NAME)) {
- attribute = new Attribute(getDTDFile(), getStructuredDocumentRegion());
+ attribute = new Attribute(getDTDFile(), getStructuredDTDDocumentRegion());
children.add(attribute);
appendChild(attribute);
trailingWhitespace = false;
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java
index e242136..daed03a 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMGroupNode.java
@@ -100,7 +100,7 @@
// note that this stream includes the last region of the first
// sibling and the first region of the next sibling.
// both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
+ RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
// stream.setFirstRegion(childA.getLastRegion());
// stream.setLastRegion(childB.getFirstRegion());
// Iterator iter = stream.iterator();
@@ -111,7 +111,7 @@
while (iter.hasNext() && currentRegion != childB.getStartRegion()) {
currentRegion = iter.next();
if (currentRegion.getType() == DTDRegionTypes.CONNECTOR) {
- connector = getStructuredDocumentRegion().getText(currentRegion).charAt(0);
+ connector = getStructuredDTDDocumentRegion().getText(currentRegion).charAt(0);
return connector;
}
}
@@ -260,7 +260,7 @@
if (nesting == 0) {
if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
currentGroupNode = currentReferenceNode = null;
- DTDNode pcData = new CMBasicNode(getDTDFile(), getStructuredDocumentRegion());
+ DTDNode pcData = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
pcData.addRegion(currentRegion);
appendChild(pcData);
// children.add(pcData);
@@ -268,7 +268,7 @@
// we have hit a new reference node. Make sure we reset
// the groupnode var so it doesn't collect more regions
currentGroupNode = null;
- currentReferenceNode = new CMBasicNode(getDTDFile(), getStructuredDocumentRegion());
+ currentReferenceNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
currentReferenceNode.addRegion(currentRegion);
appendChild(currentReferenceNode);
// children.add(currentReferenceNode);
@@ -292,7 +292,7 @@
// referencenode var so it doesn't collect any more
// regions
currentReferenceNode = null;
- currentGroupNode = new CMGroupNode(getDTDFile(), getStructuredDocumentRegion());
+ currentGroupNode = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
appendChild(currentGroupNode);
// children.add(currentGroupNode);
}
@@ -383,7 +383,7 @@
// note that this stream includes the last region of the first
// sibling and the first region of the next sibling.
// both these should be ignored
- RegionIterator iter = new RegionIterator(getStructuredDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
+ RegionIterator iter = new RegionIterator(getStructuredDTDDocumentRegion(), childA.getEndOffset(), childB.getStartOffset());
// skip the first region which is the last region of childA
// do we still need this
@@ -397,7 +397,7 @@
// Region oldRegion = currentRegion.createCopy();
// found a connector! on to the next sibling pair
// currentRegion.updateText(String.valueOf(v));
- replaceText(this, getStructuredDocumentRegion().getStartOffset(currentRegion), 1, String.valueOf(connector));
+ replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(currentRegion), 1, String.valueOf(connector));
//changeStructuredDocument(oldRegion, currentRegion);
break;
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java
index be37d13..2c7f94a 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/CMRepeatableNode.java
@@ -38,7 +38,7 @@
public char getOccurrence() {
ITextRegion occurRegion = getOccurrenceRegion();
if (occurRegion != null && occurRegion.getType() == DTDRegionTypes.OCCUR_TYPE) {
- return getStructuredDocumentRegion().getText(occurRegion).charAt(0);
+ return getStructuredDTDDocumentRegion().getText(occurRegion).charAt(0);
}
return CMRepeatableNode.ONCE;
}
@@ -61,16 +61,16 @@
if (occurrence == CMRepeatableNode.ONCE) {
// we need to remove the occur region from the flat
// model;
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDocumentRegion().getStartOffset(region), 1, ""); //$NON-NLS-1$
+ getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, ""); //$NON-NLS-1$
} else {
// Region oldOccur = region.createCopy();
- getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDocumentRegion().getStartOffset(region), 1, String.valueOf(occurrence));
+ getDTDFile().getStructuredDocument().replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(region), 1, String.valueOf(occurrence));
// changeStructuredDocument(oldOccur, region);
}
} else if (occurrence != CMRepeatableNode.ONCE) {
// System.out.println(getString());
// we need to create an occurrenceRegion
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(region), 0, String.valueOf(occurrence));
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(region), 0, String.valueOf(occurrence));
}
}
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java
index fa58df0..7ade3e4 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Comment.java
@@ -46,18 +46,18 @@
RegionIterator iter = iterator();
ITextRegion commentStartTag = getStartTag(iter);
ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDocumentRegion().getEndOffset();
+ pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
if (commentStartTag != null) {
- pair.startOffset = getStructuredDocumentRegion().getEndOffset(commentStartTag);
+ pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
}
if (endCommentTag != null) {
- pair.endOffset = getStructuredDocumentRegion().getStartOffset(endCommentTag);
+ pair.endOffset = getStructuredDTDDocumentRegion().getStartOffset(endCommentTag);
}
}
public String getText() {
- String text = getStructuredDocumentRegion().getText();
- int flatNodeStart = getStructuredDocumentRegion().getStartOffset();
+ String text = getStructuredDTDDocumentRegion().getText();
+ int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
StartEndPair pair = new StartEndPair();
getStartAndEndOffsetForText(pair);
return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
@@ -65,7 +65,7 @@
public void setText(String newText) {
beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_COMMENT_CHG")); //$NON-NLS-1$
- int flatNodeStart = getStructuredDocumentRegion().getStartOffset();
+ int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
StartEndPair pair = new StartEndPair();
getStartAndEndOffsetForText(pair);
replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java
index 2e6b0bb..e6bd264 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDFile.java
@@ -271,14 +271,14 @@
if (node != null) {
if (isAfter) {
// then get the next node and use it's start offset
- int index = getNodes().indexOf(getNode(node.getStructuredDocumentRegion()));
+ int index = getNodes().indexOf(getNode(node.getStructuredDTDDocumentRegion()));
DTDNode afterNode = null;
if (index + 1 < getNodes().size()) {
afterNode = (DTDNode) getNodes().get(index + 1);
}
if (afterNode != null) {
- offset = afterNode.getStructuredDocumentRegion().getStartOffset();
+ offset = afterNode.getStructuredDTDDocumentRegion().getStartOffset();
} else {
// add to end
if (getStructuredDocument().getLastStructuredDocumentRegion() != null) {
@@ -286,7 +286,7 @@
}
}
} else {
- offset = node.getStructuredDocumentRegion().getStartOffset();
+ offset = node.getStructuredDTDDocumentRegion().getStartOffset();
}
} else {
// add to end
@@ -305,7 +305,7 @@
public DTDNode getNode(IStructuredDocumentRegion flatNode) {
for (int i = 0; i < nodeList.size(); i++) {
DTDNode node = (DTDNode) nodeList.get(i);
- if (node.getStructuredDocumentRegion() == flatNode) {
+ if (node.getStructuredDTDDocumentRegion() == flatNode) {
return node;
}
}
@@ -485,7 +485,7 @@
}
boolean isSameTopLevelType(DTDNode affectedNode) {
- IStructuredDocumentRegion flatNode = affectedNode.getStructuredDocumentRegion();
+ IStructuredDocumentRegion flatNode = affectedNode.getStructuredDTDDocumentRegion();
// return true if the flatnode still matches what the affectedNode
// is representing
if (affectedNode instanceof Element && isElement(flatNode)) {
@@ -543,7 +543,7 @@
for (Iterator iter = getNodes().iterator(); iter.hasNext();) {
DTDNode node = (DTDNode) iter.next();
- if (node.getStructuredDocumentRegion() == flatNode) {
+ if (node.getStructuredDTDDocumentRegion() == flatNode) {
removedDTDNodes.add(node);
}
}
@@ -593,7 +593,7 @@
// System.out.println("rebuilding " +
// dtdNode.getStructuredDocumentRegion().getText());
- DTDNode node = buildNode(dtdNode.getStructuredDocumentRegion());
+ DTDNode node = buildNode(dtdNode.getStructuredDTDDocumentRegion());
if (node != null) {
addedDTDNodes.add(node);
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java
index 8edc3e4..a51b6b9 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/DTDNode.java
@@ -58,7 +58,7 @@
}
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException {
- // System.out.println("appendchild called with " + newChild);
+ // System.out.println("appendchild called with " + newChild);
return super.appendChild(newChild);
}
@@ -146,11 +146,11 @@
}
public int getEndOffset() {
- return getStructuredDocumentRegion().getEndOffset(getEndRegion());
+ return getStructuredDTDDocumentRegion().getEndOffset(getEndRegion());
}
public ITextRegion getEndRegion() {
- return regions.get(regions.size() - 1);//endRegion;
+ return regions.get(regions.size() - 1);// endRegion;
}
/**
@@ -175,7 +175,7 @@
RegionIterator iter = new RegionIterator(whitespace);
while (iter.hasNext()) {
ITextRegion region = iter.next();
- text += getStructuredDocumentRegion().getText(region);
+ text += getStructuredDTDDocumentRegion().getText(region);
}
}
return text;
@@ -186,7 +186,7 @@
public String getName() {
ITextRegion region = getNameRegion();
if (region != null) {
- return getStructuredDocumentRegion().getText(region);
+ return getStructuredDTDDocumentRegion().getText(region);
}
return ""; //$NON-NLS-1$
}
@@ -227,7 +227,7 @@
RegionIterator iter = iterator();
while (iter.hasNext()) {
ITextRegion region = iter.next();
- sb.append(getStructuredDocumentRegion().getText(region));
+ sb.append(getStructuredDTDDocumentRegion().getText(region));
}
return sb.toString();
}
@@ -237,21 +237,25 @@
}
public int getStartOffset() {
- return getStructuredDocumentRegion().getStartOffset(getStartRegion());
+ return getStructuredDTDDocumentRegion().getStartOffset(getStartRegion());
}
- // private Region startRegion,endRegion;
+ // private Region startRegion,endRegion;
public ITextRegion getStartRegion() {
return regions.get(0);
- // return startRegion;
+ // return startRegion;
}
/**
* Get the value of flatNode.
*
* @return value of flatNode.
+ *
+ * ISSUE:named changed not to be confused with default access protected
+ * super class method, but should re-think if this is correct technique.
+ * Perhaps getFirstRegion?
*/
- public IStructuredDocumentRegion getStructuredDocumentRegion() {
+ public IStructuredDocumentRegion getStructuredDTDDocumentRegion() {
return flatNode;
}
@@ -260,7 +264,7 @@
public int getWhitespaceEndOffset() {
if (whitespace.size() > 0) {
ITextRegion region = whitespace.get(whitespace.size() - 1);
- return getStructuredDocumentRegion().getEndOffset(region);
+ return getStructuredDTDDocumentRegion().getEndOffset(region);
}
return getEndOffset();
@@ -271,7 +275,7 @@
}
public RegionIterator iterator() {
- // System.out.println("create region iter " + this.getClass() + " with
+ // System.out.println("create region iter " + this.getClass() + " with
// start , end = " + getStartOffset() + ", " +getEndOffset());
return new RegionIterator(regions);
}
@@ -287,9 +291,9 @@
if (!getName().equals(name)) {
ITextRegion nameRegion = getNameRegion();
if (nameRegion != null) {
- // nameToken.updateText(name);
+ // nameToken.updateText(name);
getDTDFile().getDTDModel().getReferenceUpdater().nameAboutToChange(requestor, this, name);
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(nameRegion), nameRegion.getLength(), name);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(nameRegion), nameRegion.getLength(), name);
}
}
}
@@ -304,9 +308,11 @@
* Set the value of flatNode.
*
* @param v
- * Value to assign to flatNode.
+ * Value to assign to flatNode. ISSUE:named changed not to be
+ * confused with default access protected super class method,
+ * but should re-think if this is correct technique
*/
- public void setStructuredDocumentRegion(IStructuredDocumentRegion v) {
+ void setStructuredDTDDocumentRegion(IStructuredDocumentRegion v) {
this.flatNode = v;
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java
index 492cd71..f8f9d93 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Element.java
@@ -61,15 +61,15 @@
int startOffset = 0;
int length = 0;
if (whitespace != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(whitespace);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(whitespace);
length = whitespace.getLength() >= 2 ? 1 : 0;
} else {
ITextRegion nameRegion = getNameRegion();
if (nameRegion != null) {
- startOffset = getStructuredDocumentRegion().getEndOffset(nameRegion);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(nameRegion);
} else {
ITextRegion elementTag = getNextRegion(iterator(), DTDRegionTypes.ELEMENT_TAG);
- startOffset = getStructuredDocumentRegion().getEndOffset(elementTag);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(elementTag);
}
}
replaceText(requestor, startOffset, length, content);
@@ -159,11 +159,11 @@
if (contentModel == null) {
if (currentRegion.getType().equals(DTDRegionTypes.NAME)) {
- contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDocumentRegion());
+ contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
} else if (currentRegion.getType().equals(DTDRegionTypes.CONTENT_PCDATA)) {
- contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDocumentRegion());
+ contentModel = basicNode = new CMBasicNode(getDTDFile(), getStructuredDTDDocumentRegion());
} else if (currentRegion.getType().equals(DTDRegionTypes.LEFT_PAREN)) {
- contentModel = new CMGroupNode(getDTDFile(), getStructuredDocumentRegion());
+ contentModel = new CMGroupNode(getDTDFile(), getStructuredDTDDocumentRegion());
}
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java
index ff93bf7..b3445e2 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Entity.java
@@ -45,7 +45,7 @@
public String getNotationName() {
ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
if (ndataRegion != null) {
- return getStructuredDocumentRegion().getText(ndataRegion);
+ return getStructuredDTDDocumentRegion().getText(ndataRegion);
}
return ""; //$NON-NLS-1$
}
@@ -94,15 +94,15 @@
ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_KEYWORD);
int startOffset = 0, endOffset = 0;
if (ndataRegion != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(ndataRegion);
- endOffset = getStructuredDocumentRegion().getEndOffset(ndataRegion);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(ndataRegion);
+ endOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataRegion);
}
ITextRegion value = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
if (value != null) {
if (startOffset == 0) {
- startOffset = getStructuredDocumentRegion().getStartOffset(value);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(value);
}
- endOffset = getStructuredDocumentRegion().getEndOffset(value);
+ endOffset = getStructuredDTDDocumentRegion().getEndOffset(value);
}
replaceText(requestor, startOffset, endOffset - startOffset, ""); //$NON-NLS-1$
}
@@ -124,7 +124,7 @@
quote = getNextRegion(iterator(), DTDRegionTypes.DOUBLEQUOTED_LITERAL);
}
if (quote != null) {
- replaceText(this, getStructuredDocumentRegion().getStartOffset(quote), quote.getLength(), ""); //$NON-NLS-1$
+ replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(quote), quote.getLength(), ""); //$NON-NLS-1$
}
setSystemID(""); //$NON-NLS-1$
} else {
@@ -140,14 +140,14 @@
keyword = getPublicKeywordRegion(iter);
}
if (keyword != null) {
- startOffset = getStructuredDocumentRegion().getStartOffset(keyword);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(keyword);
// start with a length just equal to the keyword for now
length = keyword.getLength();
} else {
// reset the iterator since we didn't find the keyword
iter = iterator();
// just go from after the name
- startOffset = getStructuredDocumentRegion().getEndOffset(getNameRegion());
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(getNameRegion());
}
// now that we have the start, look for the end
@@ -164,7 +164,7 @@
}
if (lastRegion != null) {
- length = getStructuredDocumentRegion().getEndOffset(lastRegion) - startOffset;
+ length = getStructuredDTDDocumentRegion().getEndOffset(lastRegion) - startOffset;
}
replaceText(this, startOffset, length, "\"\""); //$NON-NLS-1$
removeNData(this);
@@ -179,7 +179,7 @@
//
ITextRegion ndataRegion = getNextRegion(iterator(), DTDRegionTypes.NDATA_VALUE);
if (ndataRegion != null) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(ndataRegion), ndataRegion.getLength(), newNotation);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(ndataRegion), ndataRegion.getLength(), newNotation);
} else {
// time to create one
int startOffset = 0;
@@ -200,7 +200,7 @@
}
}
if (lastQuotedLiteral != null) {
- startOffset = getStructuredDocumentRegion().getEndOffset(lastQuotedLiteral);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(lastQuotedLiteral);
} else {
// created after the system or public keyword
ITextRegion keyword = getPublicKeywordRegion(iterator());
@@ -209,11 +209,11 @@
}
// we shouldn't be null here since we check if we
// were external already
- startOffset = getStructuredDocumentRegion().getEndOffset(keyword);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(keyword);
}
} else {
- startOffset = getStructuredDocumentRegion().getEndOffset(ndataKeyword);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(ndataKeyword);
}
replaceText(requestor, startOffset, 0, string + newNotation);
}
@@ -252,12 +252,12 @@
if (iter.hasNext()) {
ITextRegion region = iter.next();
- startOffset = getStructuredDocumentRegion().getStartOffset(region);
+ startOffset = getStructuredDTDDocumentRegion().getStartOffset(region);
if (region.getType() == DTDRegionTypes.WHITESPACE && region.getLength() > 1) {
length = 1;
}
} else {
- startOffset = getStructuredDocumentRegion().getEndOffset(startTag);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(startTag);
}
replaceText(this, startOffset, length, " %"); //$NON-NLS-1$
// now get rid of any NData since it is only allowed if the
@@ -266,7 +266,7 @@
} else {
// get rid of percent region
ITextRegion percentRegion = getPercentRegion();
- replaceText(this, getStructuredDocumentRegion().getStartOffset(percentRegion), percentRegion.getLength(), ""); //$NON-NLS-1$
+ replaceText(this, getStructuredDTDDocumentRegion().getStartOffset(percentRegion), percentRegion.getLength(), ""); //$NON-NLS-1$
}
endRecording(this);
@@ -286,7 +286,7 @@
ITextRegion valueRegion = getNextQuotedLiteral(iterator());
String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (valueRegion != null) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(valueRegion), valueRegion.getLength(), quoteChar + v + quoteChar);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(valueRegion), valueRegion.getLength(), quoteChar + v + quoteChar);
} else {
int startOffset = 0, length = 0;
RegionIterator iter = iterator();
@@ -301,7 +301,7 @@
}
if (region != null) {
- startOffset = getStructuredDocumentRegion().getEndOffset(region);
+ startOffset = getStructuredDTDDocumentRegion().getEndOffset(region);
replaceText(requestor, startOffset, 0, quoteChar + v + quoteChar);
}
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java
index 4fa8c5f..ec9b5da 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ExternalNode.java
@@ -120,7 +120,7 @@
public String getValueFromQuotedRegion(ITextRegion region) {
String type = region.getType();
if (type.equals(DTDRegionTypes.SINGLEQUOTED_LITERAL) || type.equals(DTDRegionTypes.DOUBLEQUOTED_LITERAL)) {
- String text = getStructuredDocumentRegion().getText(region);
+ String text = getStructuredDTDDocumentRegion().getText(region);
return text.substring(1, text.length() - 1);
}
return ""; //$NON-NLS-1$
@@ -144,30 +144,30 @@
if (publicKeyword != null) {
// time to get rid of the public keyword and value
// and replace it with the system one
- int startOffset = getStructuredDocumentRegion().getStartOffset(publicKeyword);
+ int startOffset = getStructuredDTDDocumentRegion().getStartOffset(publicKeyword);
String newString = "SYSTEM"; //$NON-NLS-1$
if (systemValue == null) {
newString += " \"\""; //$NON-NLS-1$
}
- replaceText(requestor, startOffset, getStructuredDocumentRegion().getEndOffset(publicValue) - startOffset, newString);
+ replaceText(requestor, startOffset, getStructuredDTDDocumentRegion().getEndOffset(publicValue) - startOffset, newString);
}
} else {
// here were setting a non empty value
String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if (publicValue != null) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(publicValue), publicValue.getLength(), quoteChar + publicID + quoteChar);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(publicValue), publicValue.getLength(), quoteChar + publicID + quoteChar);
} else {
// time to create stuff
if (publicKeyword != null) {
// then just put our new value after the keyword
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(publicKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
} else {
// we need the public keyword as well
if (systemKeyword != null) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(systemKeyword), systemKeyword.getLength(), "PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemKeyword), systemKeyword.getLength(), "PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
} else {
ITextRegion nameRegion = getNameRegion();
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(nameRegion), 0, " PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " PUBLIC " + quoteChar + v + quoteChar); //$NON-NLS-1$
}
}
}
@@ -200,25 +200,25 @@
String quoteChar = v.indexOf("\"") == -1 ? "\"" : "'"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
ITextRegion systemValue = getSystemValueRegion();
if (systemValue != null) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(systemValue), systemValue.getLength(), quoteChar + systemID + quoteChar);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(systemValue), systemValue.getLength(), quoteChar + systemID + quoteChar);
} else {
ITextRegion systemKeyword = getSystemKeywordRegion(iterator());
// time to create stuff
if (systemKeyword != null) {
// then just put our new value after the keyword
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(systemKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(systemKeyword), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
} else {
// see if we have a public keyword
ITextRegion publicKeyword = getPublicKeywordRegion(iterator());
if (publicKeyword == null) {
ITextRegion nameRegion = getNameRegion();
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(nameRegion), 0, " SYSTEM " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(nameRegion), 0, " SYSTEM " + quoteChar + v + quoteChar); //$NON-NLS-1$
} else {
// put it after the public value region
ITextRegion publicValueRegion = getPublicValueRegion();
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(publicValueRegion), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(publicValueRegion), 0, " " + quoteChar + v + quoteChar); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java
index 56ba63a..5967273 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/NamedTopLevelNode.java
@@ -126,7 +126,7 @@
// beginRecording(requestor, "Name Change");
String newText = " " + name; //$NON-NLS-1$
- replaceText(requestor, getStructuredDocumentRegion().getEndOffset(elementTagRegion), replaceLength, newText);
+ replaceText(requestor, getStructuredDTDDocumentRegion().getEndOffset(elementTagRegion), replaceLength, newText);
// endRecording(requestor);
}
}
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java
index 4af2336..a8b37a6 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/ParameterEntityReference.java
@@ -62,7 +62,7 @@
}
public String getName() {
- return getStructuredDocumentRegion().getText();
+ return getStructuredDTDDocumentRegion().getText();
}
public String getReferencedEntity() {
@@ -74,25 +74,25 @@
RegionIterator iter = iterator();
ITextRegion commentStartTag = getStartTag(iter);
ITextRegion endCommentTag = getNextRegion(iter, DTDRegionTypes.COMMENT_END);
- pair.endOffset = getStructuredDocumentRegion().getEndOffset();
+ pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset();
if (commentStartTag != null) {
- pair.startOffset = getStructuredDocumentRegion().getEndOffset(commentStartTag);
+ pair.startOffset = getStructuredDTDDocumentRegion().getEndOffset(commentStartTag);
}
if (endCommentTag != null) {
- pair.endOffset = getStructuredDocumentRegion().getEndOffset(endCommentTag);
+ pair.endOffset = getStructuredDTDDocumentRegion().getEndOffset(endCommentTag);
}
}
public String getText() {
- String text = getStructuredDocumentRegion().getText();
- int flatNodeStart = getStructuredDocumentRegion().getStartOffset();
+ String text = getStructuredDTDDocumentRegion().getText();
+ int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
StartEndPair pair = new StartEndPair();
getStartAndEndOffsetForText(pair);
return text.substring(pair.startOffset - flatNodeStart, pair.endOffset - flatNodeStart);
}
public void setReferencedEntity(Object requestor, String name) {
- replaceText(requestor, getStructuredDocumentRegion().getStartOffset(), getStructuredDocumentRegion().getLength(), "%" + name + ";"); //$NON-NLS-1$ //$NON-NLS-2$
+ replaceText(requestor, getStructuredDTDDocumentRegion().getStartOffset(), getStructuredDTDDocumentRegion().getLength(), "%" + name + ";"); //$NON-NLS-1$ //$NON-NLS-2$
}
public void setReferencedEntity(String name) {
@@ -103,7 +103,7 @@
public void setText(String newText) {
beginRecording(this, DTDPlugin.getDTDString("_UI_LABEL_PARM_ENTITY_REF_COMMENT_CHG")); //$NON-NLS-1$
- int flatNodeStart = getStructuredDocumentRegion().getStartOffset();
+ int flatNodeStart = getStructuredDTDDocumentRegion().getStartOffset();
StartEndPair pair = new StartEndPair();
getStartAndEndOffsetForText(pair);
replaceText(this, pair.startOffset, pair.endOffset - pair.startOffset, newText);
diff --git a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java
index 0ca7997..bf9aa36 100644
--- a/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java
+++ b/bundles/org.eclipse.wst.dtd.core/src/org/eclipse/wst/dtd/core/Unrecognized.java
@@ -27,7 +27,7 @@
}
public String getName() {
- String text = getStructuredDocumentRegion().getText();
+ String text = getStructuredDTDDocumentRegion().getText();
if (text.length() <= 30) {
return text;
} else {