org.eclipse.xtext.ui.editor.syntaxcoloring
Class AttributedPosition

java.lang.Object
  extended by org.eclipse.jface.text.Position
      extended by org.eclipse.xtext.ui.editor.syntaxcoloring.AttributedPosition

public class AttributedPosition
extends org.eclipse.jface.text.Position


Field Summary
 
Fields inherited from class org.eclipse.jface.text.Position
isDeleted, length, offset
 
Constructor Summary
AttributedPosition(int offset, int length, org.eclipse.jface.text.TextAttribute attribute, java.lang.Object lock)
          Initialize the position with the given offset, length and foreground color.
 
Method Summary
 org.eclipse.swt.custom.StyleRange createStyleRange()
           
 void delete()
          Marks this position as deleted.
 org.eclipse.jface.text.TextAttribute getHighlighting()
           
 boolean isContained(int off, int len)
          Is this position contained in the given range (inclusive)?
 boolean isEqual(int off, int len, org.eclipse.jface.text.TextAttribute other)
          Uses reference equality for the highlighting.
 void setLength(int length)
          Changes the length of this position to the given length.
 void setOffset(int offset)
          Changes the offset of this position to the given offset.
 void undelete()
          Marks this position as not deleted.
 void update(int off, int len)
           
 
Methods inherited from class org.eclipse.jface.text.Position
equals, getLength, getOffset, hashCode, includes, isDeleted, overlapsWith, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributedPosition

public AttributedPosition(int offset,
                          int length,
                          org.eclipse.jface.text.TextAttribute attribute,
                          java.lang.Object lock)
Initialize the position with the given offset, length and foreground color.

Parameters:
offset - The position offset
length - The position length
highlighting - The position's highlighting
lock - The lock object
Method Detail

createStyleRange

public org.eclipse.swt.custom.StyleRange createStyleRange()
Returns:
Returns a corresponding style range.

isEqual

public boolean isEqual(int off,
                       int len,
                       org.eclipse.jface.text.TextAttribute other)
Uses reference equality for the highlighting.

Parameters:
off - The offset
len - The length
highlighting - The highlighting
Returns:
true iff the given offset, length and highlighting are equal to the internal ones.

isContained

public boolean isContained(int off,
                           int len)
Is this position contained in the given range (inclusive)? Synchronizes on position updater.

Parameters:
off - The range offset
len - The range length
Returns:
true iff this position is not delete and contained in the given range.

update

public void update(int off,
                   int len)

setLength

public void setLength(int length)
Description copied from class: org.eclipse.jface.text.Position
Changes the length of this position to the given length.

Overrides:
setLength in class org.eclipse.jface.text.Position
Parameters:
length - the new length of this position

setOffset

public void setOffset(int offset)
Description copied from class: org.eclipse.jface.text.Position
Changes the offset of this position to the given offset.

Overrides:
setOffset in class org.eclipse.jface.text.Position
Parameters:
offset - the new offset of this position

delete

public void delete()
Description copied from class: org.eclipse.jface.text.Position
Marks this position as deleted.

Overrides:
delete in class org.eclipse.jface.text.Position

undelete

public void undelete()
Description copied from class: org.eclipse.jface.text.Position
Marks this position as not deleted.

Overrides:
undelete in class org.eclipse.jface.text.Position

getHighlighting

public org.eclipse.jface.text.TextAttribute getHighlighting()
Returns:
Returns the highlighting.