/** Initialize the fields in this editor. */
  protected void initialize() {
    if (ports == null) return;

    ports.removeAll();
    CarbonServer31Utils.isServerStartBrowserPopup(server.getOriginal());
    ServerPort[] serverPorts =
        ServerController.getInstance().getServerManager().getServerPorts(server.getOriginal());
    for (ServerPort serverPort : serverPorts) {
      ServerPort port = serverPort;
      TableItem item = new TableItem(ports, SWT.NONE);
      String portStr = "-";
      if (port.getPort() >= 0) portStr = port.getPort() + "";
      String[] s = new String[] {port.getName(), portStr};
      item.setText(s);
      int i = CarbonServerConstants.PORT_CAPTIONS.indexOf(port.getName());
      if (i != -1) {
        port =
            new ServerPort(
                CarbonServerConstants.PORT_IDS.get(i),
                port.getName(),
                port.getPort(),
                port.getProtocol());
      }
      item.setData(port);
    }

    if (readOnly) {
      viewer.setCellEditors(new CellEditor[] {null, null});
      viewer.setCellModifier(null);
    } else {
      setupPortEditors();
    }
  }
 public Map<String, Integer> getServerPorts(String serverId) throws Exception {
   Map<String, Integer> result = new HashMap<String, Integer>();
   IServer server = getServer(serverId);
   if (server != null) {
     ServerPort[] serverPorts2 = getServerPorts(server);
     if (serverPorts2 != null)
       for (ServerPort s : serverPorts2) {
         result.put(s.getProtocol(), s.getPort());
       }
   }
   return result;
 }
 public static String getServerAuthenticatedCookie(IServer server) throws Exception {
   String result = null;
   if (server != null) {
     ServerPort[] serverPorts = getInstance().getServerPorts(server);
     String httpsPort = "9443";
     for (ServerPort port : serverPorts) {
       if (port.getProtocol().equalsIgnoreCase("https")) {
         httpsPort = Integer.toString(port.getPort());
       }
     }
     result = getServerAuthenticatedCookie(server, httpsPort);
   }
   return result;
 }
 /**
  * @param name java.lang.String
  * @param port int
  */
 protected void changePortNumber(String name, int port) {
   TableItem[] items = ports.getItems();
   int size = items.length;
   for (int i = 0; i < size; i++) {
     ServerPort sp = (ServerPort) items[i].getData();
     if (sp.getName().equals(name)) {
       items[i].setData(new ServerPort(sp.getId(), sp.getName(), port, sp.getProtocol()));
       items[i].setText(1, port + "");
       CarbonServer31Utils.setServerConfigMapValue(server.getOriginal(), sp.getId(), port + "");
       CarbonServer31Utils.updateTransportXML(server.getOriginal());
       CarbonServer31Utils.updateAxis2XML(server.getOriginal());
       return;
     }
   }
 }
 /**
  * @param id java.lang.String
  * @param port int
  */
 protected void changePortNumber(String id, int port) {
   TableItem[] items = ports.getItems();
   int size = items.length;
   for (int i = 0; i < size; i++) {
     ServerPort sp = (ServerPort) items[i].getData();
     if (sp.getId().equals(id)) {
       items[i].setData(new ServerPort(id, sp.getName(), port, sp.getProtocol()));
       items[i].setText(1, port + "");
       /*if (i == selection) {
       	selectPort();
       }*/
       return;
     }
   }
 }