org.eclipse.birt.chart.computation
Class EllipsisHelper

java.lang.Object
  extended by org.eclipse.birt.chart.computation.EllipsisHelper

public class EllipsisHelper
extends java.lang.Object

Provides a helper class to shorten a string with ellipsis. EllipsisHelper


Nested Class Summary
static interface EllipsisHelper.ITester
          ITester
 
Field Summary
static java.lang.String ELLIPSIS_STRING
           
 
Constructor Summary
EllipsisHelper(EllipsisHelper.ITester tester_, int iMinCharToView)
           
 
Method Summary
 boolean checkLabelEllipsis(java.lang.String sText_, java.lang.Object oPara)
           
static EllipsisHelper.ITester createSimpleTester(IChartComputation cComp, IDisplayServer xs, Label la, java.lang.Double fontHeight)
           
static java.lang.String ellipsisString(java.lang.String str, int iVisChar)
           
 EllipsisHelper.ITester getTester()
           
 int getVisibleCharCount()
          Returns the visible char count before the ellipsis, 0 if no ellipsis is used.
 void setIMinCharToView(int iMinCharToView)
           
static EllipsisHelper simpleInstance(IChartComputation cComp, IDisplayServer xs, Label la, java.lang.Double fontHeight)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELLIPSIS_STRING

public static final java.lang.String ELLIPSIS_STRING
See Also:
Constant Field Values
Constructor Detail

EllipsisHelper

public EllipsisHelper(EllipsisHelper.ITester tester_,
                      int iMinCharToView)
Method Detail

getTester

public EllipsisHelper.ITester getTester()

setIMinCharToView

public void setIMinCharToView(int iMinCharToView)

ellipsisString

public static java.lang.String ellipsisString(java.lang.String str,
                                              int iVisChar)

getVisibleCharCount

public int getVisibleCharCount()
Returns the visible char count before the ellipsis, 0 if no ellipsis is used. e.g. if the text is "abcd..." then 4 will be returned. if the text is "abcdefg" then 0 will be returned.

Returns:
count of visible chars.

checkLabelEllipsis

public boolean checkLabelEllipsis(java.lang.String sText_,
                                  java.lang.Object oPara)
                           throws ChartException
Throws:
ChartException

createSimpleTester

public static EllipsisHelper.ITester createSimpleTester(IChartComputation cComp,
                                                        IDisplayServer xs,
                                                        Label la,
                                                        java.lang.Double fontHeight)
                                                 throws ChartException
Throws:
ChartException

simpleInstance

public static EllipsisHelper simpleInstance(IChartComputation cComp,
                                            IDisplayServer xs,
                                            Label la,
                                            java.lang.Double fontHeight)
                                     throws ChartException
Throws:
ChartException


Copyright © 2005-2008 Actuate Corp. All rights reserved.