/** * !!IF NOTHING HAPPENS WHEN FORWARD EDING, MAKE SURE FIRST THAT LAYOUT MANAGER HAS IMPLEMENTED PUSH * AND POP METHODS */ @Override public void endForwardEdition() { if (forwardeditor != null) { forwardeditor.endEdition(); } else { if (controller instanceof StandardViewController) { // if controlle has layout manager if(((StandardViewController) controller).getLayoutManager() != null) { ((StandardViewController) controller).getLayoutManager().popContent(); } // controller do not have layout manager // so it has layout the content by itsef else { ((StandardViewController) controller).endForwardEdition(); } } } }
/** * Show the editor within the fieldset. * * !!IF NOTHING HAPPENS WHEN FORWARD EDING, MAKE SURE FIRST THAT LAYOUT MANAGER HAS IMPLEMENTED PUSH * AND POP METHODS * */ @Override public void beginForwardEdition(Node editor) { if (forwardeditor != null) { forwardeditor.beginEdition(editor); } else { if (controller instanceof StandardViewController) { ((StandardViewController) controller).getLayoutManager().pushContent(editor); } } }
private void selectRadio(RadioButton radioButton, boolean goback) { Object v = isStaticValue ? radioButton.getUserData() : radioButton.selectedProperty().get(); List<IListFormValue> s = new ArrayList<>(); IListFormValue val = currentValues.get(0); val.setSavedValue(v); s.add(val); JsonObject query = new JsonObject(); query.addProperty("key", getKey()); query.addProperty("value", v != null ? v.toString() : ""); setPreferenceValueOperation.doOperation(query, res -> { processUpdate(s); if (goback) { SingleResult sr = (SingleResult) controller.getModel(); ParentItemPresenter parent = (ParentItemPresenter) sr.getData().getMeta().get("parentItem"); if (parent != null) { parent.updateDisplay(); } // call go back only if we are not in self mode and in desktop boolean desktopselfView = isSelfView(parent.getController()) && AbstractApplicationRunner.isDesktop(); if(!desktopselfView) NodeHelper.goBack(controller); if(desktopselfView) { StandardViewController c = (StandardViewController) parent.getController().getParent(); IViewLayoutManager m = c != null ? c.getLayoutManager() : null; if(m != null && m instanceof ViewForwardLayoutManager) { ((ViewForwardLayoutManager)m).popContent(); } } } }); }
/** * Process update of data */ private void processDataUpdate(IListFormValue item, boolean goback) { List<IListFormValue> s = new ArrayList<>(); for(IListFormValue e1: getListView().getItems()) { if (e1.selectedProperty().get()) { s.add(e1); } } item.preferenceItem().processUpdate(s); // if desktop self, pop layoutmanager AbstractViewController parent = controller.getParent(); boolean desktopselfView = isSelfView(parent) && AbstractApplicationRunner.isDesktop(); if(desktopselfView) { StandardViewController c = (StandardViewController) parent.getParent(); IViewLayoutManager m = c != null ? c.getLayoutManager() : null; if(m != null && m instanceof ViewForwardLayoutManager) { ((ViewForwardLayoutManager)m).popContent(); } } else { if (controller.getParent() != null && controller.getParent() instanceof StandardTabPaneController) { ((StandardTabPaneController) controller.getParent()).handle(new PopTabContentEvent()); } else if (goback) { NodeHelper.goBack(controller); } } }