/** * Set the number of loops which should be reflected in the GUI. The * loopCount parameter should contain the String representation of an * integer. This integer will be treated as the number of loops. If this * integer is less than 0, the number of loops will be assumed to be * infinity. * * @param loopCount * the String representation of the number of loops */ private void setState(String loopCount) { if (loopCount.startsWith("-")) { // $NON-NLS-1$ setState(LoopController.INFINITE_LOOP_COUNT); } else { loops.setText(loopCount); infinite.setSelected(false); loops.setEnabled(true); } }
/** * Create a new LoopControlPanel as either a standalone or an embedded * component. * * @param displayName * indicates whether or not this component should display its * name. If true, this is a standalone component. If false, this * component is intended to be used as a subpanel for another * component. */ public LoopControlPanel(boolean displayName) { this.displayName = displayName; init(); setState(1); }
/** * A newly created component can be initialized with the contents of a Test * Element object by calling this method. The component is responsible for * querying the Test Element object for the relevant information to display * in its GUI. * * @param element * the TestElement to configure */ @Override public void configure(TestElement element) { super.configure(element); if (element instanceof LoopController) { setState(((LoopController) element).getLoopString()); } else { setState(1); } }