public NetworkInterfaceSummary(String srvId, String vmId, NetworkInterfaceOut nicOut) {
    super(new MigLayout("ins 0"));
    this.srvId = srvId;
    this.vmId = vmId;
    this.nicOut = nicOut;

    nicValue =
        JTextFieldUtils.createAsLabel(
            nicOut.getAdapterType()
                + " using "
                + nicOut.getAttachMode()
                + (AxStrings.isEmpty(nicOut.getAttachName())
                    ? ""
                    : " on " + nicOut.getAttachName()));
    ipv4Value = JTextFieldUtils.createAsLabel(nicOut.getMacAddress());
    add(new JLabel("Adapter " + (nicOut.getNicId() + 1)));
    add(new JLabel(""), "growx,pushx,wrap");
    add(new JLabel(""));
    add(nicValue, "right, growx, pushx, wrap");
    add(new JLabel(""));
    add(ipv4Value, "right, growx, pushx, wrap");
    refresh();
  }
예제 #2
0
 @Override
 public String toString() {
   return AxStrings.isEmpty(getLabel()) ? getId() : getLabel();
 }