| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_201) on Thu Jul 23 15:58:40 CEST 2020 --> |
| <title>NumberFormatter</title> |
| <meta name="date" content="2020-07-23"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="NumberFormatter"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NumberFormatter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-files/index-1.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/MaskFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/PercentFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html" target="_top">Frames</a></li> |
| <li><a href="NumberFormatter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.eclipse.nebula.widgets.formattedtext</div> |
| <h2 title="Class NumberFormatter" class="title">Class NumberFormatter</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">org.eclipse.nebula.widgets.formattedtext.AbstractFormatter</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.eclipse.nebula.widgets.formattedtext.NumberFormatter</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd>java.util.EventListener, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html" title="interface in org.eclipse.nebula.widgets.formattedtext">ITextFormatter</a>, org.eclipse.swt.events.VerifyListener, org.eclipse.swt.internal.SWTEventListener</dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/BigDecimalFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">BigDecimalFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/BigIntegerFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">BigIntegerFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/DoubleFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">DoubleFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/FloatFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">FloatFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/IntegerFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">IntegerFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/LongFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">LongFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/PercentFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">PercentFormatter</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ShortFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">ShortFormatter</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">NumberFormatter</span> |
| extends <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">AbstractFormatter</a></pre> |
| <div class="block">This class provides formatting of <code>Number</code> values in a |
| <code>FormattedText</code>.<p> |
| |
| Formatter is composed of an edit pattern and a display pattern.<br> |
| Display pattern uses the same syntax than <code>DecimalFormat</code>, and |
| uses it to compute the value to display.<br> |
| Edit pattern is more limited and composed of two part, the int part and |
| the decimal part. Formatting characters allow to specify number of digits, |
| minimal length, decimal position, grouping and negative sign.<p> |
| |
| <h4>Patterns Characters</h4> |
| <table border=0 cellspacing=3 cellpadding=0 summary="Chart shows pattern letters, date/time component, presentation, and examples."> |
| <tr bgcolor="#ccccff"> |
| <th align=left>Symbol</th> |
| <th align=left>Meaning</th> |
| </tr> |
| <tr> |
| <td><code>0</code></td> |
| <td>Digit</td> |
| </tr> |
| <tr bgcolor="#eeeeff"> |
| <td><code>#</code></td> |
| <td>Digit, zero shows as absent</td> |
| </tr> |
| <tr> |
| <td><code>.</code></td> |
| <td>Decimal separator</td> |
| </tr> |
| <tr bgcolor="#eeeeff"> |
| <td><code>-</code></td> |
| <td>Minus sign</td> |
| </tr> |
| <tr> |
| <td><code>,</code></td> |
| <td>Grouping separator</td> |
| </tr> |
| </table> |
| |
| <h4>Examples</h4> |
| <ul> |
| <li><code>new NumberFormatter("#,##0.00")</code> - 1234.5 will edit and |
| display as "1,234.50".</li> |
| </ul></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#alwaysShowDec">alwaysShowDec</a></span></code> |
| <div class="block">Flag for display of the decimal separator</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static java.util.Hashtable<java.util.Locale,java.lang.String></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#cachedPatterns">cachedPatterns</a></span></code> |
| <div class="block">Cache of number patterns by locales</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#decimalLen">decimalLen</a></span></code> |
| <div class="block">Maximum number of digits of the decimal part</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#editPattern">editPattern</a></span></code> |
| <div class="block">Edit pattern</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected java.lang.StringBuffer</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#editValue">editValue</a></span></code> |
| <div class="block">Buffer for the edit value</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#fixedDec">fixedDec</a></span></code> |
| <div class="block">Flag indicating that the decimal part has a fixed length</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#fixedInt">fixedInt</a></span></code> |
| <div class="block">Flag indicating that the int part has a fixed length</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#groupLen">groupLen</a></span></code> |
| <div class="block">Length of groups (0 if no group separator)</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#intCount">intCount</a></span></code> |
| <div class="block">Current number of digits of the int part</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#intLen">intLen</a></span></code> |
| <div class="block">Maximum number of digits of the int part</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected java.util.Locale</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#locale">locale</a></span></code> |
| <div class="block">The locale used</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#minus">minus</a></span></code> |
| <div class="block">Flag for display of the negative sign</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#modified">modified</a></span></code> |
| <div class="block">Flag indicating that the buffer is modified and the Number value must be computed</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#nbspSeparator">nbspSeparator</a></span></code> |
| <div class="block">Flag indicating the use of the 0xAO (no-break space) grouping separator</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#negative">negative</a></span></code> |
| <div class="block">Flag indicating that the current value is negative</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected java.text.DecimalFormat</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#nfDisplay">nfDisplay</a></span></code> |
| <div class="block">Number formatter for display</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected java.text.DecimalFormat</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#nfEdit">nfEdit</a></span></code> |
| <div class="block">Number formatter for display edit</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#prefixLen">prefixLen</a></span></code> |
| <div class="block">Length of the prefix part in the cache</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#suffixLen">suffixLen</a></span></code> |
| <div class="block">Length of the suffix part in the cache</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected java.text.DecimalFormatSymbols</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#symbols">symbols</a></span></code> |
| <div class="block">Symbols used to format numbers</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected java.lang.Number</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#value">value</a></span></code> |
| <div class="block">Number containing the current value</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#zeroDecimalLen">zeroDecimalLen</a></span></code> |
| <div class="block">Minimum number of digits of the decimal part (complement by 0)</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#zeroIntLen">zeroIntLen</a></span></code> |
| <div class="block">Minimum number of digits of the int part (complement by 0)</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.eclipse.nebula.widgets.formattedtext.AbstractFormatter"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.eclipse.nebula.widgets.formattedtext.<a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">AbstractFormatter</a></h3> |
| <code><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#EMPTY">EMPTY</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#ignore">ignore</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#SPACE">SPACE</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#text">text</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter--">NumberFormatter</a></span>()</code> |
| <div class="block">Constructs a new instance with all defaults : |
| |
| edit mask from NumberPatterns for the default locale |
| display mask identical to the edit mask |
| default locale |
| </div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter-java.util.Locale-">NumberFormatter</a></span>(java.util.Locale loc)</code> |
| <div class="block">Constructs a new instance with default edit and display masks for the given |
| locale.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter-java.lang.String-">NumberFormatter</a></span>(java.lang.String editPattern)</code> |
| <div class="block">Constructs a new instance with the given edit mask.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter-java.lang.String-java.util.Locale-">NumberFormatter</a></span>(java.lang.String editPattern, |
| java.util.Locale loc)</code> |
| <div class="block">Constructs a new instance with the given edit mask and locale.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter-java.lang.String-java.lang.String-">NumberFormatter</a></span>(java.lang.String editPattern, |
| java.lang.String displayPattern)</code> |
| <div class="block">Constructs a new instance with the given edit and display masks.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#NumberFormatter-java.lang.String-java.lang.String-java.util.Locale-">NumberFormatter</a></span>(java.lang.String editPattern, |
| java.lang.String displayPattern, |
| java.util.Locale loc)</code> |
| <div class="block">Constructs a new instance with the given masks and locale.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#clearText-int-int-">clearText</a></span>(int start, |
| int len)</code> |
| <div class="block">Clears a part of the edition cache.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>protected int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#format-int-">format</a></span>(int curseur)</code> |
| <div class="block">Formats the edit buffer.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getDefaultPattern-java.util.Locale-">getDefaultPattern</a></span>(java.util.Locale loc)</code> |
| <div class="block">Returns the default edit pattern for a given locale.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getDisplayString--">getDisplayString</a></span>()</code> |
| <div class="block">Returns the current value formatted for display.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getEditString--">getEditString</a></span>()</code> |
| <div class="block">Returns the current value formatted for editing.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getValue--">getValue</a></span>()</code> |
| <div class="block">Returns the current value of the text control if it is a valid <code>Number</code>.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>java.lang.Class<?></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getValueType--">getValueType</a></span>()</code> |
| <div class="block">Returns the type of value this <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html" title="interface in org.eclipse.nebula.widgets.formattedtext"><code>ITextFormatter</code></a> handles, |
| i.e.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#isEmpty--">isEmpty</a></span>()</code> |
| <div class="block">Returns <code>true</code> if current edited value is empty, else returns |
| <code>false</code>.<br></div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#isValid--">isValid</a></span>()</code> |
| <div class="block">Returns <code>true</code> if current edited value is valid, else returns |
| <code>false</code>.<br> |
| A NumberFormatter is valid if the cached value is not null.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setDecimalSeparatorAlwaysShown-boolean-">setDecimalSeparatorAlwaysShown</a></span>(boolean show)</code> |
| <div class="block">Sets the flag to always display the decimal separator, even if the decimal |
| part is empty.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setFixedLengths-boolean-boolean-">setFixedLengths</a></span>(boolean fixedInt, |
| boolean fixedDec)</code> |
| <div class="block">Sets the fixed length flags.<br> |
| By default, int and decimal part of the pattern have a fixed length.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setPatterns-java.lang.String-java.lang.String-java.util.Locale-">setPatterns</a></span>(java.lang.String edit, |
| java.lang.String display, |
| java.util.Locale loc)</code> |
| <div class="block">Sets the patterns and initializes the technical attributes used to manage |
| the operations.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setPrefix-java.lang.String-">setPrefix</a></span>(java.lang.String prefix)</code> |
| <div class="block">Sets a prefix to display before the value.<br> |
| |
| To clear the current prefix, call the <code>setPrefix</code> method with a |
| <code>null</code> parameter.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setSuffix-java.lang.String-">setSuffix</a></span>(java.lang.String suffix)</code> |
| <div class="block">Sets a suffix to display after the value.<br> |
| |
| To clear the current suffix, call the <code>setSuffix</code> method with a |
| <code>null</code> parameter.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#setValue-java.lang.Object-">setValue</a></span>(java.lang.Object value)</code> |
| <div class="block">Sets the value to edit.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#verifyText-org.eclipse.swt.events.VerifyEvent-">verifyText</a></span>(org.eclipse.swt.events.VerifyEvent e)</code> |
| <div class="block">Handles a <code>VerifyEvent</code> sent when the text is about to be modified.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.eclipse.nebula.widgets.formattedtext.AbstractFormatter"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.eclipse.nebula.widgets.formattedtext.<a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext">AbstractFormatter</a></h3> |
| <code><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#beep--">beep</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#detach--">detach</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#setIgnore-boolean-">setIgnore</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#setText-org.eclipse.swt.widgets.Text-">setText</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#updateText-java.lang.String-">updateText</a>, <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/AbstractFormatter.html#updateText-java.lang.String-int-">updateText</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="cachedPatterns"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>cachedPatterns</h4> |
| <pre>protected static java.util.Hashtable<java.util.Locale,java.lang.String> cachedPatterns</pre> |
| <div class="block">Cache of number patterns by locales</div> |
| </li> |
| </ul> |
| <a name="nfDisplay"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nfDisplay</h4> |
| <pre>protected java.text.DecimalFormat nfDisplay</pre> |
| <div class="block">Number formatter for display</div> |
| </li> |
| </ul> |
| <a name="nfEdit"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nfEdit</h4> |
| <pre>protected java.text.DecimalFormat nfEdit</pre> |
| <div class="block">Number formatter for display edit</div> |
| </li> |
| </ul> |
| <a name="editValue"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>editValue</h4> |
| <pre>protected java.lang.StringBuffer editValue</pre> |
| <div class="block">Buffer for the edit value</div> |
| </li> |
| </ul> |
| <a name="value"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>value</h4> |
| <pre>protected java.lang.Number value</pre> |
| <div class="block">Number containing the current value</div> |
| </li> |
| </ul> |
| <a name="editPattern"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>editPattern</h4> |
| <pre>protected java.lang.String editPattern</pre> |
| <div class="block">Edit pattern</div> |
| </li> |
| </ul> |
| <a name="locale"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>locale</h4> |
| <pre>protected java.util.Locale locale</pre> |
| <div class="block">The locale used</div> |
| </li> |
| </ul> |
| <a name="groupLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>groupLen</h4> |
| <pre>protected int groupLen</pre> |
| <div class="block">Length of groups (0 if no group separator)</div> |
| </li> |
| </ul> |
| <a name="intCount"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>intCount</h4> |
| <pre>protected int intCount</pre> |
| <div class="block">Current number of digits of the int part</div> |
| </li> |
| </ul> |
| <a name="intLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>intLen</h4> |
| <pre>protected int intLen</pre> |
| <div class="block">Maximum number of digits of the int part</div> |
| </li> |
| </ul> |
| <a name="decimalLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decimalLen</h4> |
| <pre>protected int decimalLen</pre> |
| <div class="block">Maximum number of digits of the decimal part</div> |
| </li> |
| </ul> |
| <a name="zeroIntLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>zeroIntLen</h4> |
| <pre>protected int zeroIntLen</pre> |
| <div class="block">Minimum number of digits of the int part (complement by 0)</div> |
| </li> |
| </ul> |
| <a name="zeroDecimalLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>zeroDecimalLen</h4> |
| <pre>protected int zeroDecimalLen</pre> |
| <div class="block">Minimum number of digits of the decimal part (complement by 0)</div> |
| </li> |
| </ul> |
| <a name="minus"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>minus</h4> |
| <pre>protected boolean minus</pre> |
| <div class="block">Flag for display of the negative sign</div> |
| </li> |
| </ul> |
| <a name="negative"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>negative</h4> |
| <pre>protected boolean negative</pre> |
| <div class="block">Flag indicating that the current value is negative</div> |
| </li> |
| </ul> |
| <a name="symbols"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>symbols</h4> |
| <pre>protected java.text.DecimalFormatSymbols symbols</pre> |
| <div class="block">Symbols used to format numbers</div> |
| </li> |
| </ul> |
| <a name="nbspSeparator"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>nbspSeparator</h4> |
| <pre>protected boolean nbspSeparator</pre> |
| <div class="block">Flag indicating the use of the 0xAO (no-break space) grouping separator</div> |
| </li> |
| </ul> |
| <a name="alwaysShowDec"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>alwaysShowDec</h4> |
| <pre>protected boolean alwaysShowDec</pre> |
| <div class="block">Flag for display of the decimal separator</div> |
| </li> |
| </ul> |
| <a name="modified"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>modified</h4> |
| <pre>protected boolean modified</pre> |
| <div class="block">Flag indicating that the buffer is modified and the Number value must be computed</div> |
| </li> |
| </ul> |
| <a name="fixedInt"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fixedInt</h4> |
| <pre>protected boolean fixedInt</pre> |
| <div class="block">Flag indicating that the int part has a fixed length</div> |
| </li> |
| </ul> |
| <a name="fixedDec"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fixedDec</h4> |
| <pre>protected boolean fixedDec</pre> |
| <div class="block">Flag indicating that the decimal part has a fixed length</div> |
| </li> |
| </ul> |
| <a name="prefixLen"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>prefixLen</h4> |
| <pre>protected int prefixLen</pre> |
| <div class="block">Length of the prefix part in the cache</div> |
| </li> |
| </ul> |
| <a name="suffixLen"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>suffixLen</h4> |
| <pre>protected int suffixLen</pre> |
| <div class="block">Length of the suffix part in the cache</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="NumberFormatter--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter()</pre> |
| <div class="block">Constructs a new instance with all defaults : |
| <ul> |
| <li>edit mask from NumberPatterns for the default locale</li> |
| <li>display mask identical to the edit mask</li> |
| <li>default locale</li> |
| </ul></div> |
| </li> |
| </ul> |
| <a name="NumberFormatter-java.util.Locale-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter(java.util.Locale loc)</pre> |
| <div class="block">Constructs a new instance with default edit and display masks for the given |
| locale.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>loc</code> - locale</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="NumberFormatter-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter(java.lang.String editPattern)</pre> |
| <div class="block">Constructs a new instance with the given edit mask. Display mask is |
| identical to the edit mask, and locale is the default one.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>editPattern</code> - edit mask</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="NumberFormatter-java.lang.String-java.util.Locale-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter(java.lang.String editPattern, |
| java.util.Locale loc)</pre> |
| <div class="block">Constructs a new instance with the given edit mask and locale. Display mask |
| is identical to the edit mask.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>editPattern</code> - edit mask</dd> |
| <dd><code>loc</code> - locale</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="NumberFormatter-java.lang.String-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter(java.lang.String editPattern, |
| java.lang.String displayPattern)</pre> |
| <div class="block">Constructs a new instance with the given edit and display masks. Uses the |
| default locale.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>editPattern</code> - edit mask</dd> |
| <dd><code>displayPattern</code> - display mask</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="NumberFormatter-java.lang.String-java.lang.String-java.util.Locale-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>NumberFormatter</h4> |
| <pre>public NumberFormatter(java.lang.String editPattern, |
| java.lang.String displayPattern, |
| java.util.Locale loc)</pre> |
| <div class="block">Constructs a new instance with the given masks and locale.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>editPattern</code> - edit mask</dd> |
| <dd><code>displayPattern</code> - display mask</dd> |
| <dd><code>loc</code> - locale</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="clearText-int-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clearText</h4> |
| <pre>protected void clearText(int start, |
| int len)</pre> |
| <div class="block">Clears a part of the edition cache. The start and len parameters are |
| adjusted to avoid clearing in prefix and suffix parts of the cache.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>start</code> - beginning index</dd> |
| <dd><code>len</code> - length of portion to clear</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="format-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>format</h4> |
| <pre>protected int format(int curseur)</pre> |
| <div class="block">Formats the edit buffer. Inserts group separators to the right places, |
| deletes excess decimal digits and add 0 to complete to the minimal length |
| of int and decimal parts. The position of the cursor is preserved.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>curseur</code> - Current position of the cursor</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>New position of the cursor</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getDefaultPattern-java.util.Locale-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDefaultPattern</h4> |
| <pre>protected java.lang.String getDefaultPattern(java.util.Locale loc)</pre> |
| <div class="block">Returns the default edit pattern for a given locale.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>loc</code> - locale</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Edit pattern</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getDisplayString--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getDisplayString</h4> |
| <pre>public java.lang.String getDisplayString()</pre> |
| <div class="block">Returns the current value formatted for display. |
| This method is called by <code>FormattedText</code> when the <code>Text</code> |
| widget looses focus. |
| The displayed value is the result of formatting on the <code>Number</code> |
| with a <code>DecimalFormat<code> for the display pattern passed in |
| constructor.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>display string if valid, empty string else</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html#getDisplayString--"><code>ITextFormatter.getDisplayString()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getEditString--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getEditString</h4> |
| <pre>public java.lang.String getEditString()</pre> |
| <div class="block">Returns the current value formatted for editing. |
| This method is called by <code>FormattedText</code> when the <code>Text</code> |
| widget gains focus. |
| The value returned is the content of the StringBuilder <code>editValue</code> |
| used as cache.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>edit string</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html#getEditString--"><code>ITextFormatter.getEditString()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getValue--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getValue</h4> |
| <pre>public java.lang.Object getValue()</pre> |
| <div class="block">Returns the current value of the text control if it is a valid <code>Number</code>. |
| If the buffer is flagged as modified, the value is recalculated by parsing |
| with the <code>nfEdit</code> initialized with the edit pattern. If the |
| number is not valid, returns <code>null</code>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>current number value if valid, <code>null</code> else</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html#getValue--"><code>ITextFormatter.getValue()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getValueType--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getValueType</h4> |
| <pre>public java.lang.Class<?> getValueType()</pre> |
| <div class="block">Returns the type of value this <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html" title="interface in org.eclipse.nebula.widgets.formattedtext"><code>ITextFormatter</code></a> handles, |
| i.e. returns in <a href="../../../../../org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html#getValue--"><code>getValue()</code></a>.<br> |
| A NumberFormatter always returns a Number value.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The value type.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isEmpty--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isEmpty</h4> |
| <pre>public boolean isEmpty()</pre> |
| <div class="block">Returns <code>true</code> if current edited value is empty, else returns |
| <code>false</code>.<br></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if empty, else <code>false</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isValid--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isValid</h4> |
| <pre>public boolean isValid()</pre> |
| <div class="block">Returns <code>true</code> if current edited value is valid, else returns |
| <code>false</code>.<br> |
| A NumberFormatter is valid if the cached value is not null.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if valid, else <code>false</code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html#isValid--"><code>ITextFormatter.isValid()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setDecimalSeparatorAlwaysShown-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setDecimalSeparatorAlwaysShown</h4> |
| <pre>public void setDecimalSeparatorAlwaysShown(boolean show)</pre> |
| <div class="block">Sets the flag to always display the decimal separator, even if the decimal |
| part is empty.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>show</code> - true / false</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setFixedLengths-boolean-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setFixedLengths</h4> |
| <pre>public void setFixedLengths(boolean fixedInt, |
| boolean fixedDec)</pre> |
| <div class="block">Sets the fixed length flags.<br> |
| By default, int and decimal part of the pattern have a fixed length.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>fixedInt</code> - flag for int part</dd> |
| <dd><code>fixedDec</code> - flag for decimal part</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setPatterns-java.lang.String-java.lang.String-java.util.Locale-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setPatterns</h4> |
| <pre>protected void setPatterns(java.lang.String edit, |
| java.lang.String display, |
| java.util.Locale loc)</pre> |
| <div class="block">Sets the patterns and initializes the technical attributes used to manage |
| the operations.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>edit</code> - edit pattern</dd> |
| <dd><code>display</code> - display pattern</dd> |
| <dd><code>loc</code> - Locale to use</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if a pattern is invalid</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setPrefix-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setPrefix</h4> |
| <pre>protected void setPrefix(java.lang.String prefix)</pre> |
| <div class="block">Sets a prefix to display before the value.<br> |
| |
| To clear the current prefix, call the <code>setPrefix</code> method with a |
| <code>null</code> parameter.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>prefix</code> - prefix to display, or <code>null</code> to clear</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setSuffix-java.lang.String-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setSuffix</h4> |
| <pre>protected void setSuffix(java.lang.String suffix)</pre> |
| <div class="block">Sets a suffix to display after the value.<br> |
| |
| To clear the current suffix, call the <code>setSuffix</code> method with a |
| <code>null</code> parameter.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>suffix</code> - suffix to display, or <code>null</code> to clear</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setValue-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setValue</h4> |
| <pre>public void setValue(java.lang.Object value)</pre> |
| <div class="block">Sets the value to edit. The value provided must be a <code>Number</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - number value</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if not a number</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/ITextFormatter.html#setValue-java.lang.Object-"><code>ITextFormatter.setValue(java.lang.Object)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="verifyText-org.eclipse.swt.events.VerifyEvent-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>verifyText</h4> |
| <pre>public void verifyText(org.eclipse.swt.events.VerifyEvent e)</pre> |
| <div class="block">Handles a <code>VerifyEvent</code> sent when the text is about to be modified. |
| This method is the entry point of all operations of formatting.</div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><code>VerifyListener.verifyText(org.eclipse.swt.events.VerifyEvent)</code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/NumberFormatter.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-files/index-1.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/MaskFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/eclipse/nebula/widgets/formattedtext/PercentFormatter.html" title="class in org.eclipse.nebula.widgets.formattedtext"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/eclipse/nebula/widgets/formattedtext/NumberFormatter.html" target="_top">Frames</a></li> |
| <li><a href="NumberFormatter.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |