예제 #1
0
 @Action
 public void encodingSelectionChanged(final NSPopUpButton sender) {
   log.debug("encodingSelectionChanged:" + sender);
   if (sender.selectedItem().title().equals(DEFAULT)) {
     host.setEncoding(null);
   } else {
     host.setEncoding(sender.selectedItem().title());
   }
   this.itemChanged();
 }
예제 #2
0
 @Action
 public void transferPopupClicked(final NSPopUpButton sender) {
   if (sender.selectedItem().title().equals(DEFAULT)) {
     host.setMaxConnections(null);
   } else if (sender.selectedItem().title().equals(TRANSFER_BROWSERCONNECTION)) {
     host.setMaxConnections(1);
   } else if (sender.selectedItem().title().equals(TRANSFER_NEWCONNECTION)) {
     host.setMaxConnections(-1);
   }
   this.itemChanged();
 }
예제 #3
0
 @Action
 public void connectmodePopupClicked(final NSPopUpButton sender) {
   if (sender.selectedItem().title().equals(DEFAULT)) {
     host.setFTPConnectMode(null);
   } else if (sender.selectedItem().title().equals(CONNECTMODE_ACTIVE)) {
     host.setFTPConnectMode(FTPConnectMode.PORT);
   } else if (sender.selectedItem().title().equals(CONNECTMODE_PASSIVE)) {
     host.setFTPConnectMode(FTPConnectMode.PASV);
   }
   this.itemChanged();
 }
예제 #4
0
 @Action
 public void protocolSelectionChanged(final NSPopUpButton sender) {
   log.debug("protocolSelectionChanged:" + sender);
   final Protocol selected =
       ProtocolFactory.forName(protocolPopup.selectedItem().representedObject());
   host.setPort(selected.getDefaultPort());
   if (!host.getProtocol().isHostnameConfigurable()) {
     // Previously selected protocol had a default hostname. Change to default
     // of newly selected protocol.
     host.setHostname(selected.getDefaultHostname());
   }
   if (!selected.isHostnameConfigurable()) {
     // Hostname of newly selected protocol is not configurable. Change to default.
     host.setHostname(selected.getDefaultHostname());
   }
   if (StringUtils.isNotBlank(selected.getDefaultHostname())) {
     // Prefill with default hostname
     host.setHostname(selected.getDefaultHostname());
   }
   if (!selected.isWebUrlConfigurable()) {
     host.setWebURL(null);
   }
   host.setProtocol(selected);
   this.itemChanged();
   this.init();
   this.reachable();
 }
예제 #5
0
 @Action
 public void timezonePopupClicked(NSPopUpButton sender) {
   String selected = sender.selectedItem().representedObject();
   if (selected.equals(AUTO)) {
     host.setTimezone(null);
   } else {
     String[] ids = TimeZone.getAvailableIDs();
     for (String id : ids) {
       TimeZone tz;
       if ((tz = TimeZone.getTimeZone(id)).getID().equals(selected)) {
         host.setTimezone(tz);
         break;
       }
     }
   }
   this.itemChanged();
 }