Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Error in editor - how to fix?(An EditPart has to be selectable (isSelectable() == true) in order to obtain focus.))
Error in editor - how to fix? [message #1017437] Mon, 11 March 2013 20:36 Go to next message
Miguel Pessoa is currently offline Miguel PessoaFriend
Messages: 22
Registered: May 2012
Location: Brazil
Junior Member
Hello all.
I have a problem when running swtbot using eclipse juno 4.2
When I run tests using the Eclipse editor swtbot in the following problem has occurred several times:
This error is caused by GEF? how fix this?
Does anyone know how to solve this problem?

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: An EditPart has to be selectable (isSelectable() == true) in order to obtain focus.)
	at org.eclipse.swt.SWT.error(
	at org.eclipse.swt.SWT.error(
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
	at org.eclipse.swt.widgets.Display.runAsyncMessages(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(
	at org.eclipse.ui.internal.Workbench$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(
	at org.eclipse.swtbot.eclipse.core.UITestApplication.start(
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
	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(
	at org.eclipse.equinox.launcher.Main.basicRun(
	at org.eclipse.equinox.launcher.Main.main(
Caused by: java.lang.IllegalArgumentException: An EditPart has to be selectable (isSelectable() == true) in order to obtain focus.
	at org.eclipse.core.runtime.Assert.isLegal(
	at org.eclipse.gef.editparts.AbstractEditPart.setFocus(
	at org.eclipse.gef.SelectionManager.setFocus(
	at org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefViewer$
	at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$4.doRun(
	at org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(

What seems to be is a problem in trying to gef click and rename elements in the editor.

best regards
Re: Error in editor - how to fix? [message #1018676 is a reply to message #1017437] Thu, 14 March 2013 09:46 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
It seems to me that the SWTBot is trying to set focus on an edit part, that is not selectable. That is not allowed.

Since the AbstractEditPart is selectable by default, you have to return false from isSelectable method in the edit part.
Don't return false from that method or don't try to click on that edit part in your tests.
Previous Topic:GEF editor without making use of NodeEditPart for node model elements?
Next Topic:[Zest] Creation of a child node on the fly takes 1 sec
Goto Forum:

Current Time: Sun Jun 24 19:00:40 GMT 2018

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

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

Back to the top