common.gui.blame
Class BlameModel

java.lang.Object
  extended by common.gui.blame.BlameModel

public class BlameModel
extends java.lang.Object

A data model that stores 2 lists of Strings, where indices in these list correspond to physical lines in the textArea's buffer. One list is for the BlamePane to display, and the other is for toolTips.


Constructor Summary
BlameModel()
          Default constructor.
BlameModel(org.gjt.sp.jedit.textarea.JEditTextArea textarea, java.util.List<java.lang.String> blame)
           
BlameModel(org.gjt.sp.jedit.textarea.JEditTextArea textarea, java.util.List<java.lang.String> blame, java.util.List<java.lang.String> tooltips)
           
 
Method Summary
 java.util.List<java.lang.String> getBlame()
           
 java.lang.String getItem(int index)
           
 org.gjt.sp.jedit.textarea.JEditTextArea getTextArea()
           
 java.util.List<java.lang.String> getToolTips()
           
 java.lang.String getToolTipText(int index)
           
 boolean outOfDate()
           
 void setBlame(java.util.List<java.lang.String> blame)
           
 void setOutOfDate(boolean b)
          Use this to indicate that the blame model no longer accurately represents the lines in the text area, for example, it could be that lines were added to the text area after the model was produced.
 void setTextArea(org.gjt.sp.jedit.textarea.JEditTextArea textarea)
           
 void setToolTips(java.util.List<java.lang.String> tooltips)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlameModel

public BlameModel()
Default constructor. Text area and blame should be set later.


BlameModel

public BlameModel(org.gjt.sp.jedit.textarea.JEditTextArea textarea,
                  java.util.List<java.lang.String> blame)
Parameters:
textarea - The JEditTextArea that this blame is for.
blame - A list of strings containing the blame per line in the text area. This doesn't have to be "blame", just something that is desired to be displayed for each line. There should be one item in this list for each line in the text area.

BlameModel

public BlameModel(org.gjt.sp.jedit.textarea.JEditTextArea textarea,
                  java.util.List<java.lang.String> blame,
                  java.util.List<java.lang.String> tooltips)
Parameters:
textarea - The JEditTextArea that this blame is for.
blame - A list of strings containing the blame per line in the text area. This doesn't have to be "blame", just something that is desired to be displayed for each line. There should be one item in this list for each line in the text area.
tooltips - A list of strings for tooltips, again, one per line in the text area.
Method Detail

setTextArea

public void setTextArea(org.gjt.sp.jedit.textarea.JEditTextArea textarea)

getTextArea

public org.gjt.sp.jedit.textarea.JEditTextArea getTextArea()

setBlame

public void setBlame(java.util.List<java.lang.String> blame)

getBlame

public java.util.List<java.lang.String> getBlame()

setToolTips

public void setToolTips(java.util.List<java.lang.String> tooltips)

getToolTips

public java.util.List<java.lang.String> getToolTips()

setOutOfDate

public void setOutOfDate(boolean b)
Use this to indicate that the blame model no longer accurately represents the lines in the text area, for example, it could be that lines were added to the text area after the model was produced.

Parameters:
b - true indicates the model is out of date.

outOfDate

public boolean outOfDate()

getItem

public java.lang.String getItem(int index)
Parameters:
index - A line number or other index to fetch a specific blame string.
Returns:
The blame associated with the line or index or null if the index is out of range.

getToolTipText

public java.lang.String getToolTipText(int index)
Parameters:
index - A line number or index to fetch a specific tooltip string.
Returns:
The tooltip text associated with the line or index, or null if the index is out of range.