Пример #1
0
  private void reset() {
    Log.debug("DhcpNatConfigTab: reset()");
    m_modeCombo.setSimpleValue(MessageUtils.get(GwtNetRouterMode.netRouterOff.name()));
    m_modeCombo.setOriginalValue(m_modeCombo.getValue());

    m_dhcpBeginAddressField.setValue("");
    m_dhcpBeginAddressField.setOriginalValue(m_dhcpBeginAddressField.getValue());

    m_dhcpEndAddressField.setValue("");
    m_dhcpEndAddressField.setOriginalValue(m_dhcpEndAddressField.getValue());

    m_dhcpSubnetMaskField.setValue("");
    m_dhcpSubnetMaskField.setOriginalValue(m_dhcpSubnetMaskField.getValue());

    m_dhcpLeaseDefaultField.setValue(0);
    m_dhcpLeaseDefaultField.setOriginalValue(m_dhcpLeaseDefaultField.getValue());

    m_dhcpLeaseMaxField.setValue(0);
    m_dhcpLeaseMaxField.setOriginalValue(m_dhcpLeaseMaxField.getValue());

    m_passDnsRadioTrue.setValue(false);
    m_passDnsRadioTrue.setOriginalValue(m_passDnsRadioTrue.getValue());

    m_passDnsRadioFalse.setValue(true);
    m_passDnsRadioFalse.setOriginalValue(m_passDnsRadioFalse.getValue());

    m_passDnsRadioGroup.setValue(m_passDnsRadioFalse);
    m_passDnsRadioGroup.setOriginalValue(m_passDnsRadioGroup.getValue());

    update();
  }
 private boolean checkEndFieldValue() {
   boolean condition = false;
   if (this.checkStartFieldValue() && endFilterNumberField.getValue() != null) {
     int fromFilter = startFilterNumberField.getValue().intValue();
     int toFilter = endFilterNumberField.getValue().intValue();
     //            System.out.println("To filter: " + toFilter);
     if (toFilter < fromFilter && toFilter >= 0) {
       condition = true;
     }
   }
   return condition;
 }
 private boolean checkStartFieldValue() {
   boolean condition = false;
   //        System.out.println("Start store size: " + startStore.getModels().size());
   if (startFilterNumberField.getValue() != null) {
     int fromFilter = startFilterNumberField.getValue().intValue();
     //            System.out.println("From filter: " + fromFilter);
     if (fromFilter >= 0 && fromFilter <= startStore.getModels().size() - 1) {
       condition = true;
     }
   }
   return condition;
 }
  public double getCost() {
    double value = 0.0;
    Number number = costField.getValue();
    if (number != null) {
      value = number.doubleValue();
    }

    return value;
  }
Пример #5
0
  public void getUpdatedNetInterface(GwtNetInterfaceConfig updatedNetIf) {
    if (m_formPanel != null) {
      String modeValue = m_modeCombo.getValue().getValue();
      for (GwtNetRouterMode mode : GwtNetRouterMode.values()) {
        Log.info("Possible Mode: " + mode.name() + " with util: " + MessageUtils.get(mode.name()));
        if (MessageUtils.get(mode.name()).equals(modeValue)) {
          updatedNetIf.setRouterMode(mode.name());
        }
      }
      Log.info("Mode Value: " + modeValue);

      updatedNetIf.setRouterDhcpBeginAddress(m_dhcpBeginAddressField.getValue());
      updatedNetIf.setRouterDhcpEndAddress(m_dhcpEndAddressField.getValue());
      updatedNetIf.setRouterDhcpSubnetMask(m_dhcpSubnetMaskField.getValue());
      if (m_dhcpLeaseDefaultField.getValue() != null) {
        updatedNetIf.setRouterDhcpDefaultLease(m_dhcpLeaseDefaultField.getValue().intValue());
      }
      if (m_dhcpLeaseMaxField.getValue() != null) {
        updatedNetIf.setRouterDhcpMaxLease(m_dhcpLeaseMaxField.getValue().intValue());
      }
      updatedNetIf.setRouterDnsPass(m_passDnsRadioTrue.getValue());
    }
  }
Пример #6
0
  private void update() {
    if (m_selectNetIfConfig != null) {
      Log.debug(
          "in update(): got new netIfConfig for DHCP server for "
              + m_selectNetIfConfig.getName()
              + ": "
              + "\n\t\trouter mode: "
              + m_selectNetIfConfig.getRouterMode()
              + "\n\t\trouter DHCP start address: "
              + m_selectNetIfConfig.getRouterDhcpBeginAddress()
              + "\n\t\trouter DHCP end address: "
              + m_selectNetIfConfig.getRouterDhcpEndAddress()
              + "\n\t\trouter default lease: "
              + Integer.toString(m_selectNetIfConfig.getRouterDhcpDefaultLease())
              + "\n\t\trouter max lease: "
              + Integer.toString(m_selectNetIfConfig.getRouterDhcpMaxLease())
              + "\n\t\trouter Pass DNS: "
              + Boolean.toString(m_selectNetIfConfig.getRouterDnsPass()));

      m_modeCombo.setSimpleValue(MessageUtils.get(m_selectNetIfConfig.getRouterMode()));
      m_modeCombo.setOriginalValue(m_modeCombo.getValue());

      m_dhcpBeginAddressField.setValue(m_selectNetIfConfig.getRouterDhcpBeginAddress());
      m_dhcpBeginAddressField.setOriginalValue(m_dhcpBeginAddressField.getValue());

      m_dhcpEndAddressField.setValue(m_selectNetIfConfig.getRouterDhcpEndAddress());
      m_dhcpEndAddressField.setOriginalValue(m_dhcpEndAddressField.getValue());

      m_dhcpSubnetMaskField.setValue(m_selectNetIfConfig.getRouterDhcpSubnetMask());
      m_dhcpSubnetMaskField.setOriginalValue(m_dhcpSubnetMaskField.getValue());

      m_dhcpLeaseDefaultField.setValue(m_selectNetIfConfig.getRouterDhcpDefaultLease());
      m_dhcpLeaseDefaultField.setOriginalValue(m_dhcpLeaseDefaultField.getValue());

      m_dhcpLeaseMaxField.setValue(m_selectNetIfConfig.getRouterDhcpMaxLease());
      m_dhcpLeaseMaxField.setOriginalValue(m_dhcpLeaseMaxField.getValue());

      if (m_selectNetIfConfig.getRouterDnsPass()) {
        m_passDnsRadioTrue.setValue(true);
        m_passDnsRadioTrue.setOriginalValue(m_passDnsRadioTrue.getValue());

        m_passDnsRadioFalse.setValue(false);
        m_passDnsRadioFalse.setOriginalValue(m_passDnsRadioFalse.getValue());

        m_passDnsRadioGroup.setOriginalValue(m_passDnsRadioTrue);
        m_passDnsRadioGroup.setValue(m_passDnsRadioGroup.getValue());
      } else {
        m_passDnsRadioTrue.setValue(false);
        m_passDnsRadioTrue.setOriginalValue(m_passDnsRadioTrue.getValue());

        m_passDnsRadioFalse.setValue(true);
        m_passDnsRadioFalse.setOriginalValue(m_passDnsRadioFalse.getValue());

        m_passDnsRadioGroup.setOriginalValue(m_passDnsRadioFalse);
        m_passDnsRadioGroup.setValue(m_passDnsRadioGroup.getValue());
      }
    } else {
      Log.debug("selected Network Interface Config is null");
    }

    for (Field<?> field : m_formPanel.getFields()) {
      FormUtils.removeDirtyFieldIcon(field);
    }

    refreshForm();
  }