use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.
the class PreferencesController method selectTemplatesLocation.
/**
* Select save location choose button click handler
*
* @param event
*/
@FXML
public void selectTemplatesLocation(ActionEvent event) {
chooser.setTitle("Templates Directory");
File templatesDirectory = new File(templatesLocation.getText());
if (!Util.isNullOrEmpty(templatesLocation.getText()) && templatesDirectory.exists()) {
chooser.setInitialDirectory(new File(templatesLocation.getText()));
}
File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
if (location != null) {
templatesLocation.setText(location.getAbsolutePath());
}
}
use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.
the class PreferencesController method handleOKBtnClicked.
/**
* Handle OK button clicked
*
* @param event
*/
@FXML
public void handleOKBtnClicked(final MouseEvent event) {
Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
savePreferences(stage);
}
use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.
the class PreferencesController method selectSavedLocation.
/**
* Select save location choose button click handler
*
* @param event
*/
@FXML
public void selectSavedLocation(ActionEvent event) {
chooser.setTitle("Save Location Directory");
File locationDirectory = new File(savedLocation.getText());
if (!Util.isNullOrEmpty(savedLocation.getText()) && locationDirectory.exists()) {
chooser.setInitialDirectory(new File(savedLocation.getText()));
}
File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
if (location != null) {
savedLocation.setText(location.getAbsolutePath());
}
}
use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.
the class PreferencesController method selectLoadLocation.
/**
* Select load location choose button click handler
*
* @param event
*/
@FXML
public void selectLoadLocation(ActionEvent event) {
chooser.setTitle("Load Location Directory");
File locationDirectory = new File(loadLocation.getText());
if (!Util.isNullOrEmpty(loadLocation.getText()) && locationDirectory.exists()) {
chooser.setInitialDirectory(new File(loadLocation.getText()));
}
File location = chooser.showDialog(((Button) (event.getSource())).getScene().getWindow());
if (location != null) {
loadLocation.setText(location.getAbsolutePath());
}
}
use of javafx.fxml.FXML in project trex-stateless-gui by cisco-system-traffic-generator.
the class ProfileStreamNameDialogController method handleOKBtnClicked.
/**
* Handle OK button clicked
*
* @param event
*/
@FXML
public void handleOKBtnClicked(ActionEvent event) {
Node node = (Node) event.getSource();
Stage stage = (Stage) node.getScene().getWindow();
doCreating(stage);
}
Aggregations