/** * Synchronize info value with edited value */ public void localCommitModification() { editInputComponent.commitModification(); }
/** * Commit/cancel modifications. Commit: Set initial value to current value Cancel: Set current value * to initial value */ public default void cancelModification() { if (getInputComponentWrapper() != null) { getInputComponentWrapper().cancelModification(); } }
private void buildEditComponent() { editInputComponent = new EditInputComponent(); editInputComponent.build(this); // String viewLayoutString = configuration.getPropertyValue("editLayout","HorizontalFormRowLayout"); final String viewLayoutString = configuration.getPropertyValue("editLayout", "VerticalFormRowLayout"); editLayout = (RowLayout) Services.getBean(viewLayoutString); editLayout.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("editing"), true); editLayout.addLabel(editLabel); editLayout.addValue(editInputComponent.getDisplay()); // editLayout.getStyleClass().add("form-edit-input-component-wrapper"); if (lastRow.get()) { editLayout.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("last"), true); } // editLayout.prefWidthProperty().bind(editLayout.maxWidthProperty()); // editLayout.maxWidthProperty().bind(widthProperty()); // editLayout.managedProperty().bind(editLayout.visibleProperty()); }
private void buildActions() { okButton.setFocusTraversable(false); okButton.setText(controller.getGLocalised("SAVE_LABEL").toUpperCase()); cancelButton.setText(controller.getGLocalised("CANCEL_LABEL").toUpperCase()); cancelButton.setFocusTraversable(false); actions.setStyle("-fx-padding: 32 0 0 32; -fx-alignment: CENTER_RIGHT;-fx-spacing:16;"); actions.getChildren().addAll(NodeHelper.horizontalSpacer(), okButton, cancelButton); cancelButton.setOnAction(e -> { hide(); }); okButton.setOnAction(e -> { hide(); editInputComponent.commitModification(); }); editInputComponent.getContent().addEventHandler(KeyEvent.KEY_PRESSED, e -> { if (e.getCode() == KeyCode.ENTER) { hide(); } }); }
protected void displayValidationErrorMessage() { for(IInputComponentWrapper e: row.getEntries()) { if (e.getEditInputComponent().getFirstErrorMessage() != null) { Label label = new Label(e.getEditInputComponent().getFirstErrorMessage()); label.getStyleClass().add("form-inline-error-message"); errorMessagesContainer.getChildren().add(label); } } }
/** * */ @Override public void validate() { if(getDisplay().isVisible()){ editInputComponent.validate(); } }
/** * */ @Override public boolean isNotValid() { if(getDisplay().isVisible()){ return editInputComponent.isNotValid(); } else { return false; } }
/** * */ @Override public void displayError() { if(getDisplay().isVisible()) { editInputComponent().displayError(); } }
public void buildInput() { allOverContainer.getChildren().add(0, errorMessage); errorMessage.getStyleClass().add("form-input-inline-editor-errorMessage"); errorMessage.visibleProperty().bind(errorMessage.textProperty().isNotEmpty()); allOverContainer.getChildren().add(editInputComponent.getDisplay()); }
/** * Constructor * * @param editInputComponent * @param controller */ public VLInputPopOverInPlaceEditor(IEditInputComponent editInputComponent, AbstractViewController controller) { this.editInputComponent = editInputComponent; this.controller = controller; setAutoHide(true); setAutoFix(true); setHideOnEscape(true); setDetachable(false); setArrowLocation(ArrowLocation.TOP_CENTER); focusedProperty().addListener((pop, ov, nv) -> { if (!nv) { hide(); } }); content.getChildren().add(editInputComponent.getContent()); buildActions(); allOverContainer.getChildren().addAll(content, actions); NodeHelper.setHVGrow(allOverContainer); allOverContainer.setStyle("-fx-border-color:#8c9eff;" + "-fx-border-width: 0;" + "-fx-padding: 32;"); NodeHelper.setHgrow(editInputComponent.getContent(), content, actions); }
protected void displayValidationErrorMessage() { errorPane.getChildren().clear(); for(IInputComponentWrapper e: row.getEntries()) { if (e.getEditInputComponent().getFirstErrorMessage() != null) { Label label = new Label(e.getEditInputComponent().getFirstErrorMessage()); label.getStyleClass().add("form-inline-error-message"); errorPane.getChildren().add(0, label); } } }
public default void commitModification() { if (getInputComponentWrapper() != null) { getInputComponentWrapper().commitModification(); } }
/** * Bind this property to the internal value */ public default void addInternalValueBinding(StringProperty property) { if (getInputComponentWrapper() != null) { property.bind(getInputComponentWrapper().currentInternalValueProperty()); } }
public default VLViewComponentXML getConfiguration() { return getInputComponentWrapper().getConfiguration(); }
public default Map<String, Object> extracValue(List<IInputComponentWrapper> rows) { Map<String, Object> result = new HashMap<>(); for(IInputComponentWrapper row: rows) { IEditInputComponent edit = row.getEditInputComponent(); String value = edit.getInputComponentWrapper().getCurrentInternalValue(); String name = row.getAttributeName(); result.put(name, value); } return result; }