Package fr.soleil.globalscreen.tangowidget.attribute

Examples of fr.soleil.globalscreen.tangowidget.attribute.AttributeBooleanComboBox


    final boolean initialValue = true;
    m_deviceProxy.write_attribute(new DeviceAttribute(attributeName,
        initialValue));

    final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(
        m_deviceName, attributeName).alarmEnable(false).jframe(jf1)
        .confirmation(true).build();
    Sleeper.SECONDS.sleep(2);

    // Changement de state
    switchComboBoxState(widget);

    final JDialog fd = tth.findDialog("Confirmation");

    if (withCancel) {
      // init device
      tth.rejectDialog(fd);
      Assert.assertTrue("reject confirmation failed",
          m_deviceProxy.read_attribute(attributeName)
              .extractBoolean() == initialValue);
    } else {
      // Valider la confirmation
      validateConfirmation("");
      Assert.assertTrue(
          "Write failed",
          waitBooleanValue(m_deviceProxy, attributeName,
              !initialValue, 5000));
    }

    widget.stop();
    jf1.dispose();
  }
View Full Code Here


    // Initialiser le composant
    initFirstDevice();
    final String attributeName = "boolean_scalar_rw";

    final AttributeBooleanComboBox widget = new AttributeBooleanComboBox.Builder(
        m_deviceName, attributeName).defaultValue(!isTrueLabel)
        .jframe(jf1).build();
    Sleeper.SECONDS.sleep(2);

    if (isTrueLabel) {

      final String trueLabel = "TRUE_LABEL";
      widget.setTrueLabel(trueLabel);

      m_deviceProxy.write_attribute(new DeviceAttribute(attributeName,
          isTrueLabel));
      Sleeper.SECONDS.sleep(2);

      final JComboBox combobox = getComboBox(jf1);

      final Object selectedItem = combobox.getSelectedItem();
      final String selectedValue = (String) selectedItem;
      Assert.assertTrue(
          "The label for 'true' value is not correctly modified",
          trueLabel.equals(selectedValue));

    } else {
      final String falseLabel = "FALSE_LABEL";
      widget.setFalseLabel(falseLabel);

      m_deviceProxy.write_attribute(new DeviceAttribute(attributeName,
          isTrueLabel));
      Sleeper.SECONDS.sleep(2);

      final JComboBox combobox = getComboBox(jf1);

      final Object selectedItem = combobox.getSelectedItem();
      final String selectedValue = (String) selectedItem;
      Assert.assertTrue(
          "The label for 'false' value is not correctly modified",
          falseLabel.equals(selectedValue));
    }

    widget.stop();
    jf1.dispose();
  }
View Full Code Here

TOP

Related Classes of fr.soleil.globalscreen.tangowidget.attribute.AttributeBooleanComboBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.