jpov.viewer.source
Class Box

java.lang.Object
  extended byjpov.viewer.source.Box

public class Box
extends java.lang.Object

This class describes a colored information in the source text. It corresponds to an highlighted box with a associated information.

Author:
L. Burdy

Field Summary
static org.eclipse.swt.graphics.Color GREEN
          The green color.
 
Constructor Summary
Box(JpoInputStream s)
          Constructs a box from a .jpo file
 
Method Summary
 java.lang.String getCommentText()
          Returns the information associated with the box.
 int getIndex()
           
 int getLength()
           
 int getXOffset(org.eclipse.swt.custom.StyledText text)
           
 int getYOffset(org.eclipse.swt.custom.StyledText text)
           
 boolean highlightBox(ISourceCaseViewer text)
          Tries to highlight the box in the given text.
 boolean in(org.eclipse.swt.custom.StyledText text, int offset)
           
 void save(JpoOutputStream s, int index)
          Saves the box to a .jpo file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GREEN

public static org.eclipse.swt.graphics.Color GREEN
The green color.

Constructor Detail

Box

public Box(JpoInputStream s)
    throws java.io.IOException
Constructs a box from a .jpo file

Parameters:
s - The input stream associated with the .jpo file
Throws:
java.io.IOException
Method Detail

in

public boolean in(org.eclipse.swt.custom.StyledText text,
                  int offset)

getXOffset

public int getXOffset(org.eclipse.swt.custom.StyledText text)

getYOffset

public int getYOffset(org.eclipse.swt.custom.StyledText text)

save

public void save(JpoOutputStream s,
                 int index)
          throws java.io.IOException
Saves the box to a .jpo file.

Parameters:
s - The output stream of the .jpo file
Throws:
java.io.IOException

highlightBox

public boolean highlightBox(ISourceCaseViewer text)
Tries to highlight the box in the given text.

Parameters:
text - The current source code text.
Returns:
true if the box is a valid box for the current and if it corresponds to blue or red information, false otherwise

getCommentText

public java.lang.String getCommentText()
Returns the information associated with the box.

Returns:
the displayed information corresponding to the comment index plus the additionnal information if it exists.

getLength

public int getLength()
Returns:

getIndex

public int getIndex()
Returns: