Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » StringIndexOutOfBoundsException when editing FormattedText
StringIndexOutOfBoundsException when editing FormattedText [message #591292] Mon, 28 July 2008 20:16
Eclipse UserFriend
Originally posted by: java14.cshg.com.br

Hi im having some trouble using FormattedText for formatting number fields
in a Eclipse RCP application .


The code involving the text fields looks like this :


FormattedText formatterText = new FormattedText(textField); ;
Locale.setDefault(Locale.US);
formatterTextField.setFormatter(new
NumberFormatter("-##########0.00"));

When I look into the text fields (executing the aplication) they work fine
but if I input a number ( ex: 125.23 ) select it using the mouse or SHIFT
key and press a number key replacing it or deleting the contents of the
field using backspace I get a out of bounds exception comming from
TextObservableValue , heres a stacktrace :

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at java.lang.String.substring(Unknown Source)
at
org.eclipse.jface.internal.databinding.swt.TextObservableVal ue$2.verifyText(TextObservableValue.java:140)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:249)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Text.verifyText(Text.java:1974)
at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1454)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1352)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3894)
at org.eclipse.swt.widgets.Text.WM_CHAR(Text.java:2083)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3787 )
at org.eclipse.swt.widgets.Text.windowProc(Text.java:2078)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4528 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:23 70)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3420)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at br.com.griffo.hgrcp.application.Application.start(Applicatio n.java:27)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


Is this a know bug ??
Previous Topic:Traverse between cells using Tab key
Next Topic:CDateTime - Pattern Question
Goto Forum:
  


Current Time: Thu Apr 25 02:11:06 GMT 2024

Powered by FUDForum. Page generated in 0.02594 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top