use of com.exalttech.trex.ui.controllers.PacketBuilderHomeController in project trex-stateless-gui by cisco-system-traffic-generator.
the class PacketTableView method openStreamDialog.
/**
* open stream properties
*/
private void openStreamDialog(StreamBuilderType type) {
try {
TableProfileStream data = streamPacketTableView.getSelectionModel().getSelectedItem();
if ("0".equals(data.getLength()) && !Util.isConfirmed("Problem reading file, Do you want to continue anyway ?")) {
return;
}
setStreamEditingWindowOpen(true);
Stage currentStage = (Stage) streamPacketTableView.getScene().getWindow();
String windowTitle = "Edit Stream (" + data.getName() + ")";
DialogWindow srteamWindow = new DialogWindow("PacketBuilderHome.fxml", windowTitle, 40, 30, false, currentStage);
PacketBuilderHomeController controller = (PacketBuilderHomeController) srteamWindow.getController();
boolean streaminited = false;
switch(type) {
case EDIT_STREAM:
streaminited = controller.initStreamBuilder(data.getPcapBinary(), tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.EDIT_STREAM);
break;
case ADD_STREAM:
streaminited = controller.initStreamBuilder(null, tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.ADD_STREAM);
break;
case BUILD_STREAM:
streaminited = controller.initStreamBuilder(null, tabledata.getProfiles(), streamPacketTableView.getSelectionModel().getSelectedIndex(), tabledata.getYamlFileName(), StreamBuilderType.BUILD_STREAM);
break;
default:
break;
}
if (streaminited) {
srteamWindow.show(true);
} else {
LOG.error("Error while initing editor dialog");
}
} catch (IOException ex) {
LOG.error("Error opening file", ex);
}
}
Aggregations