Pb with IInputValidator [message #511149] |
Sat, 30 January 2010 13:19 |
|
Hello,
When I try to open a preference page that I've made, I got the following error
Quote: | !ENTRY org.eclipse.ui 4 0 2010-01-30 13:48:46.328
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.Error: Unresolved compilation problem:
The method isValid(String) of type new IInputValidator(){} must override a superclass method
)
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
............
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)
Caused by: java.lang.Error: Unresolved compilation problem:
The method isValid(String) of type new IInputValidator(){} must override a superclass method
..........
|
Everthing is ok while launching my RCP inside Eclipse but that pb occures once exported.
I don't understand what dependency is missing... Or why I couldn't use IInputValidator like that :
addAuthorButton.addSelectionListener(new SelectionAdapter()
{
/**
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e)
{
InputDialog dialog = new InputDialog(getShell(), "Alias de l'auteur", "Alias de l'auteur", "", new IInputValidator()
{
/**
* @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
*/
@Override
public String isValid(String alias)
{
String messageResult = null;
if (alias == null || alias.length() == 0)
{
messageResult = "Veuillez renseigner l'alias !";
}
else
{
// Pour que le nouvel alias soit valide, il faut qu'il ne soit pas pré-existant
Author author = new Author();
author.setAlias(alias);
messageResult = AuthorsUtils.isAliasAlreadyExists(author, authors) ? "Cet alias est déjà référencé, veuillez en choisir un autre !" : null;
}
return messageResult;
}
});
.....
Any ideas ?
Thanks in advance.
|
|
|
Re: Pb with IInputValidator [message #511150 is a reply to message #511149] |
Sat, 30 January 2010 13:47 |
|
May I suppose it's a kind of bug with dependencies resolution or something ?
Because, if I transform my anonymous IInputValidator class in a inner private class it's ok...
Any explanations ?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02389 seconds