/** 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();
    }
  }
 /**
  * @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;
     }
   }
 }
コード例 #3
0
 /**
  * @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;
     }
   }
 }
コード例 #4
0
  /** Initialize the fields in this editor. */
  protected void initialize() {
    if (ports == null) return;

    ports.removeAll();

    Iterator iterator = tomcatConfiguration.getServerPorts().iterator();
    while (iterator.hasNext()) {
      ServerPort port = (ServerPort) iterator.next();
      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);
      item.setImage(TomcatUIPlugin.getImage(TomcatUIPlugin.IMG_PORT));
      item.setData(port);
    }

    if (readOnly) {
      viewer.setCellEditors(new CellEditor[] {null, null});
      viewer.setCellModifier(null);
    } else {
      setupPortEditors();
    }
  }