Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAparna Argade2019-09-09 08:59:15 +0000
committerAparna Argade2019-09-09 08:59:15 +0000
commit5e6d076622e9426f3b34479857aafcdd713230e1 (patch)
treefcbb7c35af8259e2c15f4c869c57e1e591da4421
parent874eeaaefa7cd066abdc02c7a598b58054d19d88 (diff)
downloadorg.eclipse.swtbot-5e6d076622e9426f3b34479857aafcdd713230e1.tar.gz
org.eclipse.swtbot-5e6d076622e9426f3b34479857aafcdd713230e1.tar.xz
org.eclipse.swtbot-5e6d076622e9426f3b34479857aafcdd713230e1.zip
Fix condition for using index in case of Checkbox and PushButton click
buttonText is compared with empty string, instead of null, to match with Button.getText() return value. Change-Id: I401154f45da43b9aaadde0b554814bcdd6961f7d Signed-off-by: Aparna Argade <aprsac@yahoo.com>
-rw-r--r--org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/CheckboxClickedRule.java6
-rw-r--r--org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/PushButtonClickedRule.java6
2 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/CheckboxClickedRule.java b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/CheckboxClickedRule.java
index 45030312..19aa9e7f 100644
--- a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/CheckboxClickedRule.java
+++ b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/CheckboxClickedRule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Red Hat Inc..
+ * Copyright (c) 2012, 2019 Red Hat Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ public class CheckboxClickedRule extends GenerationSimpleRule {
public void initializeForEvent(Event event) {
this.button = (Button)event.widget;
this.buttonText = this.button.getText();
- if (this.buttonText != null) {
+ if (!this.buttonText.equals("")) {
this.buttonText = this.buttonText.replace("&", "");
} else {
this.index = WidgetUtils.getIndex((Button)event.widget);
@@ -49,7 +49,7 @@ public class CheckboxClickedRule extends GenerationSimpleRule {
List<String> actions = new ArrayList<String>();
StringBuilder code = new StringBuilder();
- if (this.buttonText != null) {
+ if (!this.buttonText.equals("")) {
code.append("bot.checkBox(\"" + this.buttonText + "\")");
} else {
code.append("bot.checkBox(" + this.index + ")");
diff --git a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/PushButtonClickedRule.java b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/PushButtonClickedRule.java
index d394e086..c653570d 100644
--- a/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/PushButtonClickedRule.java
+++ b/org.eclipse.swtbot.generator/src/org/eclipse/swtbot/generator/framework/rules/simple/PushButtonClickedRule.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Red Hat Inc..
+ * Copyright (c) 2012, 2019 Red Hat Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ public class PushButtonClickedRule extends GenerationSimpleRule {
public void initializeForEvent(Event event) {
this.button = (Button)event.widget;
this.buttonText = this.button.getText();
- if (this.buttonText != null) {
+ if (!this.buttonText.equals("")) {
this.buttonText = this.buttonText.replace("&", "");
} else {
this.index = WidgetUtils.getIndex((Button)event.widget);
@@ -47,7 +47,7 @@ public class PushButtonClickedRule extends GenerationSimpleRule {
public List<String> getActions() {
List<String> actions = new ArrayList<String>();
StringBuilder code = new StringBuilder();
- if (this.buttonText != null) {
+ if (!this.buttonText.equals("")) {
code.append("bot.button(\"" + this.buttonText + "\")");
} else {
code.append("bot.button(" + this.index + ")");

Back to the top