// calculate selected range
int[] range = null;
if ( part instanceof LdifValueLineBase )
{
LdifValueLineBase line = ( LdifValueLineBase ) part;
range = getRange( relativePos, part.getOffset(), new String[]
{ line.getRawLineStart(), line.getRawValueType(), line.getRawValue() } );
}
else if ( part instanceof LdifLineBase )
{
LdifLineBase line = ( LdifLineBase ) part;
range = new int[]
{ part.getOffset(), part.getLength() - line.getRawNewLine().length() };
}
// set range on viewer, add global offset
int start = range != null ? range[OFFSET] : part.getOffset();
start += offset;