Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-11-27 15:55:58 +0000
committerMarkus Tiede2014-11-27 15:55:58 +0000
commit621a1d8118b329b57e328e90ceea70c8c6c1b457 (patch)
treea08a59261b4bec85407eb6af27e60d33bbb76845 /org.eclipse.jubula.rc.swt
parent17e7a19842a9dae7fd7f4f67f1a1f203d7f9468c (diff)
downloadorg.eclipse.jubula.core-621a1d8118b329b57e328e90ceea70c8c6c1b457.tar.gz
org.eclipse.jubula.core-621a1d8118b329b57e328e90ceea70c8c6c1b457.tar.xz
org.eclipse.jubula.core-621a1d8118b329b57e328e90ceea70c8c6c1b457.zip
Non-sprint task - minor cleanup + refactoring: typos resolved + generics added.
Diffstat (limited to 'org.eclipse.jubula.rc.swt')
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtHierarchyContainer.java7
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotEventConfirmerSwtImpl.java16
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/utils/SwtUtils.java27
3 files changed, 23 insertions, 27 deletions
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtHierarchyContainer.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtHierarchyContainer.java
index e790939b2..cccd88e22 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtHierarchyContainer.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtHierarchyContainer.java
@@ -53,13 +53,6 @@ public class SwtHierarchyContainer extends HierarchyContainer {
/**
* {@inheritDoc}
*/
- public SwtComponent getComponent(int index) {
- return (SwtComponent)super.getComp(index);
- }
-
- /**
- * {@inheritDoc}
- */
public SwtHierarchyContainer[] getComponents() {
if (super.getComps().length == 0) {
return new SwtHierarchyContainer[0];
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotEventConfirmerSwtImpl.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotEventConfirmerSwtImpl.java
index 878f553e3..edd4e427e 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotEventConfirmerSwtImpl.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotEventConfirmerSwtImpl.java
@@ -72,7 +72,7 @@ class RobotEventConfirmerSwtImpl implements IRobotEventConfirmer,
private IEventMatcher m_eventMatcher;
/** Stores all events of a given class after the confirmer has been enabled. */
- private List m_eventList = new LinkedList();
+ private List<Event> m_eventList = new LinkedList<Event>();
/**
* Creates a new confirmer for a class of events defined by <code>options</code>.
@@ -87,10 +87,10 @@ class RobotEventConfirmerSwtImpl implements IRobotEventConfirmer,
* Logs a list.
* @param list The list.
*/
- private void logList(List list) {
+ private void logList(List<Event> list) {
log.debug("Stored SWTEvents["); //$NON-NLS-1$
- List copy = (List)((LinkedList)list).clone();
- for (Iterator it = copy.iterator(); it.hasNext();) {
+ List<Event> copy = (List<Event>)((LinkedList<Event>)list).clone();
+ for (Iterator<Event> it = copy.iterator(); it.hasNext();) {
Object element = it.next();
log.debug(element);
}
@@ -229,9 +229,9 @@ class RobotEventConfirmerSwtImpl implements IRobotEventConfirmer,
* @param eventList The list of events
* @return <code>true</code> if one or more of the event matches, otherwise <code>false</code>.
*/
- private boolean isEventMatching(List eventList) {
- for (Iterator it = eventList.iterator(); it.hasNext();) {
- Event event = (Event)it.next();
+ private boolean isEventMatching(List<Event> eventList) {
+ for (Iterator<Event> it = eventList.iterator(); it.hasNext();) {
+ Event event = it.next();
if (isEventMatching(event)) {
return true;
}
@@ -245,7 +245,7 @@ class RobotEventConfirmerSwtImpl implements IRobotEventConfirmer,
*/
private void addEventToList(Event event) {
synchronized (m_eventList) {
- ((LinkedList)m_eventList).addFirst(event);
+ ((LinkedList<Event>)m_eventList).addFirst(event);
}
}
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/utils/SwtUtils.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/utils/SwtUtils.java
index 7deac733b..25f9b3e2a 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/utils/SwtUtils.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/utils/SwtUtils.java
@@ -452,7 +452,7 @@ public class SwtUtils {
*/
private static Widget[] getWidgetChildrenImpl(final Widget widget,
final boolean recurse) {
- List<Object> objT = new LinkedList<Object>();
+ List<Widget> objT = new LinkedList<Widget>();
if (widget == null || widget.isDisposed()) {
return new Widget[0];
}
@@ -460,11 +460,12 @@ public class SwtUtils {
objT.add(((Control)widget).getMenu());
}
if (widget instanceof Scrollable) {
- if (((Scrollable)widget).getVerticalBar() != null) {
- objT.add(((Scrollable)widget).getVerticalBar());
+ Scrollable scrollable = (Scrollable) widget;
+ if (scrollable.getVerticalBar() != null) {
+ objT.add(scrollable.getVerticalBar());
}
- if (((Scrollable)widget).getHorizontalBar() != null) {
- objT.add(((Scrollable)widget).getHorizontalBar());
+ if (scrollable.getHorizontalBar() != null) {
+ objT.add(scrollable.getHorizontalBar());
}
}
if (widget instanceof Decorations
@@ -491,11 +492,12 @@ public class SwtUtils {
}
}
if (widget instanceof Table) {
- Widget[] widgets = ((Table)widget).getItems();
+ Table table = (Table) widget;
+ Widget[] widgets = table.getItems();
if (widgets.length != 0) {
objT.addAll(Arrays.asList(widgets));
}
- widgets = ((Table)widget).getColumns();
+ widgets = table.getColumns();
if (widgets.length != 0) {
objT.addAll(Arrays.asList(widgets));
}
@@ -514,7 +516,7 @@ public class SwtUtils {
}
addNonControlChildren(widget, objT);
if (recurse && objT.size() > 0) {
- List extendedFamily = new LinkedList();
+ List<Widget> extendedFamily = new LinkedList<Widget>();
for (int i = 0; i < objT.size(); i++) {
Widget w = (Widget)objT.get(i);
extendedFamily.addAll(Arrays.asList(getWidgetChildrenImpl(
@@ -529,23 +531,24 @@ public class SwtUtils {
* @param widget the non-Control-widget to get the children for
* @param objT linkedList to put the children in
*/
- private static void addNonControlChildren(final Widget widget, List objT) {
+ private static void addNonControlChildren(final Widget widget,
+ List<Widget> objT) {
if (widget instanceof TreeItem) {
Widget[] widgets = ((TreeItem)widget).getItems();
if (widgets.length != 0) {
- ((LinkedList)objT).addAll(Arrays.asList(widgets));
+ objT.addAll(Arrays.asList(widgets));
}
}
if (widget instanceof Menu) {
Widget[] widgets = ((Menu)widget).getItems();
if (widgets.length != 0) {
- ((LinkedList)objT).addAll(Arrays.asList(widgets));
+ objT.addAll(Arrays.asList(widgets));
}
}
if (widget instanceof MenuItem) {
Widget childMenu = ((MenuItem)widget).getMenu();
if (childMenu != null) {
- ((LinkedList)objT).add(childMenu);
+ objT.add(childMenu);
}
}
}

Back to the top