@Before public void setUp() { shell = new WorkbenchShell().getSWTWidget(); org.jboss.reddeer.core.util.Display.asyncExec( new Runnable() { @Override public void run() { wizard = new TestingWizard(); org.eclipse.jface.wizard.WizardDialog swtWizardDialog = new org.eclipse.jface.wizard.WizardDialog(shell, wizard); swtWizardDialog.create(); swtWizardDialog.open(); } }); new WaitUntil(new ShellWithTextIsActive(TestingWizard.TITLE)); wizardDialog = new WizardDialog(); }
/** * Adds a tool in a given group from a palette to the specified coordinates. * * @param tool Tool label * @param group Group label * @param x X-axis * @param y Y-axis * @return the org.jboss.reddeer.gef.api. edit part */ public org.jboss.reddeer.gef.api.EditPart addToolFromPalette( String tool, String group, final int x, final int y) { int oldCount = getNumberOfEditParts(); final ViewerListener viewerListener = new ViewerListener(); Display.asyncExec( new Runnable() { @Override public void run() { List<EditPart> editParts = ViewerHandler.getInstance().getEditParts(viewer); for (EditPart editPart : editParts) { editPart.addEditPartListener(viewerListener); } } }); getPalette().activateTool(tool, group); click(x, y); return getAddedEditPart(viewerListener, oldCount); }