Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Some controls are not mappable in Jubula for javafx
Some controls are not mappable in Jubula for javafx [message #1703840] Wed, 05 August 2015 10:08 Go to next message
Thomas Mortimer is currently offline Thomas MortimerFriend
Messages: 18
Registered: July 2015
Junior Member
Hi all,

I have two controls that I'm attempting to map in Jubula testing:
DatePicker

I currently cannot map a datepicker text field. I've seen the bug logged here and am aware there is a fix coming up, but am unsure which version of Jubula this will be available in.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429006

Do you know which version I need to be able to get access to the hot fix?


ButtonType

With JavaFX 9 there comes a new button called ButtonType:
http://download.java.net/jdk9/jfxdocs/javafx/scene/control/ButtonType.html

It deals with the creation of dialogs and allows a programmer to create a confirm and cancel button. This does not appear to be mappable in Jubula at the moment. Other controls on a dialog (Like textfield) work fine.

The code for creating such a dialog:
public void showSetDateAndTimeDialog(){
		DtDateAndTime currentDateAndTime;
		try {
			checkConnectionOK();
			currentDateAndTime = systemstateController.getServerDateTime();
			/*
			 * Creating controls to be used in the popup dialog
			 */
			Dialog<DtDateAndTime> dialog = new Dialog<DtDateAndTime>();
			dialog.setTitle("Set system time and date");
			dialog.setResizable(false);
			DatePicker dtpckr = new DatePicker();
			dtpckr.setMaxWidth(100);
			
			dtpckr.setValue(LocalDate.parse(currentDateAndTime.date.toString(), DateTimeFormatter.ofPattern("yyyy/MM/dd")));
			Label lblDate = new Label("Select a date:");
			Label lblTimeHour = new Label("Select an hour:");
			Label lblTimeMinute = new Label("Select a minute:");
			Label lblTimeSecond = new Label("Select a second:");
			TextField txtfldCurrentSetSecond = new TextField();
			TextField txtfldCurrentSetMinute = new TextField();
			TextField txtfldCurrentSetHour = new TextField();
			//ComboBox<String> cmbxHourPicker = getComboBox(100, ComboBoxType.Hour);
			//ComboBox<String> cmbxMinutePicker = getComboBox(100, ComboBoxType.Minute);
			Slider sldrHourPicker = getSlider(100, SliderType.Hour, txtfldCurrentSetHour, currentDateAndTime.time);
			Slider sldrMinutePicker = getSlider(100, SliderType.Minute, txtfldCurrentSetMinute, currentDateAndTime.time);
			Slider sldrSecondPicker = getSlider(100, SliderType.Second, txtfldCurrentSetSecond, currentDateAndTime.time);
			/*
			 * Adding a grid pane to keep controls in correct place and aligned correctly
			 */
			GridPane grdpn = new GridPane();
			grdpn.add(lblDate, 1, 1);
			grdpn.add(dtpckr, 2, 1);
			grdpn.add(lblTimeHour, 1, 2);
			grdpn.add(sldrHourPicker, 2, 2);
			grdpn.add(txtfldCurrentSetHour, 3, 2);
			grdpn.add(lblTimeMinute, 1, 3);
			grdpn.add(sldrMinutePicker, 2, 3);
			grdpn.add(txtfldCurrentSetMinute, 3, 3);
			grdpn.add(lblTimeSecond, 1, 4);
			grdpn.add(sldrSecondPicker, 2, 4);
			grdpn.add(txtfldCurrentSetSecond, 3, 4);
			dialog.getDialogPane().setContent(grdpn);
			/*
			 * Creating buttons for user to press
			 */
			ButtonType bttntypOK = new ButtonType("OK", ButtonData.OK_DONE);
			ButtonType bttntypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE);		
			dialog.getDialogPane().getButtonTypes().add(bttntypeCancel);
			dialog.getDialogPane().getButtonTypes().add(bttntypOK);
			/*
			 * End of creating controls to be used in the popup dialog
			 */
			/*
			 * Creating a method to convert the result from the popup box to the object DtDateAndTime
			 * This will be called upon the user pressing the cancel, ok or closing the popup window
			 */
			dialog.setResultConverter(new Callback<ButtonType, DtDateAndTime>(){
				@Override
				public DtDateAndTime call(ButtonType param) {
					/*
					 * Make sure the user entered all information and pressed the OK button
					 */
					if(param == bttntypOK && checkIfAllDialogHasBeenFilledIn(grdpn)){
						int hour = (int)Math.floor(sldrHourPicker.getValue());
						int minute = (int)Math.floor(sldrMinutePicker.getValue());
						int second = (int)Math.floor(sldrSecondPicker.getValue());
						return ICrashUtils.setDateAndTime(dtpckr.getValue().getYear(),
								dtpckr.getValue().getMonthValue(), dtpckr.getValue().getDayOfMonth(), hour,
								minute, second);
					}
					return null;
				}
			});
			Optional<DtDateAndTime> result = dialog.showAndWait();
			/*
			 * If result is present, we have data to work with, otherwise the user cancelled the action in some way
			 */
			if(result.isPresent()){
				try {
					checkConnectionOK();
					if (!systemstateController.oeSetClock(result.get()).getValue())
						showWarningMessage("Unable to set clock", "Unable to set the system clock, please try again");
					refreshData();
				} catch (ServerOfflineException | ServerNotBoundException e) {
					showExceptionErrorMessage(e);
					serverHasGoneDown();
				}
			}
			else
				showUserCancelledActionPopup();
		} catch (ServerOfflineException | ServerNotBoundException e1) {
			showExceptionErrorMessage(e1);
			serverHasGoneDown();
		}
	}



Other useful information:
The project is a JavaFx project
The project is being made with the java 1.8.0_51 library
Jubula version is 8.1.4.013
Eclipse is 4.5.0
I'm working on Windows 8.1

I've attached screenshots of the dialog where it has some mappable controls and some that are not. I've also attached the testing xml export file as well. Please let me know if you need more information.

Regards,
Tom
Re: Some controls are not mappable in Jubula for javafx [message #1703841 is a reply to message #1703840] Wed, 05 August 2015 10:17 Go to previous messageGo to next message
Thomas Mortimer is currently offline Thomas MortimerFriend
Messages: 18
Registered: July 2015
Junior Member
I've just seen DatePickers are supported in Jubula sprint version 8.16, I will install that now. However, I still have an issue with the control ButtonType. Can you please advise?

[Updated on: Wed, 05 August 2015 10:18]

Report message to a moderator

Re: Some controls are not mappable in Jubula for javafx [message #1703871 is a reply to message #1703841] Wed, 05 August 2015 13:48 Go to previous messageGo to next message
Oliver Goetz is currently offline Oliver GoetzFriend
Messages: 219
Registered: May 2011
Senior Member
Hi Thomas,

I think that ButtonType is not supported yet.
Please feel free to enter a ticket at our Eclipse Jubula Bugzilla.
Regards
Oliver
Re: Some controls are not mappable in Jubula for javafx [message #1703884 is a reply to message #1703871] Wed, 05 August 2015 15:31 Go to previous message
Thomas Mortimer is currently offline Thomas MortimerFriend
Messages: 18
Registered: July 2015
Junior Member
Hi Oliver,

Thanks for the details, I've logged it here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=474338
Regards,
Tom
Previous Topic:Jubula H2 Database Recovery
Next Topic:Retrieve a word from a clipboard
Goto Forum:
  


Current Time: Fri Apr 26 03:04:44 GMT 2024

Powered by FUDForum. Page generated in 0.02898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top