Search in sources :

Example 1 with ProfileStreamNameDialogController

use of com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController in project trex-stateless-gui by cisco-system-traffic-generator.

the class PacketTableView method viewStreamNameWindow.

/**
     * View stream name window
     *
     * @param type
     */
private void viewStreamNameWindow(StreamBuilderType type) {
    try {
        Stage currentStage = (Stage) streamPacketTableView.getScene().getWindow();
        DialogWindow profileNameWindow = new DialogWindow("ProfileStreamNameDialog.fxml", "Add Stream", 150, 100, false, currentStage);
        ProfileStreamNameDialogController controller = (ProfileStreamNameDialogController) profileNameWindow.getController();
        controller.setProfileList(tabledata.getProfiles());
        controller.setProfileWindow(false);
        profileNameWindow.show(true);
        if (controller.isDataAvailable()) {
            String streamName = controller.getName();
            handleAddPacket(streamName, type);
        }
    } catch (IOException ex) {
        LOG.error("Error adding new stream", ex);
    }
}
Also used : Stage(javafx.stage.Stage) ProfileStreamNameDialogController(com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController) IOException(java.io.IOException) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow)

Example 2 with ProfileStreamNameDialogController

use of com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController in project trex-stateless-gui by cisco-system-traffic-generator.

the class ProfileManager method createNewProfile.

/**
     *
     * @param currentStage
     * @return
     * @throws IOException
     */
public String createNewProfile(Stage currentStage) throws IOException {
    String profileName = "";
    DialogWindow profileNameWindow = new DialogWindow("ProfileStreamNameDialog.fxml", "Create Profile", 150, 100, false, currentStage);
    ProfileStreamNameDialogController controller = (ProfileStreamNameDialogController) profileNameWindow.getController();
    controller.setProfileWindow(true);
    profileNameWindow.show(true);
    if (controller.isDataAvailable()) {
        profileName = controller.getName() + ".yaml";
        File newFile = FileManager.createNewFile(profileName);
        updateProfilesList(newFile, true);
    }
    return profileName;
}
Also used : ProfileStreamNameDialogController(com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController) DialogWindow(com.exalttech.trex.ui.dialog.DialogWindow) File(java.io.File)

Aggregations

ProfileStreamNameDialogController (com.exalttech.trex.ui.controllers.ProfileStreamNameDialogController)2 DialogWindow (com.exalttech.trex.ui.dialog.DialogWindow)2 File (java.io.File)1 IOException (java.io.IOException)1 Stage (javafx.stage.Stage)1