コード例 #1
0
  public void setNetInterface(GwtNetInterfaceConfig netIfConfig) {
    m_dirty = true;
    m_selectNetIfConfig = netIfConfig;

    Log.debug(
        "got new netIfConfig for DHCP server for "
            + netIfConfig.getName()
            + ": "
            + "\n\t\trouter mode: "
            + netIfConfig.getRouterMode()
            + "\n\t\trouter DHCP start address: "
            + netIfConfig.getRouterDhcpBeginAddress()
            + "\n\t\trouter DHCP end address: "
            + netIfConfig.getRouterDhcpEndAddress()
            + "\n\t\trouter default lease: "
            + Integer.toString(netIfConfig.getRouterDhcpDefaultLease())
            + "\n\t\trouter max lease: "
            + Integer.toString(netIfConfig.getRouterDhcpMaxLease())
            + "\n\t\trouter Pass DNS: "
            + Boolean.toString(netIfConfig.getRouterDnsPass()));
  }
コード例 #2
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();
  }