@Test public void getText() { List<String> text = new ArrayList<>(); Platform.runLater(() -> { colorpicker.marathon_select("#ff0000"); text.add(colorpicker.getAttribute("text")); }); new Wait("Waiting for color picker text.") { @Override public boolean until() { return text.size() > 0; } }; AssertJUnit.assertEquals("#ff0000", text.get(0)); }
@Override public boolean marathon_select(String value) { ColorPicker colorPicker = (ColorPicker) getComponent(); if (!value.equals("")) { try { colorPicker.setValue(Color.valueOf(value)); Event.fireEvent(colorPicker, new ActionEvent()); return true; } catch (Throwable t) { throw new IllegalArgumentException("Invalid value for '" + value + "' for color-picker '"); } } return false; }
JavaFXColorPickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { ColorPicker colorPicker = (ColorPicker) getComponent(); if (!value.equals("")) { try { colorPicker.setValue(Color.valueOf(value)); Event.fireEvent(colorPicker, new ActionEvent()); return true; } catch (Throwable t) { throw new IllegalArgumentException("Invalid value for '" + value + "' for color-picker '"); } } return false; } }
JavaFXColorPickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { ColorPicker colorPicker = (ColorPicker) getComponent(); if (!value.equals("")) { try { colorPicker.setValue(Color.valueOf(value)); Event.fireEvent(colorPicker, new ActionEvent()); return true; } catch (Throwable t) { throw new IllegalArgumentException("Invalid value for '" + value + "' for color-picker '"); } } return false; } JavaFXColorPickerElement(Node component, IJavaFXAgent driver, JFXWindow window); }
JavaFXColorPickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { ColorPicker colorPicker = (ColorPicker) getComponent(); if (!value.equals("")) { try { colorPicker.setValue(Color.valueOf(value)); Event.fireEvent(colorPicker, new ActionEvent()); return true; } catch (Throwable t) { throw new IllegalArgumentException("Invalid value for '" + value + "' for color-picker '"); } } return false; } JavaFXColorPickerElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); }
JavaFXColorPickerElement extends JavaFXElement { @Override public boolean marathon_select(String value) { ColorPicker colorPicker = (ColorPicker) getComponent(); if (!value.equals("")) { try { colorPicker.setValue(Color.valueOf(value)); Event.fireEvent(colorPicker, new ActionEvent()); return true; } catch (Throwable t) { throw new IllegalArgumentException("Invalid value for '" + value + "' for color-picker '"); } } return false; } JavaFXColorPickerElement(Node component, IJavaFXAgent driver, JFXWindow window); @Override boolean marathon_select(String value); @Override String _getText(); static final Logger LOGGER; }