@Bean @Named("MobileRootTabPaneView") public StandardTabPaneController mobileRootTabPaneView() { StandardTabPaneController ctrl = new StandardTabPaneController(); ctrl.setModelProvider((IModelProvider) Services.getBean("RootStructureModelLoader")); ctrl.setLayoutManager((IViewLayoutManager) Services.getBean("FullTabPaneLayoutManager")); ctrl.addViewDefinition("/com/nexitia/emaginplatform/jfx/core/demoapp/mobile/MobileRootTabPaneView.json"); return ctrl; }
/** * In this configuration the table is inside the tabpane, * so we must go inside it to get the table * @return */ private FullTableViewController getTableController() { if(centerViewController instanceof StandardTabPaneController) { StandardTabPaneController tpc =(StandardTabPaneController) centerViewController; for(AbstractViewController c: tpc.getBuildedTabsController()) { if(c instanceof FullTableViewController) { return (FullTableViewController) c; } } } else { return (FullTableViewController) centerViewController; } return null; } }
/** * @{inheritedDoc} */ @Override public Node getNodeOnPosition(ViewLayoutPosition position) { if (position == ViewLayoutPosition.CENTER) { return processedView(); } return super.getNodeOnPosition(position); }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); final String emptyView = getRootComponent().getPropertyValue("emptyView"); if (StringUtils.isNotBlank(leftSectionView)) { leftSection = (StandardTabPaneController) StandardViewUtils.forId(getRootStructure(), structureContentController, leftSectionView); final String location = leftSection.getRootComponent().getPropertyValue("location"); if (StringUtils.isNotBlank(location)) { final String loc = leftSection.getLocalised(location); } leftSection.selectedElementProperty().addListener((ChangeListener<OperationData>) (observable, oldValue, newValue) -> { selectedModel = newValue; if (selectedModel != null) { getStructureContent().setFormModelData(selectedModel); getStructureContent().setForModelId((String) selectedModel.getAttributes().get("fullId")); loadDetailsTask(); } }); leftPane.getChildren().add(leftSection.processedView()); } if (StringUtils.isNotBlank(emptyView)) { emptyDetails = StandardViewUtils.forId(getRootStructure(), structureContentController, emptyView); rightPane.getChildren().add(emptyDetails.processedView()); } }
/** * @{inheritedDoc} */ @Override protected void process() { String contentImpl = getRootComponent().getPropertyValue("contentImpl", "VLTabPane"); if (StringUtils.isNotBlank(contentImpl)) { buildable = (IBuildable) Services.getBean(contentImpl); buildable.buildFrom((IEmaginController) this, getRootComponent()); processedView(buildable.getDisplay()); if (StringUtils.isNotBlank(initialSelectedTabId) && buildable instanceof VLTabpane) { ((VLTabpane) buildable).selectTab(initialSelectedTabId); } } }
public AbstractViewController getContent(String rootViewId) { final AbstractViewController controller = StandardViewUtils.forId(getController().getRootStructure(), getController().getStructureContent(), rootViewId); controller.setParent(getController()); if (tabPaneController instanceof StandardTabPaneController) { ((StandardTabPaneController) tabPaneController).addBuildedTabsController(controller); } return controller; }
/** * Default Constructor */ public StandardTabPaneController() { super(); registerListener(CoreEvent.PushTabContentEvent); registerListener(CoreEvent.PopTabContentEvent); }
/** * 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); } } }
@Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); VLTabpane tabpane = (VLTabpane) buildable; if (e.isA(CoreEvent.PopTabContentEvent)) { tabpane.popCurrentContent(false); } else if (e.isA(CoreEvent.PushTabContentEvent)) { PushTabContentEvent ev = (PushTabContentEvent) e; if (ev.getParentController() == this) { String viewId = ev.getProperty("viewId"); if (StringUtils.isNotBlank(viewId)) { final StandardViewController view = StandardViewUtils.forId(rootStructure, viewId, (OperationData) ev.getModel()); view.setParent(this); tabpane.pushCurrentContent(view); UpdateCurrentLocationEvent ucl = new UpdateCurrentLocationEvent(); ucl.setHasPrevious(true); ucl.setSourceController(view); ucl.setTabContentNavigation(true); ((AbstractViewController) getController()).dispatchEvent(ucl); } } } }
public void loadContent(Pane centerViewContent, String rootViewId) { final AbstractViewController controller = StandardViewUtils.forId(getController().getRootStructure(), getController().getStructureContent(), rootViewId); if (tabPaneController instanceof StandardTabPaneController) { ((StandardTabPaneController) tabPaneController).addBuildedTabsController(controller); } content = controller.processedView(); Platform.runLater(() -> { centerViewContent.getChildren().clear(); NodeHelper.setHVGrow(centerViewContent); centerViewContent.getChildren().add(content); }); }
@Bean @Named("MobileRootTabPaneView") @View(locations= {"/com/nexitia/emaginplatform/jfx/core/demoapp/mobile/MobileRootTabPaneView.xml"}) public StandardTabPaneController mobileRootTabPaneView() { StandardTabPaneController tpv = new StandardTabPaneController(); tpv.setModelProvider((IModelProvider) BeanFactory.instance().getBean("RootStructureModelLoader")); tpv.setLayoutManager((IViewLayoutManager) BeanFactory.instance().getBean("FullTabPaneLayoutManager")); tpv.addViewDefinition("/com/nexitia/emaginplatform/jfx/core/demoapp/mobile/MobileRootTabPaneView.json"); return tpv; }