@Override public void changed(ObservableValue<? extends OperationData> observable, OperationData oldValue, OperationData newValue) { if(newValue != null) { ts2.childTree().setAll(ts.childTree()); SingleResult sr = new SingleResult(); sr.setData(newValue); getTableController().setModel(sr); getTableController().refreshDatas(); } else { getTableController().getTableStructure().setNoContent(); } }});
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { controller = (FullTableViewController) actionRequest.getController(); AbstractTableStructure table = (AbstractTableStructure) controller.processedElement(); table.refreshDatas(); }
/** * @{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(); }); }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { FullTableViewController controller = (FullTableViewController) actionRequest.getController(); OperationData model = controller.getSelectedModel(); String viewId = (String) actionRequest.getProperty("toViewId"); if (com.nexitia.emaginplatform.core.commons.utils.StringUtils.isNotBlank(viewId)) { AbstractViewController qq = StandardViewUtils.forId(controller.getRootStructure(), controller.getStructureContent(), viewId); controller.pushContent(null, qq.processedView()); } else { controller.pushContent(null, new StackPane()); } resultProperty.set(ActionResult.success()); }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); if (StringUtils.isNotBlank(leftSectionView)) { leftSection = (FullTableViewController) 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()); leftSection.selectFirstItem(); } detailsView = getRootComponent().getPropertyValue("rightSectionView"); NodeHelper.styleClassSetAll(leftPane, getRootComponent(), "leftSectionAreaStyleClass", ""); NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", ""); }
public void doBuildCenterPane() { try { centerSectionView = getRootComponent().getPropertyValue("centerSectionView"); if (StringUtils.isNotBlank(centerSectionView)) { tableViewController = (FullTableViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, centerSectionView); NodeHelper.styleClassSetAll(centerPane, getRootComponent(), "centerSectionAreaStyleClass", ""); tableViewController.getStructureContent().setCurrentEditingTableStructure(tableViewController); tableViewController.setParent(this); tableViewController.forceLoadFirstPage(); Platform.runLater(() -> { final Node centerSectionNode = tableViewController.processedView(); centerSectionNode.setCache(true); centerSectionNode.setCacheHint(CacheHint.SPEED); centerPane.getChildren().clear(); centerPane.getChildren().add(centerSectionNode); }); } } catch (final Exception ex) { ex.printStackTrace(); } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.RefreshTableCurrentPageEvent)) { refreshDatas(); } }
public Object onOk(Object o) { controller.getTableStructure().deleteSelectedRows(); if(controller.getTableStructure().getItems().size() > 0) { controller.getTableStructure().setNoContent(); } AbstractTableStructure t = controller.getTableStructure(); if(t instanceof TableContent) { ((TableContent)t).refreshTable(); } NodeHelper.showHeaderSuccessDeleteMessage(controller); return null; }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); if (StringUtils.isNotBlank(leftSectionView)) { leftSection = (FullTreeViewController) StandardViewUtils.forId(getRootStructure(), structureContentController, leftSectionView); final String location = leftSection.getRootComponent().getPropertyValue("location"); if (StringUtils.isNotBlank(location)) { } leftSection.selectedElementProperty().addListener((ChangeListener<OperationData>) (observable, oldValue, newValue) -> { final OperationData selectedModel = newValue; if (selectedModel != null) { getStructureContent().setFormModelData(selectedModel); getStructureContent().setForModelId((String) selectedModel.getAttributes().get("fullId")); final SingleResult result = new SingleResult(); result.setData(selectedModel); righSection.setModel(result); righSection.forceLoadFirstPage(); } }); leftPane.getChildren().add(leftSection.processedView()); } rightSectionView = getRootComponent().getPropertyValue("rightSectionView"); doBuildRightPane(); NodeHelper.styleClassSetAll(leftPane, getRootComponent(), "leftSectionAreaStyleClass", ""); NodeHelper.styleClassSetAll(rightPane, getRootComponent(), "rightSectionAreaStyleClass", ""); }
public void doBuildLeftPane() { final String leftSectionView = getRootComponent().getPropertyValue("leftSectionView"); if (StringUtils.isNotBlank(leftSectionView)) { leftPaneController = StandardViewUtils.forId(getRootStructure(), structureContentController, leftSectionView); leftPaneController.setParent(this); NodeHelper.styleClassSetAll(leftPane, getRootComponent(), "leftSectionAreaStyleClass", ""); final String location = leftPaneController.getRootComponent().getPropertyValue("location"); if (StringUtils.isNotBlank(location)) { } final ChangeListener<OperationData> cl = (ChangeListener<OperationData>) (observable, oldValue, newValue) -> { final OperationData selectedModel = newValue; if (selectedModel != null) { getStructureContent().setFormModelData(selectedModel); getStructureContent().setForModelId((String) selectedModel.getAttributes().get("fullId")); final SingleResult result = new SingleResult(); result.setData(selectedModel); tableViewController.setModel(result); } }; leftPaneController.selectedElementProperty().addListener(cl); Platform.runLater(() -> { leftPane.getChildren().add(leftPaneController.processedView()); }); } }
/** * @{inheritedDoc} */ @Override public Node getNodeOnPosition(ViewLayoutPosition position) { if (position == ViewLayoutPosition.LEFT) { return leftPane; } if (position == ViewLayoutPosition.RIGHT) { return rightPane; } if (position == ViewLayoutPosition.TOP) { return righSection.getNodeOnPosition(ViewLayoutPosition.TOP); } return super.getNodeOnPosition(position); }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { AbstractViewController controller = (AbstractViewController) actionRequest.getController(); try { if(previousActionResult.get().isSuccess()) { if(controller instanceof WizardViewController) { WizardViewController c = (WizardViewController) controller; AbstractViewController parent = c.getParent(); if(parent instanceof FullTableViewController) { ((FullTableViewController)parent).refreshDatas(); //AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController)parent).processedElement(); //ts.refreshCurrentPage(); //ts.refreshDatas(); } } } resultProperty.set(ActionResult.success()); } catch (Exception e) { e.printStackTrace(); resultProperty.set(ActionResult.error()); } } }
public Object onOk(Object o) { for(OperationData d: controller.getTableStructure().getItems()) { String status = (String) d.getAttributes().get("status"); if(!"delivered".equalsIgnoreCase(status)) { d.getAttributes().put("status","Delivered"); } } AbstractTableStructure t = controller.getTableStructure(); if(t instanceof TableContent) { ((TableContent)t).refreshTable(); } NodeHelper.showHeaderMessage(controller, "Task(s) successfully delivered", "gmi-cloud-done:32"); return null; }
/** * @{inheritedDoc} */ @Override public Node getNodeOnPosition(ViewLayoutPosition position) { if (position == ViewLayoutPosition.LEFT) { return leftPane; } if (position == ViewLayoutPosition.RIGHT) { return rightPane; } if (position == ViewLayoutPosition.CENTER) { return centerPane; } if (position == ViewLayoutPosition.TOP) { return tableViewController.getNodeOnPosition(ViewLayoutPosition.TOP); } return super.getNodeOnPosition(position); }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { this.controller = (FullTableViewController) actionRequest.getController(); AbstractTableStructure table = (AbstractTableStructure) controller.processedElement(); table.endRowsEdition(); }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.FolderedCreatedEvent) || e.isA(CoreEvent.PartCreatedEvent)) { if (righSection != null) { righSection.refreshDatas(); } } else if (e.isA(CoreEvent.LinkDeletedEvent)) { final LazyTreeItem item = leftSection.getLastSelectedTreeItem(); if (item != null) { item.reloadChildren(); } } else if (e.isA(CoreEvent.LinkCreatedEvent)) { final LazyTreeItem item = leftSection.getLastSelectedTreeItem(); if (item != null) { item.reloadChildren(); } } }
public Object onOk(Object o) { for(OperationData d: controller.getTableStructure().getItems()) { String status = (String) d.getAttributes().get("status"); if("waiting for acceptance".equalsIgnoreCase(status)) { d.getAttributes().put("status","in repair"); } } AbstractTableStructure t = controller.getTableStructure(); if(t instanceof TableContent) { ((TableContent)t).refreshTable(); } NodeHelper.showHeaderMessage(controller, "Task(s) successfully validated", "gmi-cloud-done:32"); return null; }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { controller = (FullTableViewController) actionRequest.getController(); AbstractTableStructure table = (AbstractTableStructure) controller.processedElement(); table.beginRowsEdition(); }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { controller = (FullTableViewController) actionRequest.getController(); OperationData roleB = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure table = (AbstractTableStructure) controller.processedElement(); if (roleB != null) { table.deleteItem(roleB); Task<Void> deleteFromTable = new Task<Void>() { @Override protected Void call() throws Exception { fireDeleteObjectEvent(controller, roleB); return null; } }; Task<Void> deleteFromRemote = new Task<Void>() { @Override protected Void call() throws Exception { processDeletion(actionRequest, previousActionResult); return null; } }; new Thread(deleteFromTable).start(); new Thread(deleteFromRemote).start(); } }
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { controller = (FullTableViewController) actionRequest.getController(); OperationData roleB = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure table = (AbstractTableStructure) controller.processedElement(); if (roleB != null) { table.deleteItem(roleB); Task<Void> deleteFromTable = new Task<Void>() { @Override protected Void call() throws Exception { fireDeleteObjectEvent(controller, roleB); return null; } }; Task<Void> deleteFromRemote = new Task<Void>() { @Override protected Void call() throws Exception { processDeletion(actionRequest, previousActionResult); return null; } }; new Thread(deleteFromTable).start(); new Thread(deleteFromRemote).start(); } }