Пример #1
0
  private void delInternetAddress() {
    InternetAddress address = _selectedAdress;
    if (address == null || _hostTF.getText().trim().length() == 0) return;

    my(InternetAddressKeeper.class).remove(address);
    _inetAddressesList.clearSelection();
  }
Пример #2
0
  private void saveInternetAddress() {
    try {
      InternetAddress address = _selectedAdress;
      if (address == null || _hostTF.getText().trim().length() == 0) return;

      if (_selectedAdress.host().equals(_hostTF.getText())
          && _selectedAdress.port().currentValue() == Integer.parseInt(_portTF.getText())
          && _selectedAdress.contact() == my(ContactsGui.class).selectedContact().currentValue()) {

        _inetAddressesList.clearSelection();
        return;
      }

      newInternetAddress();
      my(InternetAddressKeeper.class).remove(address);
      _inetAddressesList.clearSelection();
    } catch (NumberFormatException e) {
      logPortValueException(e);
    }
  }
Пример #3
0
  private void newInternetAddress() {
    try {
      String host = _hostTF.getText();
      if (host == null || host.trim().length() == 0) return;

      int port = Integer.parseInt(_portTF.getText());
      my(InternetAddressKeeper.class).add(selectedContact(), host, port);

      _inetAddressesList.clearSelection();
      cleanFields();
    } catch (NumberFormatException e) {
      logPortValueException(e);
    }
  }
Пример #4
0
 private JList addresses() {
   return _inetAddressesList.getMainWidget();
 }