public void resetValidation() { control.pseudoClassStateChanged(ValidatorBase.PSEUDO_CLASS_ERROR, false); activeValidator.set(null); } }
public static void reset(Control control) { ValidationFacade facade = (ValidationFacade) control.getParent(); control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); facade.activeValidator.set(null); }
/** * validates the text value using the list of validators provided by the user * {{@link #setValidators(ValidatorBase...)} * * @return true if the value is valid else false */ @Override public boolean validate() { for (ValidatorBase validator : validators) { // source control must be set to allow validators re-usability validator.setSrcControl(control); validator.validate(); if (validator.getHasErrors()) { activeValidator.set(validator); return false; } } activeValidator.set(null); return true; }
overAllIndexProperty.set(selectedIndex + preItemsSize); } else { Iterator<Map.Entry<Integer, JFXListView<?>>> itr = sublistsIndices.entrySet().iterator(); overAllIndexProperty.set(preItemsSize + (Integer) selectedList.get(0) + sublistsIndices.get(selectedList .get(0)) .getSelectionModel() .getSelectedIndex()); } else { overAllIndexProperty.set(-1);
/** * validates the text value using the list of validators provided by the * user {{@link #setValidators(ValidatorBase...)} * * @return true if the value is valid else false */ public static boolean validate(Control control) { ValidationFacade facade = (ValidationFacade) control.getParent(); for (ValidatorBase validator : facade.validators) { validator.setSrcControl(facade.controlProperty.get()); validator.validate(); if (validator.getHasErrors()) { facade.activeValidator.set(validator); control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, true); return false; } } control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); facade.activeValidator.set(null); return true; }
private void initialize() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); try { editorProperty(); Field editorField = DatePicker.class.getDeclaredField("editor"); editorField.setAccessible(true); ReadOnlyObjectWrapper<TextField> editor = (ReadOnlyObjectWrapper<TextField>) editorField.get(this); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); } catch (NoSuchFieldException e) { } catch (IllegalAccessException e) { } }
public final ReadOnlyObjectProperty<TextField> editorProperty() { if (editor == null) { editor = new ReadOnlyObjectWrapper<>(this, "editor"); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); } return editor.getReadOnlyProperty(); }
public void makeNotValidated() { LOG.trace("Making state {}", ValidationState.NOT_VALIDATED); validationState.set(ValidationState.NOT_VALIDATED); }
public void removeFilter(PdfVersion version) { // the filter was there filters.remove(version); required.set(filters.last()); }
public void addFilter(PdfVersion version) { // the filter is not already there filters.add(version); required.set(filters.last()); }
public void resetValidation() { control.pseudoClassStateChanged(ValidatorBase.PSEUDO_CLASS_ERROR, false); activeValidator.set(null); } }
public static void reset(Control control) { ValidationFacade facade = (ValidationFacade) control.getParent(); control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); facade.activeValidator.set(null); }
/** * validates the text value using the list of validators provided by the user * {{@link #setValidators(ValidatorBase...)} * * @return true if the value is valid else false */ @Override public boolean validate() { for (ValidatorBase validator : validators) { // source control must be set to allow validators re-usability validator.setSrcControl(control); validator.validate(); if (validator.getHasErrors()) { activeValidator.set(validator); return false; } } activeValidator.set(null); return true; }
/** * validates the text value using the list of validators provided by the * user {{@link #setValidators(ValidatorBase...)} * * @return true if the value is valid else false */ public static boolean validate(Control control) { ValidationFacade facade = (ValidationFacade) control.getParent(); for (ValidatorBase validator : facade.validators) { validator.setSrcControl(facade.controlProperty.get()); validator.validate(); if (validator.getHasErrors()) { facade.activeValidator.set(validator); control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, true); return false; } } control.pseudoClassStateChanged(PSEUDO_CLASS_ERROR, false); facade.activeValidator.set(null); return true; }
/** * Creates validation support instance. <br> * If initial decoration is desired invoke {@link #initInitialDecoration()}. */ public ValidationSupport() { validationResultProperty().addListener( (o, oldValue, validationResult) -> { invalidProperty.set(!validationResult.getErrors().isEmpty()); redecorate(); }); // notify validation result observers validationResults.addListener( (MapChangeListener.Change<? extends Control, ? extends ValidationResult> change) -> validationResultProperty.set(ValidationResult.fromResults(validationResults.values())) ); }
private void initialize() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); editorProperty(); ReadOnlyObjectWrapper<TextField> editor = ReflectionHelper.getFieldContent(DatePicker.class, this, "editor" ); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); }
public final ReadOnlyObjectProperty<TextField> editorProperty() { if (editor == null) { editor = new ReadOnlyObjectWrapper<>(this, "editor"); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); } return editor.getReadOnlyProperty(); }
public <T extends Node> T start(FlowContainer<T> container) throws FlowException { containerWrapper.set(container); flowContextWrapper.get().register(this); if (viewConfiguration != null) { flowContextWrapper.get().register(ResourceBundle.class.toString(), viewConfiguration.getResources()); } try { FlowView<?> startView = new FlowView(ViewFactory.getInstance().createByController(flowWrapper.get().getStartViewControllerClass(), null, getViewConfiguration(), flowContextWrapper.get())); setNewView(startView, false); } catch (FxmlLoadException e) { throw new FlowException(e); } return container.getView(); }
public FlowHandler(Flow flow, ViewFlowContext flowContext, ViewConfiguration viewConfiguration, ExceptionHandler exceptionHandler) { this.flowWrapper = new ReadOnlyObjectWrapper<>(flow); this.viewConfiguration = viewConfiguration; this.exceptionHandler = exceptionHandler; controllerHistory = FXCollections.observableArrayList(); currentViewWrapper = new ReadOnlyObjectWrapper<>(); containerWrapper = new ReadOnlyObjectWrapper<>(); flowContextWrapper = new ReadOnlyObjectWrapper<>(flowContext); currentViewMetadataWrapper = new ReadOnlyObjectWrapper<>(); flowContextWrapper.get().currentViewContextProperty().addListener((e) -> currentViewMetadataWrapper.set(flowContextWrapper.get().getCurrentViewContext().getMetadata())); flowContextWrapper.get().register(new FlowActionHandler(this)); }