Package eu.simuline.testhelpers
Class GUIRunner.TabChangeListener
- java.lang.Object
-
- eu.simuline.testhelpers.GUIRunner.TabChangeListener
-
- All Implemented Interfaces:
java.util.EventListener
,javax.swing.event.ChangeListener
- Enclosing class:
- GUIRunner
static class GUIRunner.TabChangeListener extends java.lang.Object implements javax.swing.event.ChangeListener
A listener to the switching of a tab in the foreground; the other in the background.
-
-
Field Summary
Fields Modifier and Type Field Description private static GUIRunner.Selector
EMPTY_SELECTOR
Registered with the unselected Selector.private static int
SEL_IND1
The index of the tab selected initially.private GUIRunner.Selector[]
selectors
private javax.swing.JTabbedPane
tabbedPane
-
Constructor Summary
Constructors Constructor Description TabChangeListener(javax.swing.JTabbedPane tabbedPane, GUIRunner.TestCaseLister testCaseLister, GUIRunner.HierarchyWrapper testHierarchy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
setSelUnSel(int index)
Makes the tab with the given index in the foreground and the other one in the background.void
stateChanged(javax.swing.event.ChangeEvent che)
-
-
-
Field Detail
-
SEL_IND1
private static final int SEL_IND1
The index of the tab selected initially. This may be 0 or 1. Note that the failure list is the 0th tab for some reason as seen fromGUIRunner.setCenter(Actions)
. It must be the one initially in the foreground.- See Also:
- Constant Field Values
-
EMPTY_SELECTOR
private static final GUIRunner.Selector EMPTY_SELECTOR
Registered with the unselected Selector.
-
tabbedPane
private final javax.swing.JTabbedPane tabbedPane
-
selectors
private final GUIRunner.Selector[] selectors
-
-
Constructor Detail
-
TabChangeListener
TabChangeListener(javax.swing.JTabbedPane tabbedPane, GUIRunner.TestCaseLister testCaseLister, GUIRunner.HierarchyWrapper testHierarchy)
-
-
Method Detail
-
setSelUnSel
private void setSelUnSel(int index)
Makes the tab with the given index in the foreground and the other one in the background. This must be invoked with the index of the tab initially in the foreground and if the tab is changed, this methd must be invoked accordingly.As described for
GUIRunner.Selector.registerSelector(GUIRunner.Selector)
, the tab in the foreground receives its selection events directly, whereas the one in the background must be registered at the one in the foreground to receive the according selections. For sake of unification, the one in the background also sends selection events to the one which is registered, but this is justEMPTY_SELECTOR
.- Parameters:
index
- the index of the tab/Selector in the foreground. This may be either 0 or 1.
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent che)
- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
-
-