diff options
Diffstat (limited to 'bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text')
11 files changed, 0 insertions, 1134 deletions
diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java deleted file mode 100644 index 97d4ef68a3..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocument.java +++ /dev/null @@ -1,218 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.text.IDocumentExtension; -import org.eclipse.wst.sse.core.internal.encoding.EncodingMemento; -import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser; -import org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument; -import org.eclipse.wst.sse.core.internal.provisional.events.IModelAboutToBeChangedListener; -import org.eclipse.wst.sse.core.internal.provisional.events.IStructuredDocumentListener; -import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent; -import org.eclipse.wst.sse.core.internal.undo.IStructuredTextUndoManager; - - -/** - * A IStructuredDocument is a collection of StructuredDocumentRegions. It's - * often called "flat" because its contents by design do not contain much - * structural information beyond containment. Clients should not implement. - */ -public interface IStructuredDocument extends IEncodedDocument, IDocumentExtension, IAdaptable { - - void addDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener); - - /** - * The StructuredDocumentListeners and ModelChangedListeners are very - * similar. They both receive identical events. The difference is the - * timing. The "pure" StructuredDocumentListeners are notified after the - * structuredDocument has been changed, but before other, related models - * may have been changed such as the Structural Model. The Structural - * model is in fact itself a "pure" StructuredDocumentListner. The - * ModelChangedListeners can rest assured that all models and data have - * been updated from the change by the tiem they are notified. This is - * especially important for the text widget, for example, which may rely - * on both structuredDocument and structural model information. - */ - void addDocumentChangedListener(IStructuredDocumentListener listener); - - /** - * The StructuredDocumentListeners and ModelChangedListeners are very - * similar. They both receive identical events. The difference is the - * timing. The "pure" StructuredDocumentListeners are notified after the - * structuredDocument has been changed, but before other, related models - * may have been changed such as the Structural Model. The Structural - * model is in fact itself a "pure" StructuredDocumentListner. The - * ModelChangedListeners can rest assured that all models and data have - * been updated from the change by the tiem they are notified. This is - * especially important for the text widget, for example, which may rely - * on both structuredDocument and structural model information. - */ - void addDocumentChangingListener(IStructuredDocumentListener listener); - - /** - * this API ensures that any portion of the document within startOff to - * length is not readonly (that is, that its editable). Note that if the - * range overlaps with other readonly regions, those other readonly - * regions will be adjusted. - * - * @param startOffset - * @param length - */ - void clearReadOnly(int startOffset, int length); - - /** - * returns true if any portion of startOffset to length is readonly - * - * @param startOffset - * @param length - * @return - */ - boolean containsReadOnly(int startOffset, int length); - - /** - * This method is to remember info about the encoding When the resource - * was last loaded or saved. Note: it is not kept "current", that is, can - * not be depended on blindly to reflect what encoding to use. For that, - * must go through the normal rules expressed in Loaders and Dumpers. - */ - - EncodingMemento getEncodingMemento(); - - org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getFirstStructuredDocumentRegion(); - - org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion getLastStructuredDocumentRegion(); - - /** - * This can be considered the preferred delimiter. - */ - public String getLineDelimiter(); - - int getLineOfOffset(int offset); // throws SourceEditingException; - - /** - * The parser is now required on constructor, so there are occasions it - * needs to be retrieved, such as to be initialized by EmbeddedContentType - */ - RegionParser getParser(); - - /** - * @deprecated use getStructuredDocumentRegions() - * @return - */ - IStructuredDocumentRegionList getRegionList(); - - /** - * Returns the <code>IStructuredDocumentRegion</code> at the given character offset. - * @param offset - * @return the <code>IStructuredDocumentRegion</code> at the given character offset. - */ - IStructuredDocumentRegion getRegionAtCharacterOffset(int offset); - - /** - * Returns <code>IStructuredDocumentRegion</code>s in the specified range. - * @param offset - * @param length - * @return <code>IStructuredDocumentRegion</code>s in the specified range. - */ - IStructuredDocumentRegion[] getStructuredDocumentRegions(int offset, int length); - - /** - * Returns all <code>IStructuredDocumentRegion</code>s in the document. - * @return all <code>IStructuredDocumentRegion</code>s in the document. - */ - IStructuredDocumentRegion[] getStructuredDocumentRegions(); - - /** - * Note: this method was made public, and part of the interface, for - * easier testing. Clients normally never manipulate the reparser directly - * (nor should they need to). - */ - IStructuredTextReParser getReParser(); - - String getText(); - - IStructuredTextUndoManager getUndoManager(); - - /** - * causes that portion of the document from startOffset to length to be - * marked as readonly. Note that if this range overlaps with some other - * region with is readonly, the regions are effectivly combined. - * - * @param startOffset - * @param length - */ - void makeReadOnly(int startOffset, int length); - - /** - * newInstance is similar to clone, except it contains no data. One - * important thing to duplicate is the parser, with the parser correctly - * "cloned", including its tokeninzer, block tags, etc. - * - * NOTE: even after obtaining a 'newInstance' the client may have to do - * some initialization, for example, it may need to add its own model - * listeners. Or, as another example, if the IStructuredDocument has a - * parser of type StructuredDocumentRegionParser, then the client may need - * to add its own StructuredDocumentRegionHandler to that parser, if it is - * in fact needed. - */ - IStructuredDocument newInstance(); - - void removeDocumentAboutToChangeListener(IModelAboutToBeChangedListener listener); - - void removeDocumentChangedListener(IStructuredDocumentListener listener); - - void removeDocumentChangingListener(IStructuredDocumentListener listener); - - /** - * One of the APIs to manipulate the IStructuredDocument. - * - * replaceText replaces the text from oldStart to oldEnd with the new text - * found in the requestedChange string. If oldStart and oldEnd are equal, - * it is an insertion request. If requestedChange is null (or empty) it is - * a delete request. Otherwise it is a replace request. - */ - StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange); - - /** - * Note, same as replaceText API, but will allow readonly areas to be - * replaced. This should seldom be called with a value of "true" for - * ignoreReadOnlySetting. One case where its ok is with undo operations - * (since, presumably, if user just did something that happended to - * involve some inserting readonly text, they should normally be allowed - * to still undo that operation. Otherwise, I can't think of a single - * example, unless its to give the user a choice, e.g. "you are about to - * overwrite read only portions, do you want to continue". - */ - StructuredDocumentEvent replaceText(Object source, int oldStart, int replacementLength, String requestedChange, boolean ignoreReadOnlySetting); - - /** - * This method is to remember info about the encoding When the resource - * was last loaded or saved. Note: it is not kept "current", that is, can - * not be depended on blindly to reflect what encoding to use. For that, - * must go through the normal rules expressed in Loaders and Dumpers. - */ - void setEncodingMemento(EncodingMemento encodingMemento); - - public void setLineDelimiter(String delimiter); - - /** - * One of the APIs to manipulate the IStructuredDocument in terms of Text. - * - * The setText method replaces all text in the model. - */ - StructuredDocumentEvent setText(Object requester, String allText); - - void setUndoManager(IStructuredTextUndoManager undoManager); - -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java deleted file mode 100644 index 8b03b2ac92..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegion.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -/** - * A ITextRegionCollection is a collection of ITextRegions. It is a structural - * unit, but a minimal one. For example, in might consist of a "start tag" but - * not a whole XML element. - */ -public interface IStructuredDocumentRegion extends ITextRegionCollection { - - /** - * Adds a text region to the end of the collection of regions contained by - * this region. It is the parsers responsibility to make sure its a - * correct region (that is, its start offset is one greater than previous - * regions end offset) - * - * For use by parsers and reparsers only. - */ - void addRegion(ITextRegion aRegion); - - /** - * Returns the structured document region that follows this one or null if - * at end of document. - * - * @return the structured document region that follows this one. - * - * ISSUE: for thread safety, this should be more restrictive. - */ - IStructuredDocumentRegion getNext(); - - /** - * Returns this regions parent document. - * - * @return this regions parent document. - */ - IStructuredDocument getParentDocument(); - - /** - * Returns the structured document region that preceeds this one or null - * if at beginning of document. - * - * @return the structured document region that follows this one. - * - * ISSUE: for thread safety, this should be more restrictive. - */ - IStructuredDocumentRegion getPrevious(); - - /** - * Returns true if this document has been deleted, and is no longer part - * of the actual structured document. This field can be used in - * multi-threaded operations, which may retrieve a long list of regions - * and be iterating through them at the same time the document is - * modified, and regions deleted. - * - * @return true if this region is no longer part of document. - */ - boolean isDeleted(); - - /** - * Returns true if this structured document region was ended "naturally" - * by syntactic rules, or if simply assumed to end so another could be - * started. - * - * @return true if region has syntactic end. - */ - boolean isEnded(); - - /** - * Tests is region is equal to this one, ignoring position offsets of - * shift. - * - * For use by parsers and reparsers only. - * - * @param region - * @param shift - * @return - */ - boolean sameAs(IStructuredDocumentRegion region, int shift); - - /** - * Tests if <code>oldRegion</code> is same as <code>newRegion</code>, - * ignoring position offsets of <code>shift</code>. - * - * ISSUE: which document region are old and new in? - * - * For use by parsers and reparsers only. - * - * @param oldRegion - * @param documentRegion - * @param newRegion - * @param shift - * @return - */ - boolean sameAs(ITextRegion oldRegion, IStructuredDocumentRegion documentRegion, ITextRegion newRegion, int shift); - - /** - * Set to true if/when this region is removed from a document, during the - * process of re-parsing. - * - * For use by parsers and reparsers only. - * - * @param deleted - */ - void setDeleted(boolean deleted); - - /** - * Set to true by parser/reparser if region deemed to end syntactically. - * - * For use by parsers and reparsers only. - * - * @param hasEnd - */ - void setEnded(boolean hasEnd); - - /** - * Sets length of region. - * - * For use by parsers and reparsers only. - */ - void setLength(int newLength); - - /** - * Assigns pointer to next region, or null if last region. - * - * For use by parsers and reparsers only. - */ - void setNext(IStructuredDocumentRegion newNext); - - /** - * Assigns parent documnet. - * - * For use by parsers and reparsers only. - */ - void setParentDocument(IStructuredDocument document); - - /** - * Assigns pointer to previous region, or null if first region. - * - * For use by parsers and reparsers only. - */ - void setPrevious(IStructuredDocumentRegion newPrevious); - - /** - * Sets start offset of region, relative to beginning of document. - * - * For use by parsers and reparsers only. - */ - void setStart(int newStart); - - - -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java deleted file mode 100644 index 734431e416..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredDocumentRegionList.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -import java.util.Enumeration; - -/** - * This is a class used to provide a list of StructuredDocumentRegions, so the - * implementation of how the list is formed can be hidden (encapsulated by - * this class). - * - * ISSUE: should extend ITextRegionList instead? - * - * @plannedfor 1.0 - * - */ -public interface IStructuredDocumentRegionList { - - /** - * Returns enumeration. - * - * @return enumeration. - */ - Enumeration elements(); - - /** - * Returns size of list. - * - * @return size of list. - */ - int getLength(); - - /** - * Returns the structured document region at index i. - * - * @param i - * index of region to return - * @return the region at specified offset. - */ - IStructuredDocumentRegion item(int i); - -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java deleted file mode 100644 index 17c2019980..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitionTypes.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -/** - * This interface is not intended to be implemented. - * It defines the partitioning for StructuredDocuments. - * Clients should reference the partition type Strings defined here directly. - * - * @deprecated use org.eclipse.wst.sse.core.internal.provisional.text.IStructuredPartitions - */ -public interface IStructuredPartitionTypes { - - String DEFAULT_PARTITION = "org.eclipse.wst.sse.ST_DEFAULT"; //$NON-NLS-1$ - String UNKNOWN_PARTITION = "org.eclipse.wst.sse.UNKNOWN_PARTITION_TYPE"; //$NON-NLS-1$ -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java deleted file mode 100644 index f7e940c2d4..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredPartitioning.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.eclipse.wst.sse.core.internal.provisional.text; - -/** - * Identifies the way that Documents are partitioned. - * - * @plannedfor 1.0 - */ -public interface IStructuredPartitioning { - - /** String to identify default partitioning*/ - String DEFAULT_STRUCTURED_PARTITIONING = "org.eclipse.wst.sse.core.default_structured_text_partitioning"; //$NON-NLS-1$ -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java deleted file mode 100644 index 9e53f8f26f..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextPartitioner.java +++ /dev/null @@ -1,86 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.wst.sse.core.internal.text.rules.IStructuredTypedRegion; - - -/** - * A partitioner interface required for handling the embedded content type - * properly. - * - * ISSUE: need to investigate necessity of these methods - * - * @plannedfor 1.0 - */ - -public interface IStructuredTextPartitioner extends IDocumentPartitioner { - - /** - * Used by JSP partitioner to ensure that the partitioner of the - * embedded content type gets to create the partition in case the specific - * classes are important. - * - * ISSUE: investigate if we really need this... - */ - IStructuredTypedRegion createPartition(int offset, int length, String partitionType); - - /** - * Returns the Default partition type for this partitioner. - * <p> - * eg: - * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code> - * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code> - * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code> - * </p> - * @see org.eclipse.wst.sse.core.text.IStructuredPartitions - * @see org.eclipse.wst.xml.core.text.IXMLPartitions - * @see org.eclipse.wst.html.core.text.IHTMLPartitions - * @see org.eclipse.wst.jsp.core.text.IJSPPartitions - * - * @return the Default partition type for this partitioner. - */ - String getDefaultPartitionType(); - - /** - * Returns the particular partition type for the given region/offset. - * <p> - * eg: - * <br><code>org.eclipse.wst.xml.core.text.IXMLPartitions.XML_DEFAULT</code> - * <br><code>org.eclipse.wst.html.core.text.IHTMLPartitions.HTML_DEFAULT</code> - * <br><code>org.eclipse.wst.jsp.core.text.IJSPPartitions.JSP_DEFAULT</code> - * </p> - * - * @param region of the IStructuredDocument - * @param offset in the IStructuredDoucment - * @return the particular partition type for the given region/offset. - */ - String getPartitionType(ITextRegion region, int offset); - - /** - * Returns the partition type String of the IStructuredDocumentRegion - * between the 2 region parameters. - * Useful for finding the partition type of a 0 length region. - * eg. - * <pre> - * <script type="text/javascript">|</script> - * </pre> - * @param previousNode - * @param nextNode - * @return the partition type of the node between previousNode and nextNode - * @deprecated move to IDocumentPartitionerExtension2 -> - * String getContentType(int offset, boolean preferOpenPartitions); - */ - String getPartitionTypeBetween(IStructuredDocumentRegion previousNode, IStructuredDocumentRegion nextNode); -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java deleted file mode 100644 index 5acdfa1e2f..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/IStructuredTextReParser.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - - -import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent; - -/** - * IStructuredTextReParser describes the characteristics and responsibilities - * for reparsing a structured document. - * - * @plannedfor 1.0 - */ -public interface IStructuredTextReParser { - - /** - * Begins the process of reparsing, by providing the information needed - * for the reparse. The reparse is actually performed when the reparse - * method is called. Will through an IllegalStateException if document as - * not be set. - * - * @param requester - * @param start - * @param lengthToReplace - * @param changes - */ - void initialize(Object requester, int start, int lengthToReplace, String changes); - - /** - * This method is provided to enable multiple threads to reparse a - * document. This is needed since the intialize method sets state - * variables that must be "in sync" with the structuredDocument. - */ - public boolean isParsing(); - - /** - * Returns a new instance of this reparser, used when cloning documents. - * - * @return a new instance of this reparser. - */ - public IStructuredTextReParser newInstance(); - - /** - * An entry point for reparsing. It needs to calculates the dirty start - * and dirty end in terms of structured document regions based on the - * start point and length of the changes, which are provided by the - * initialize method. Will through an IllegalStateException if document as - * not be set. - * - */ - public StructuredDocumentEvent reparse(); - - - - /** - * The reparser is initialized with its document, either in or shortly - * after its constructed is called. - * - * @param structuredDocument - */ - public void setStructuredDocument(IStructuredDocument newStructuredDocument); -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java deleted file mode 100644 index b1281ab82c..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegion.java +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -import org.eclipse.wst.sse.core.internal.provisional.events.StructuredDocumentEvent; - -/** - * A simple description of a bit of text (technically, a bit of a text buffer) - * that has a "type" associated with it. For example, for the XML text - * "<IMG>", the ' <' might form a region of type "open bracket" where as - * the text "IMG" might form a region of type "tag name". - * - * Note that there are three positions associated with a region, the start, - * the end, and the end of the text. The end of the region should always be - * greater than or equal to the end of the text, because the end of the text - * simply includes any white space that might follow the non-whitespace - * portion of the region. This whitespace is assumed to be ignorable except - * for reasons of maintaining it in the original document for formatting, - * appearance, etc. - * - * Follows the Prime Directives: - * - * getEnd() == getStart() + getLength() - * - * getTextEnd() == getStart() + getTextLength(); - * - * Event though 'end' and 'length' are redundant (given start), both methods - * are provided, since some parsers/implementations favor one or the other for - * efficiency. - * - * @plannedfor 1.0 - */ -public interface ITextRegion { - - /** - * Changes length of region. May be less than, equal to, or greater than - * zero. It may not, however, cause the length of the region to be less - * than or equal to zero, or an illegal argument acception may be thrown - * at runtime. - * - * For use by parsers and reparsers only. - */ - void adjustLength(int i); - - /** - * Changes start offset of region. May be less than, equal to, or greater - * than zero. It may not, however, cause the offset of the region to be - * less than zero, or an illegal argument acception may be thrown at - * runtime. - * - * For use by parsers and reparsers only. - */ - void adjustStart(int i); - - /** - * Changes text length of region. - * - * May be less than, equal to, or greater than zero. It may not, however, - * cause the text length of the region to be greater than the length of a - * region, or an illegal argument acception may be thrown at runtime. - * - * For use by parsers and reparsers only. - */ - void adjustTextLength(int i); - - /** - * Makes this regions start, length, and text length equal to the - * paremter's start, length, and text length. - * - * @param region - */ - void equatePositions(ITextRegion region); - - /** - * Returns the end offset of this region. Whether is relative to the - * document, or another region depends on the subtype. - * - * Follows the Prime Directive: getEnd() == getStart() + getLength() - * - * @return the end offset of this region. - */ - int getEnd(); - - /** - * Returns the length of the region. - * - * Follows the Prime Directive: getEnd() == getStart() + getLength() - * - * @return the length of the region. - */ - int getLength(); - - /** - * Returns the start of the region. Whether is relative to the document, - * or another region depends on the subtype. - * - * Follows the Prime Directive: getEnd() == getStart() + getLength() - * - * @return the start of the region. - */ - int getStart(); - - /** - * Returns the end offset of the text of this region. - * - * In some implementations, the "end" of the region (accessible via - * getEnd()) also contains any and all white space that may or may not be - * present after the "token" (read: relevant) part of the region. This - * method, getTextEnd(), is specific for the "token" part of the region, - * without the whitespace. - * - * @return the end offset of the text of this region. - */ - int getTextEnd(); - - /** - * Returns the length of the text of this region. - * - * The text length is equal to length if there is no white space at the - * end of a region. Otherwise it is smaller than length. - * - * @return the length of the text of this region. - */ - int getTextLength(); - - /** - * Returns the type of this region. - * - * @see regiontypes, structureddocumentregiontypes - * @return the type of this region. - */ - String getType(); - - /** - * Allows the region itself to participate in reparsing process. - * - * The region itself can decide if it can determine the appropriate event - * to return, based on the requested change. If it can not, this method - * must return null, so a "higher level" reparsing process will be given - * the oppurtunity to decide. If it returns an Event, that's it, not other - * reparsing process will get an oppurtunity to reparse. - * - * For use by parsers and reparsers only. - * - */ - StructuredDocumentEvent updateRegion(Object requester, IStructuredDocumentRegion parent, String changes, int requestStart, int lengthToReplace); - -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java deleted file mode 100644 index 08890ae4e1..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionCollection.java +++ /dev/null @@ -1,178 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -/** - * ITextRegionCollection, as its name implies, is a collection of - * ITextRegions. - * - * @plannedfor 1.0 - */ -public interface ITextRegionCollection extends ITextRegion { - - /** - * Used to determine if a region contains a particular offset, where - * offset is relative to the beginning of a document. - * - * @param offset - * @return true if offset is greater than or equal to regions start and - * less than its end offset. - */ - boolean containsOffset(int offset); - - /** - * Used to determine if a region contains a particular offset. - * - * ISSUE: I need to figure out what this is really for! (that is, how to - * describe it, or if still needed). - * - * @param offset - * @return true if offset is greater than or equal to regions start and - * less than its end offset. - */ - boolean containsOffset(ITextRegion region, int offset); - - /** - * Returns the end offset of this region, relative to beginning of - * document. - * - * For some subtypes, but not all, it is equivilent to getEnd(). - * - * @return the end offset of this region. - */ - int getEndOffset(); - - /** - * Returns the end offset, relative to the beginning of the document of - * the contained region. - * - * @param containedRegion - * @return the end offset of the contained region. - */ - int getEndOffset(ITextRegion containedRegion); - - /** - * Returns the first region of those contained by this region collection. - * - * @return the first region. - */ - ITextRegion getFirstRegion(); - - /** - * Returns the full text of this region, including whitespace. - * - * @return the full text of this region, including whitespace. - */ - String getFullText(); - - /** - * Returns the full text of the contained region, including whitespace. - * - * @return the full text of the contained region, including whitespace. - */ - String getFullText(ITextRegion containedRegion); - - /** - * Returns the last region of those contained by this region collection. - * - * @return the last region. - */ - ITextRegion getLastRegion(); - - /** - * Returns the number of regions contained by this region. - * - * @return the number of regions contained by this region. - */ - int getNumberOfRegions(); - - /** - * Returns the region that contains offset. In the case of "nested" - * regions, returns the top most region. - * - * @param offset - * relative to beginning of document. - * @return the region that contains offset. In the case of "nested" - * regions, returns the top most region. - */ - ITextRegion getRegionAtCharacterOffset(int offset); - - /** - * Returns the regions contained by this region. - * - * Note: no assumptions should be made about the object identity of the - * regions returned. Put another way, due to memory use optimizations, - * even if the underlying text has not changed, the regions may or may not - * be the same ones returned from one call to the next. - * - * @return the regions contained by this region. - */ - ITextRegionList getRegions(); - - /** - * Returns the start offset of this region, relative to the beginning of - * the document. - * - * @return the start offset of this region - */ - int getStartOffset(); - - /** - * Returns the start offset of the contained region, relative to the - * beginning of the document. - * - * @return the start offset of the contained region - */ - int getStartOffset(ITextRegion containedRegion); - - /** - * Returns the text of this region, not including white space. - * - * @return the text of this region, not including white space. - */ - String getText(); - - /** - * Returns the text of the contained region, not including white space. - * - * @return the text of the contained region, not including white space. - */ - String getText(ITextRegion containedRegion); - - /** - * Returns the end offset of the text of this region, not including white - * space. - * - * @return the end offset of the text of this region, not including white - * space. - */ - int getTextEndOffset(); - - /** - * Returns the end offset of the text of the contained region, not - * including white space. - * - * @return the end offset of the text of the contained region, not - * including white space. - */ - int getTextEndOffset(ITextRegion containedRegion); - - /** - * Assigns the collection contained in this region. - * - * For use by parsers and reparsers only. - * - * @param containedRegions - */ - void setRegions(ITextRegionList containedRegions); -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java deleted file mode 100644 index 654ca8116e..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionContainer.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -/** - * ITextRegionContainer contains other regions, like a ITextRegionCollection - * but is itself a region in an ITextRegionCollection, so its "parent" region - * is maintained. - * - * @plannedfor 1.0 - */ -public interface ITextRegionContainer extends ITextRegionCollection { - - /** - * Returns the parent region. - * - * @return the parent region. - */ - ITextRegionCollection getParent(); - - /** - * Sets the parent region. - * - * For use by parsers and reparsers only. - * - * @param parent - * the ITextRegionCollection this region is contained in. - */ - void setParent(ITextRegionCollection parent); -} diff --git a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java b/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java deleted file mode 100644 index c0e46d6081..0000000000 --- a/bundles/org.eclipse.wst.sse.core/src/org/eclipse/wst/sse/core/internal/provisional/text/ITextRegionList.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Jens Lukowski/Innoopract - initial renaming/restructuring - * - *******************************************************************************/ -package org.eclipse.wst.sse.core.internal.provisional.text; - -import java.util.Iterator; - -/** - * ITextRegionList is to provide a list of regions. It can be used so clients - * do not need to be aware of underlying implementation. - */ -public interface ITextRegionList { - - /** - * Adds region to the list. - * - * For use by parsers and reparsers only, while list is being created. - * - * @param region - * @return - */ - public boolean add(ITextRegion region); - - /** - * Adds new regions to the list. - * - * For use by parsers and reparsers only, while list is being created. - * - * @param insertPos - * @param newRegions - * @return - */ - public boolean addAll(int insertPos, ITextRegionList newRegions); - - /** - * Removes all regions from the list. - * - * For use by parsers and reparsers only, while list is being created. - * - */ - public void clear(); - - - /** - * Returns the region at <code>index</code>, where 0 is first one in - * the list. Throws an <code>ArrayIndexOutOfBoundsException</code> if - * list is empty, or if index is out of range. - * - * @param index - * @return - */ - public ITextRegion get(int index); - - /** - * Returns the index of <code>region</code> or -1 if <code>region</code> - * is not in the list. - * - * @param region - * @return - */ - public int indexOf(ITextRegion region); - - /** - * Returns true if list has no regions. - * - * @return true if list has no regions. - */ - public boolean isEmpty(); - - - /** - * Returns an iterator for this list. - * - * @return an iterator for this list. - */ - public Iterator iterator(); - - /** - * Removes the region at index. - * - * For use by parsers and reparsers only, while list is being created. - * - */ - public ITextRegion remove(int index); - - /** - * Removes the region. - * - * For use by parsers and reparsers only, while list is being created. - * - */ - public void remove(ITextRegion region); - - - /** - * Removes all regionList from this list. - * - * For use by parsers and reparsers only, while list is being created. - * - */ - public void removeAll(ITextRegionList regionList); - - /** - * Returns the size of the list. - * - * @return the size of the list. - */ - public int size(); - - - /** - * Creates and returns the regions in an array. No assumptions should be - * made if the regions in the array are clones are same instance of - * original region. - * - * ISSUE: do we need to specify if cloned copies or not? - * - * @return an array of regions. - */ - public ITextRegion[] toArray(); - -} |