de.folt.models.applicationmodel.guimodel.editor.datasourceeditor
Class OpenTMSStyleRange

java.lang.Object
  extended by org.eclipse.swt.graphics.TextStyle
      extended by org.eclipse.swt.custom.StyleRange
          extended by de.folt.models.applicationmodel.guimodel.editor.datasourceeditor.OpenTMSStyleRange
All Implemented Interfaces:
java.lang.Cloneable, org.eclipse.swt.internal.CloneableCompatibility

public class OpenTMSStyleRange
extends org.eclipse.swt.custom.StyleRange

This class extends StyleRange and add some features. Esp. it is possible to associate a tool tip with a StyledText and to add additional data (key/value) pair with the OpenTMSStyleRange.

Author:
klemens

Field Summary
 
Fields inherited from class org.eclipse.swt.custom.StyleRange
fontStyle, length, start
 
Fields inherited from class org.eclipse.swt.graphics.TextStyle
background, borderColor, borderStyle, font, foreground, metrics, rise, strikeout, strikeoutColor, underline, underlineColor, underlineStyle
 
Constructor Summary
OpenTMSStyleRange(int startPos, int len, org.eclipse.swt.graphics.Color tagForeGroundColor, org.eclipse.swt.graphics.Color tagBackGroundColor)
           
 
Method Summary
 java.util.Hashtable<java.lang.String,java.lang.Object> getData()
           
 java.lang.Object getData(java.lang.String string)
          getData get a data object associated with the OpenTMSStyleRange
 java.lang.String getToolTip()
          getToolTip get a tool tip for the OpenTMSStyleRange
 boolean isBEditable()
           
 java.lang.Object removeData(java.lang.String string)
          removeData remove a data object
 void setBEditable(boolean editable)
           
 void setData(java.util.Hashtable<java.lang.String,java.lang.Object> data)
           
 void setData(java.lang.String string)
          setData associate a string as a data for the OpenTMSStyleRange (key = string / value = string)
 void setData(java.lang.String string, java.lang.Object object)
          setData associate a data object with an OpenTMSStyleRange
 void setToolTipText(java.lang.String toolTipText)
          setToolTip set a tool tip for the OpenTMSStyleRange
 
Methods inherited from class org.eclipse.swt.custom.StyleRange
clone, equals, hashCode, isUnstyled, similarTo, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenTMSStyleRange

public OpenTMSStyleRange(int startPos,
                         int len,
                         org.eclipse.swt.graphics.Color tagForeGroundColor,
                         org.eclipse.swt.graphics.Color tagBackGroundColor)
Parameters:
startPos -
len -
tagForeGroundColor -
tagBackGroundColor -
Method Detail

getData

public java.util.Hashtable<java.lang.String,java.lang.Object> getData()
Returns:
the data

getData

public java.lang.Object getData(java.lang.String string)
getData get a data object associated with the OpenTMSStyleRange

Parameters:
string - the key of the data
Returns:

getToolTip

public java.lang.String getToolTip()
getToolTip get a tool tip for the OpenTMSStyleRange

Returns:

isBEditable

public boolean isBEditable()
Returns:
the bEditable

removeData

public java.lang.Object removeData(java.lang.String string)
removeData remove a data object

Parameters:
string - the key for the data to remove
Returns:

setBEditable

public void setBEditable(boolean editable)
Parameters:
editable - the bEditable to set; if true allow editing in the style range

setData

public void setData(java.util.Hashtable<java.lang.String,java.lang.Object> data)
Parameters:
data - the data to set

setData

public void setData(java.lang.String string)
setData associate a string as a data for the OpenTMSStyleRange (key = string / value = string)

Parameters:
string - the string to set

setData

public void setData(java.lang.String string,
                    java.lang.Object object)
setData associate a data object with an OpenTMSStyleRange

Parameters:
string - the key for the data
object - the data object

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
setToolTip set a tool tip for the OpenTMSStyleRange

Parameters:
toolTipText - the tool tip text to display