Runtime

org.eclipse.gmf.runtime.draw2d.ui.text
Class TextFlowEx

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.eclipse.draw2d.text.FlowFigure
          extended by org.eclipse.draw2d.text.InlineFlow
              extended by org.eclipse.draw2d.text.TextFlow
                  extended by org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx
All Implemented Interfaces:
IFigure

public class TextFlowEx
extends TextFlow

A TextFlow with the following additional capabilities:

Since:
2.1

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
Figure.FigureIterator, Figure.IdentitySearch
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
IFigure.NoInsets
 
Field Summary
protected static int MAX_FLAG
          The highest reserved flag used by this class.
 
Fields inherited from class org.eclipse.draw2d.text.FlowFigure
selectionStart
 
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, maxSize, minSize, NO_MANAGER, prefSize, toolTip
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
TextFlowEx()
          Constructs a new TextFlow with the empty String.
TextFlowEx(java.lang.String text)
          Constructs a new TextFlow with the specified String.
 
Method Summary
 FlowUtilitiesEx getFlowUtilities()
           
 TextUtilitiesEx getTextUtilities()
           
protected  java.lang.String getTruncationString()
          Gets the truncation string.
 boolean isTextStrikedThrough()
           
 boolean isTextUnderlined()
           
protected  void paintFigure(Graphics g)
           
 void setTextStrikeThrough(boolean strikeThrough)
          Sets whether the label text should be striked-through
 void setTextUnderline(boolean underline)
          Sets whether the label text should be underlined
 void setTruncationString(java.lang.String truncationString)
          Sets the truncation string.
protected  java.lang.String truncateText(java.lang.String text)
          Adds an ellipsis to the text passed in if this will fit in the width of this figure, otherwise first truncates the text as required and then adds the ellipsis.
 
Methods inherited from class org.eclipse.draw2d.text.TextFlow
addLeadingWordRequirements, contributeBidi, createDefaultFlowLayout, getBidiInfo, getBidiSubstring, getCaretPlacement, getFirstOffsetForLine, getFragmentsWithoutBorder, getLastOffsetForLine, getNextOffset, getNextVisibleOffset, getOffset, getPreviousVisibleOffset, getText, isTextTruncated, paintSelection, paintText, setBidiInfo, setSelection, setText, toString
 
Methods inherited from class org.eclipse.draw2d.text.InlineFlow
containsPoint, getFragments, paintBorder, postValidate, setBorder
 
Methods inherited from class org.eclipse.draw2d.text.FlowFigure
add, remove, revalidateBidi, setBounds, setFlowContext
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintChildren, paintClientArea, primTranslate, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_FLAG

protected static final int MAX_FLAG
The highest reserved flag used by this class.

See Also:
Figure.MAX_FLAG
Constructor Detail

TextFlowEx

public TextFlowEx()
Constructs a new TextFlow with the empty String.


TextFlowEx

public TextFlowEx(java.lang.String text)
Constructs a new TextFlow with the specified String.

Parameters:
text - the string
Method Detail

getTruncationString

protected java.lang.String getTruncationString()
Gets the truncation string. The default is an ellipsis "...".

Returns:
the truncation string

setTruncationString

public void setTruncationString(java.lang.String truncationString)
Sets the truncation string. The default is an ellipsis "...".

Parameters:
truncationString - the new truncation string

isTextStrikedThrough

public boolean isTextStrikedThrough()
Returns:
whether the label text is striked-through

setTextStrikeThrough

public void setTextStrikeThrough(boolean strikeThrough)
Sets whether the label text should be striked-through

Parameters:
strikeThrough - Whether the label text should be striked-through

isTextUnderlined

public boolean isTextUnderlined()
Returns:
whether the label text is underlined

setTextUnderline

public void setTextUnderline(boolean underline)
Sets whether the label text should be underlined

Parameters:
underline - Whether the label text should be underlined

paintFigure

protected void paintFigure(Graphics g)
Overrides:
paintFigure in class TextFlow

truncateText

protected java.lang.String truncateText(java.lang.String text)
Adds an ellipsis to the text passed in if this will fit in the width of this figure, otherwise first truncates the text as required and then adds the ellipsis.

Parameters:
text - the full text
Returns:
a new string with the text ending in an ellipsis

getFlowUtilities

public FlowUtilitiesEx getFlowUtilities()
Overrides:
getFlowUtilities in class TextFlow

getTextUtilities

public TextUtilitiesEx getTextUtilities()
Overrides:
getTextUtilities in class TextFlow

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.