Community
Participate
Working Groups
Build Identifier: M20100211-1343 SWTBotGefEditPart.click() or SWTBotGefEditPart.doubleClick() do nothing if the editPart figure is not in the visible portion of the ScrollPane. I have to do the following to click on an editPart : final GraphicalViewer graphicalViewer = (GraphicalViewer)jobEditorPart.getAdapter(GraphicalViewer.class); SWTBotGefEditor gefEditorBot = gefBot.gefEditor("testAdvancedPropertySection"); final SWTBotGefEditPart editPart = gefEditorBot.getEditPart("Record Success"); UIThreadRunnable.syncExec(new VoidResult() { public void run() { try { graphicalViewer.reveal(editPart.part()); } catch (Exception e) { throw new RuntimeException(e); } } }); editPart.click(); Reproducible: Always
(In reply to comment #0) > Build Identifier: M20100211-1343 > > SWTBotGefEditPart.click() or SWTBotGefEditPart.doubleClick() do nothing if the > editPart figure is not in the visible portion of the ScrollPane. > > I have to do the following to click on an editPart : > > final GraphicalViewer graphicalViewer = > (GraphicalViewer)jobEditorPart.getAdapter(GraphicalViewer.class); > > SWTBotGefEditor gefEditorBot = gefBot.gefEditor("testAdvancedPropertySection"); > final SWTBotGefEditPart editPart = gefEditorBot.getEditPart("Record Success"); > UIThreadRunnable.syncExec(new VoidResult() { > public void run() { > try { > graphicalViewer.reveal(editPart.part()); > } catch (Exception e) { > throw new RuntimeException(e); > } > } > }); > editPart.click(); > > Reproducible: Always Hi Cédric, It seems to me to be the correct behavior. If an end user is not able to click unless he made the edit part visible using the ascensor of the scroll pane, the bot should not allow to do it. Regards
Ok, I agree but there should be a reveal method on SWTBotGefEditPart then (or another way to make the EditPart figure visible). Did I miss something ?
(In reply to comment #2) > Ok, I agree but there should be a reveal method on SWTBotGefEditPart then (or > another way to make the EditPart figure visible). > > Did I miss something ? I think a method like this one can be added to SWTBotGefEditor : /** * Reveal the edit part with the label as a single selection. * * @param label * The label of the searched edit part */ public void reveal(String label) { final SWTBotGefEditPart revealedEP = getEditPart(label); if (revealedEP == null) { throw new WidgetNotFoundException(String.format("Expected to find widget %s", label)); } UIThreadRunnable.syncExec(new VoidResult() { public void run() { graphicalViewer.reveal(revealedEP.part()); } }); } Regards, Laurent
I would like to have this method: /** * Reveal the edit part . * * @param editPart * The edit part. */ public void reveal(final SWTBotGefEditPart editPart) { UIThreadRunnable.syncExec(new VoidResult() { public void run() { graphicalViewer.reveal(editPart.part()); } }); } For my test environment I created a selector where I can give a path to my element . The selector selects that. But the selector should be able to reveal a given SWTBotGefEditPart which the selector knows by the path. For me it is not sufficient to have a method where I give a label.
Please provide a patch with Gerrit (ideally with a test case that validates your code, that would be added to the automated tests) http://wiki.eclipse.org/SWTBot/Contributing