package com.exalttech.trex.ui.controllers.ports.tabs;

import com.exalttech.trex.ui.models.FlowControl;
import com.exalttech.trex.util.Initialization;
import javafx.fxml.FXML;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import org.controlsfx.control.ToggleSwitch;

public class PortAttributes extends BorderPane {
    
    @FXML
    private PortAttributes attributesTab;

    @FXML
    private PortLayerConfiguration layerConfigTab;

    @FXML
    private PortHardwareCounters hardwareCounters;

    @FXML
    Label driver;

    @FXML
    Label rxFilterMode;

    @FXML
    Label multicast;

    @FXML
    Label promiscuousMode;

    @FXML
    Label owner;

    @FXML
    Label speed;

    @FXML
    Label status;

    @FXML
    Label captureStatus;

    @FXML
    ToggleSwitch link;

    @FXML
    ToggleSwitch led;

    @FXML
    ToggleSwitch numaMode;

    @FXML
    Label pciAddress;

    @FXML
    Label gratArp;

    @FXML
    ChoiceBox<FlowControl> flowControl;
    
    public PortAttributes() {
        Initialization.initializeFXML(this, "/fxml/ports/PortAttributes.fxml");
    }
}

@@ -97,16 +97,63 @@
 ontrol;%0A
+import com.exalttech.trex.ui.models.PortModel;%0A
 import c
@@ -454,177 +454,8 @@
 ate 
-PortAttributes attributesTab;%0A%0A    @FXML%0A    private PortLayerConfiguration layerConfigTab;%0A%0A    @FXML%0A    private PortHardwareCounters hardwareCounters;%0A%0A    @FXML%0A    
 Labe
@@ -474,24 +474,32 @@
    @FXML%0A   
+ private
  Label rxFil
@@ -522,21 +522,36 @@
 XML%0A    
-Label
+private ToggleSwitch
  multica
@@ -569,21 +569,36 @@
 XML%0A    
-Label
+private ToggleSwitch
  promisc
@@ -618,24 +618,32 @@
   @FXML%0A    
+private 
 Label owner;
@@ -654,24 +654,32 @@
   @FXML%0A    
+private 
 Label speed;
@@ -690,24 +690,32 @@
   @FXML%0A    
+private 
 Label status
@@ -727,24 +727,32 @@
   @FXML%0A    
+private 
 Label captur
@@ -767,32 +767,40 @@
 %0A%0A    @FXML%0A    
+private 
 ToggleSwitch lin
@@ -809,32 +809,40 @@
 %0A%0A    @FXML%0A    
+private 
 ToggleSwitch led
@@ -858,28 +858,29 @@
 XML%0A    
-ToggleSwitch
+private Label
  numaMod
@@ -893,24 +893,32 @@
   @FXML%0A    
+private 
 Label pciAdd
@@ -938,16 +938,24 @@
 XML%0A    
+private 
 Label gr
@@ -976,16 +976,24 @@
 XML%0A    
+private 
 ChoiceBo
@@ -1140,11 +1140,1618 @@
 );%0A    %7D
+%0A%0A    public void bindModel(PortModel model) %7B%0A        unbindPrevious();%0A        %0A        driver.textProperty().bind(model.portDriverProperty());%0A        rxFilterMode.textProperty().bind(model.rxFilterModeProperty());%0A        multicast.selectedProperty().bindBidirectional(model.multicastProperty());%0A        promiscuousMode.selectedProperty().bindBidirectional(model.promiscuousModeProperty());%0A        owner.textProperty().bind(model.ownerProperty());%0A        speed.textProperty().bind(model.ownerProperty());%0A        status.textProperty().bind(model.portStatusProperty());%0A        captureStatus.textProperty().bind(model.capturingModeProperty());%0A        link.selectedProperty().bindBidirectional(model.linkStatusProperty());%0A        led.selectedProperty().bindBidirectional(model.ledStatusProperty());%0A        numaMode.textProperty().bind(model.numaModeProperty());%0A        pciAddress.textProperty().bind(model.numaModeProperty());%0A        gratArp.textProperty().bind(model.gratARPProperty());%0A    %7D%0A%0A    private void unbindPrevious() %7B%0A        driver.textProperty().unbind();%0A        rxFilterMode.textProperty().unbind();%0A        multicast.selectedProperty().unbind();%0A        promiscuousMode.selectedProperty().unbind();%0A        owner.textProperty().unbind();%0A        speed.textProperty().unbind();%0A        status.textProperty().unbind();%0A        captureStatus.textProperty().unbind();%0A        link.selectedProperty().unbind();%0A        led.selectedProperty().unbind();%0A        numaMode.textProperty().unbind();%0A        pciAddress.textProperty().unbind();%0A        gratArp.textProperty().unbind();%0A    %7D
 %0A%7D%0A

Add binding for port attribute controls