/**
  * @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;
     }
   }
 }
  /** 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();
    }
  }