org.eclipse.m2m.atl.engine
Class AtlNbCharFile

java.lang.Object
  extended by org.eclipse.m2m.atl.engine.AtlNbCharFile

public class AtlNbCharFile
extends java.lang.Object


Field Summary
protected static java.util.logging.Logger logger
           
 
Constructor Summary
AtlNbCharFile(java.io.InputStream in)
           
 
Method Summary
 int getIndex(java.lang.String cursorPosition)
           
 int getIndexChar(int lineNumber, int column, int tabWidth)
          With the current line and index of the column this method returns the position to select in the file For example, the debugUI needs to know the index the start char and the last char of the current AtlStackFrame To compute start char and last char, AtlStackFrame calls this method
 int[] getIndexChar(java.lang.String sourceLocation)
           
 int[] getIndexChar(java.lang.String sourceLocation, int tabWidth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static java.util.logging.Logger logger
Constructor Detail

AtlNbCharFile

public AtlNbCharFile(java.io.InputStream in)
Parameters:
in -
Method Detail

getIndexChar

public int getIndexChar(int lineNumber,
                        int column,
                        int tabWidth)
With the current line and index of the column this method returns the position to select in the file For example, the debugUI needs to know the index the start char and the last char of the current AtlStackFrame To compute start char and last char, AtlStackFrame calls this method

Parameters:
lineNumber -
column -
Returns:
the position to select in the file

getIndexChar

public int[] getIndexChar(java.lang.String sourceLocation)

getIndexChar

public int[] getIndexChar(java.lang.String sourceLocation,
                          int tabWidth)
Parameters:
sourceLocation - the string representing "startLine:startColumn-endLine:endColumn" the location given by antlr (tabs are 8 chars long)
Returns:
An array of int: first element is startChar, second element is endChar.

getIndex

public int getIndex(java.lang.String cursorPosition)
Parameters:
cursorPosition - the string representing the cursor position
Returns:
computes the char start position from the string "cursorLine:cursorColumn" given by Eclipse (tabs are 4 chars long by default, but it is user-configurable)

Copyright 2007 IBM Corporation and others.
All Rights Reserved.