}); directionProperty.addListener(observable -> updateDirection(directionProperty.get())); initTranslate.addListener(observable -> updateDrawerAnimation(initTranslate.get()));
public void addChangeListener(ChangeListener<Integer> listener) { month.addListener(listener); year.addListener(listener); dayInMonth.addListener(listener); hour.addListener(listener); minute.addListener(listener); secound.addListener(listener); } }
@Override // This method is called by the FXMLLoader when initialization is complete public void initialize(URL fxmlFileLocation, ResourceBundle resources) { assert leftPane != null : "fx:id=\"leftPane\" was not injected: check your FXML file 'DashboardResult.fxml'."; assert rightPane != null : "fx:id=\"rightPane\" was not injected: check your FXML file 'DashboardResult.fxml'."; selectedConfiguration.addListener(new ChangeListener<ConfigurationInfo>() { @Override public void changed(ObservableValue<? extends ConfigurationInfo> observableValue, ConfigurationInfo configurationInfo, ConfigurationInfo newValue) { if (newValue!=null){ update(newValue); } } }); }
public void bindBidirectionalSelected(final SimpleObjectProperty<Date> date) { model.addChangeListener(new ChangeListener<Integer>() { @Override public void changed(ObservableValue<? extends Integer> observable, Integer oldValue, Integer newValue) { if (!setFlag) { setFlag = true; date.set(model.getDate()); setFlag = false; } } }); date.addListener(new ChangeListener<Date>() { @Override public void changed(ObservableValue<? extends Date> observable, Date oldValue, Date newValue) { if (!setFlag) { setFlag = true; setModelDate(newValue); setFlag = false; } } }); }
/** * Constructor */ public DefaultActionsHandler() { status.addListener((ChangeListener<ActionRequestStatus>) (observable, oldValue, newValue) -> { // logR.info("Action processing status: " + newValue); if (newValue == ActionRequestStatus.DONE) { if (actionRequest != null) { actionRequest.getController().handleActionResult(actionRequest, result); } } }); }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); // listen on model change ChangeListener<Object> cl2 = this::onModelChange; modelProperty().addListener(cl2); }
/** * Getter of buildedTabsController * * @return the buildedTabsController */ public void addBuildedTabsController(AbstractViewController tabController) { buildedTabsController.add(tabController); if (tabController instanceof StandardViewController) { ((StandardViewController) tabController).selectedElementProperty().addListener((ChangeListener<OperationData>) (observable, oldValue, newValue) -> { this.selectedElementProperty().set(newValue); }); } }
@Override public void start(Stage primaryStage) throws Exception { final Scene scene = new Scene(createContent()); scene.getStylesheets().add(this.getClass().getResource("/org/copperengine/gui/css/base.css").toExternalForm()); primaryStage.setScene(scene); primaryStage.show(); SimpleObjectProperty<Date> date = new SimpleObjectProperty<Date>(new Date()); bindBidirectionalSelected(date); // date.set(null); date.addListener(new ChangeListener<Date>() { @Override public void changed(ObservableValue<? extends Date> observable, Date oldValue, Date newValue) { System.err.println("old" + oldValue); System.err.println("new" + newValue); } }); }
protected void processActions() { IAction action = actions.get(currentExecutionIndex); currentExecutionIndex++; if(action.resultProperty() != null) { action.resultProperty().addListener((ChangeListener<IActionResult>) (observable, oldValue, newValue) -> { result = newValue; if ((result != null) && result.isSuccess()) { if (currentExecutionIndex < actions.size()) { processActions(); } } if (result == null) { result = ActionResult.error(); } status.set(ActionRequestStatus.DONE); }); } action.execute(actionRequest, Optional.of(result)); //logR.debug("Processed action (OK): " + action.getId()); }
/** * @param actionName * @param controller */ public static void doAction(String actionName, AbstractViewController controller) { Object bean = Services.getBean(actionName); IActionRequest request = new ActionRequest.Builder().controller(controller).build(); // single action if (IAction.class.isAssignableFrom(bean.getClass())) { IAction action = (IAction) bean; action.execute(request, null); action.resultProperty().addListener((ChangeListener<IActionResult>) (observable, oldValue, newValue) -> { controller.handleActionResult(request, newValue); }); } // action handler if (IActionHandler.class.isAssignableFrom(bean.getClass())) { IActionHandler actionHandler = (IActionHandler) bean; actionHandler.execute(request); } }
public static void doShowWizardAction(String viewId, AbstractViewController controller) { Object bean = Services.getBean("ShowWizardAction"); IActionRequest request = new ActionRequest.Builder() .controller(controller) .data("viewId", viewId) .build(); // single action if (IAction.class.isAssignableFrom(bean.getClass())) { IAction action = (IAction) bean; action.execute(request, null); action.resultProperty().addListener((ChangeListener<IActionResult>) (observable, oldValue, newValue) -> { controller.handleActionResult(request, newValue); }); } // action handler if (IActionHandler.class.isAssignableFrom(bean.getClass())) { IActionHandler actionHandler = (IActionHandler) bean; actionHandler.execute(request); } }
@Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); String view = "FolderPickerFlowView"; StandardViewController c = StandardViewUtils.forId((RootStructureController) controller.getRootStructure(), view); display = c.processedView(); c.setParent((AbstractViewController) controller); c.selectedElementProperty().addListener(new ChangeListener<OperationData>() { @Override public void changed(ObservableValue<? extends OperationData> observable, OperationData oldValue, OperationData newValue) { if(newValue == null) { } else { String folderOid = (String) newValue.getAttributes().get("fullId"); String folderPath = (String) newValue.getAttributes().get("path"); owner.initialInternalValueProperty().set(folderPath); owner.currentInternalValueProperty().set(folderPath); } } }); }
protected void setRootModel() { SingleResult sr = (SingleResult) controller.getModel(); rootModel = sr.getData(); ((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> { AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get(); ts.childTree().addListener((ListChangeListener<OperationData>) c -> { structureModelUpdated(); }); structureModelUpdated(); }); }
private void initAttributeValue() { attributeChangeListener = (attribute, newAttributeValue) -> { setLoop = true; observableAttributeValue.set(newAttributeValue); setLoop = false; validationDecoration.update(boundAttribute.internal_validate(null, "")); }; boundAttribute.internal_addListener(new WeakAttributeChangeListener<>(attributeChangeListener)); attributeChangeListener.changed(boundAttribute,boundAttribute.get()); observableAttributeValue.addListener(observable -> { if (!setLoop) { boundAttribute.set(observableAttributeValue.get()); } }); }
/** * @{inheritedDoc} */ @Override public void postProcess() { super.postProcess(); AbstractTableStructure table = (AbstractTableStructure) processedElement(); if (table instanceof TableContent) { ((TableContent) table).setResponsiveColumnsMatrix(tableResponsiveMatrix); } if (table.getTableStructure() instanceof TableView) { tableView = (TableView) table.getTableStructure(); tableView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); tableView.getSelectionModel().selectedItemProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> selectedElementChangedTo((OperationData) newValue)); } model.addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> { forceLoadFirstPage(); modelChanged(); }); }
private void buildViewComponent() { final String viewLayoutString = configuration.getPropertyValue("viewLayout", "HorizontalFormRowLayout"); //final String viewLayoutString = configuration.getPropertyValue("viewLayout", "VerticalFormRowLayout"); viewLayout = (RowLayout) Services.getBean(viewLayoutString); final String viewUtility = configuration.getPropertyValue(com.nexitia.emaginplatform.jfx.core.client.viewdef.xml.XMLConstants.VIEW_UTILITY, "BasicAttributeInputView"); viewInputComponent = (ViewInputComponent) Services.getBean(viewUtility); viewInputComponent.build(this); viewLayout.addLabel(viewLabel); viewLayout.addValue(viewInputComponent.getDisplay()); // NodeHelper.setHgrow(viewLabel, viewInputComponent.getDisplay()); if (lastRow.get()) { viewLayout.getDisplay().pseudoClassStateChanged(PseudoClass.getPseudoClass("last"), true); } mode.addListener((ChangeListener<InputMode>) (observable, oldValue, newValue) -> { viewLayout.getDisplay().setVisible(newValue == InputMode.VIEW); }); }
@Override public Node createValueVisualisation() { HTMLEditor htmlEditor = new HTMLEditor(); htmlEditor.disableProperty().bind(readOnly); changeListener = (observable, oldValue, newValue) -> htmlEditor.setHtmlText(newValue); observableAttributeValue.addListener(new WeakChangeListener<>(changeListener)); BorderPane borderPane = new BorderPane(); borderPane.setCenter(htmlEditor); Button save = new Button("save");//strangely workaround HTMLEditor have no bind or change events save.setOnAction(event -> observableAttributeValue.set(htmlEditor.getHtmlText())); htmlEditor.setHtmlText(observableAttributeValue.get()); BorderPane.setMargin(save,new Insets(3,0,3,0)); borderPane.setTop(save); return borderPane; }
/** * Constructor */ public PaginationBar() { rowsPerPageLabel.visibleProperty().bind(rowsPerPageCombo.visibleProperty()); rowsPerPageCombo.managedProperty().bind(rowsPerPageCombo.visibleProperty()); rowsPerPageCombo.getStyleClass().addAll("simple-pagination-combo"); model.addListener((ChangeListener<MultipleResult>) (observable, oldValue, newValue) -> { modelUpdated(); }); rowsPerPageCombo.getItems().addAll("5", "10", "15", "20"); rowsPerPageCombo.getSelectionModel().selectFirst(); rowsPerPageCombo.getSelectionModel().selectedItemProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { firstPage(); }); }
/** * Constructor */ public InputSortButton() { super(); state.addListener((ChangeListener<InputSortButtonState>) (observable, oldValue, newValue) -> { if (newValue == InputSortButtonState.NONE) { getDisplay().pseudoClassStateChanged(none, true); getDisplay().pseudoClassStateChanged(down, false); getDisplay().pseudoClassStateChanged(up, false); } else if (newValue == InputSortButtonState.UP) { getDisplay().pseudoClassStateChanged(none, false); getDisplay().pseudoClassStateChanged(down, false); getDisplay().pseudoClassStateChanged(up, true); } else if (newValue == InputSortButtonState.DOWN) { getDisplay().pseudoClassStateChanged(none, false); getDisplay().pseudoClassStateChanged(down, true); getDisplay().pseudoClassStateChanged(up, false); } }); }
private void buildProcessing() { waitingIndicator.maxHeightProperty().bind(waitingIndicator.maxWidthProperty()); waitingIndicator.maxWidthProperty().set(30); BooleanBinding isWaiting = Bindings.equal(ProcessingState.WAITING, status); BooleanBinding isDoneError = Bindings.equal(ProcessingState.DONE_KO, status); doneOKLabel.visibleProperty().bind(Bindings.equal(ProcessingState.DONE_OK, status)); waitingIndicator.visibleProperty().bind(Bindings.equal(ProcessingState.PROCESSING, status)); allOverContainer.visibleProperty().bind(Bindings.or(isWaiting, isDoneError)); // ok icon doneOKLabel.setText("DONE"); status.addListener((ChangeListener<ProcessingState>) (observable, oldValue, newValue) -> { if (newValue == ProcessingState.DONE_KO) { pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), false); } else if (newValue == ProcessingState.PROCESSING) { pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), true); pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), false); } }); }