Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Pb with IInputValidator
Pb with IInputValidator [message #511149] Sat, 30 January 2010 08:19 Go to next message
Laurent Barbareau is currently offline Laurent Barbareau
Messages: 10
Registered: July 2009
Location: Aix en Provence - France
Junior Member
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 08:47 Go to previous messageGo to next message
Laurent Barbareau is currently offline Laurent Barbareau
Messages: 10
Registered: July 2009
Location: Aix en Provence - France
Junior Member
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 ? Smile
Re: Re: Pb with IInputValidator [message #511178 is a reply to message #511150] Sat, 30 January 2010 13:58 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Laurent,

It looks like you compile for java6 but run on java5. Java 6 allows @override
annotations on interface methods. This is not allowed in java5 (which is in
the top 10 of the bugs-of-the-decade list).

--

Best Regards,
Wim Jongman
-- "640K ought to be enough for anybody." - Bill Gates, 1981
(Eclipse Old Skool Quote Service)

> 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 ? :)
Re: Re: Pb with IInputValidator [message #511241 is a reply to message #511178] Sun, 31 January 2010 12:47 Go to previous message
Laurent Barbareau is currently offline Laurent Barbareau
Messages: 10
Registered: July 2009
Location: Aix en Provence - France
Junior Member
Thank you for your answer Wim !
You're right Thumbs Up
Previous Topic:How to make perspective invisible for user
Next Topic:Eclipse plugin with Hibernate
Goto Forum:
  


Current Time: Fri Aug 01 03:57:37 EDT 2014

Powered by FUDForum. Page generated in 0.01864 seconds