Author: lzoubek(a)redhat.com
Date: 2010-08-30 10:37:09 -0400 (Mon, 30 Aug 2010)
New Revision: 24549
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotSection.java
Log:
SWTBot ext - SWTSection
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-08-30
13:55:09 UTC (rev 24548)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTBotExt.java 2010-08-30
14:37:09 UTC (rev 24549)
@@ -22,6 +22,7 @@
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo;
@@ -174,5 +175,15 @@
"Could not find widget of type Section", ex);
}
}
+ @SuppressWarnings("unchecked")
+ public SWTBotSection section(SWTBot bot, String label) {
+ try {
+ List<Section> sections =
(List<Section>)bot.widgets(allOf(withText(label),widgetOfType(Section.class)));
+ return new SWTBotSection(sections.get(0));
+ } catch (WidgetNotFoundException ex) {
+ throw new WidgetNotFoundException(
+ "Could not find widget of type Section", ex);
+ }
+ }
}
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotSection.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotSection.java 2010-08-30
13:55:09 UTC (rev 24548)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/widgets/SWTBotSection.java 2010-08-30
14:37:09 UTC (rev 24549)
@@ -1,5 +1,6 @@
package org.jboss.tools.ui.bot.ext.widgets;
+import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBotControl;
import org.eclipse.ui.forms.widgets.Section;
@@ -12,8 +13,13 @@
*/
public class SWTBotSection extends AbstractSWTBotControl<Section> {
+ private final SWTBot bot;
public SWTBotSection(Section w) throws WidgetNotFoundException {
- super(w);
+ super(w);
+ bot = new SWTBot(w);
}
+ public SWTBot bot() {
+ return bot;
+ }
}
Show replies by date