/** * Add an item to this table structure * * @param data */ public void addItem(OperationData data) { getTableStructure().getItems().add(data); }
/** * {@inheritDoc} */ @Override public UIAccessRule isAccessible(IEmaginController controller, VLViewComponentXML compConfig) { OperationData roleB = (OperationData) properties.get("forModel"); FullTableStructureController tableEditingController = (FullTableStructureController) ((AbstractViewController)controller).getStructureContent().getCurrentEditingTableStructure(); if (roleB != null && tableEditingController != null) { if (tableEditingController.containsModel(roleB)) { return UIAccessRule.HIDDEN; } else { return UIAccessRule.SHOW; } } return UIAccessRule.HIDDEN; } }
/** * @{inheritedDoc} */ @Override public synchronized <T extends GenericEvent> void handle(T e) { super.handle(e); if (e.isA(CoreEvent.RefreshTableCurrentPageEvent)) { refreshDatas(); } }
FullTableStructureController controller = (FullTableStructureController) actionRequest.getController(); OperationData data = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure ts = controller.getTableStructure(); String holderFullId = (String) controller.getOpData().getAttributes().get("fullId"); String role = (String) actionRequest.getProperty("contentRole"); if(!res.hasBusinessError()) { ts.getSelectedElements().clear(); controller.getTableStructure().getItems().remove(data); controller.getTableStructure().setNoContent();
/** * @{inheritedDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { FullTableStructureController controller = (FullTableStructureController) actionRequest.getController(); AbstractTableStructure ts = (AbstractTableStructure) controller.processedElement(); OperationData dt = null; if (ts.childTree().size() > 0) { dt = ts.childTree().get(ts.childTree().size() - 1); } // no going into structure, so relative to root data else { SingleResult sr = (SingleResult) controller.modelProperty().get(); dt = (OperationData) sr.rootData(); } String viewId = (String) actionRequest.getProperty("viewId"); WizardViewController wizardViewController = WizardViewUtils.forWizardId(controller, controller.getStructureContent(), viewId, null); wizardViewController.setParent(controller); wizardViewController.relativeToProperty().set(dt); Platform.runLater(() -> wizardViewController.show()); resultProperty.set(ActionResult.success()); } }
/** * @{inheritedDoc} */ @Override public void postProcess() { super.postProcess(); AbstractTableStructure table = (AbstractTableStructure) processedElement(); if (table == null) { // processedElement(getTableStructure()); } if (table instanceof FlowContent) { } }
/** * @{inheritedDoc} */ @Override public Node getNodeOnPosition(ViewLayoutPosition position) { AbstractTableStructure table = (AbstractTableStructure) processedElement(); if (position == ViewLayoutPosition.TOP) { if (table != null && table.getHeader() != null) { return table.getHeader().getDisplay(); } } if (position == ViewLayoutPosition.BOTTOM) { if (table != null && table.getPagination().isPresent()) { return table.getPagination().get(); } } if (position == ViewLayoutPosition.CENTER) { return table.getTableStructure(); } return super.getNodeOnPosition(position); }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); }
/** * @{inheritedDoc} */ @Override public void postProcess() { super.postProcess(); AbstractTableStructure table = (AbstractTableStructure) processedElement(); if (table instanceof TableContent) { ((TableContent) table).setResponsiveColumnsMatrix(tableResponsiveMatrix); } }
return super.getNodeOnPosition(position);
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); // listen on model change ChangeListener<Object> cl2 = this::onModelChange; modelProperty().addListener(cl2); }
/** * {@inheritDoc} */ @Override protected void process() { super.process(); if (layoutManager != null && getTableStructure() != null) { if (getTableStructure().getDefaultActions() != null) { layoutManager.setDefaultActions(getTableStructure().getDefaultActions()); } else { layoutManager.setDefaultActions(null); } } }
/** * @{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 Node getNodeOnPosition(ViewLayoutPosition position) { AbstractTableStructure table = (AbstractTableStructure) processedElement(); if (position == ViewLayoutPosition.TOP) { if ((table != null) && ((table.getHeader() != null) || table.getToolbar().isPresent())) { if ((table.getHeader() != null) && table.getToolbar().isPresent()) { VBox header = new VBox(); header.getChildren().addAll(table.getHeader().getDisplay(), table.getToolbar().get()); return header; } else if (table.getToolbar().isPresent()) { return table.getToolbar().get(); } return table.getHeader().getDisplay(); } } if (position == ViewLayoutPosition.BOTTOM) { if ((table != null) && (table.getPagination() != null)) { return table.getPagination().get(); } } if (position == ViewLayoutPosition.CENTER) { return table.getTableStructure(); } return super.getNodeOnPosition(position); }
/** * {@inheritDoc} */ @Override public UIAccessRule isAccessible(IEmaginController controller, VLViewComponentXML compConfig) { OperationData roleB = (OperationData) properties.get("forModel"); if (((AbstractViewController) controller).getStructureContent() == null) { throw new RuntimeException("Structure CurrentEditingTableStructure must be set and must be a FullTableStructureController"); } FullTableStructureController tableEditingController = (FullTableStructureController) ((AbstractViewController)controller).getStructureContent().getCurrentEditingTableStructure(); if (roleB != null && tableEditingController != null) { if (tableEditingController.containsModel(roleB)) { return UIAccessRule.SHOW; } else { return UIAccessRule.HIDDEN; } } return UIAccessRule.HIDDEN; } }
/** * Remove item from table * * @param data */ public void removeItem(OperationData data) { getTableStructure().getItems().remove(data); } }
/** * {@inheritDoc} */ @Override public void beforePop() { super.beforePop(); if (needRefreshBeforePop) { needRefreshBeforePop = false; getTableStructure().refreshDatas(); } }
/** * {@inheritDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { FullTableStructureController controller = (FullTableStructureController) actionRequest.getController(); OperationData data = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure ts = controller.getTableStructure(); IBuildable source = actionRequest.getSource(); data.getAttributes().put("status","delivered"); if(ts instanceof TableContent) { ((TableContent)ts).refreshTable(); } } }
/** * {@inheritDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { FullTableStructureController controller = (FullTableStructureController) actionRequest.getController(); OperationData data = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure ts = controller.getTableStructure(); IBuildable source = actionRequest.getSource(); data.getAttributes().put("status","in repair"); if(ts instanceof TableContent) { ((TableContent)ts).refreshTable(); } } }
/** * {@inheritDoc} */ @Override public void execute(IActionRequest actionRequest, Optional<IActionResult> previousActionResult) { FullTableStructureController controller = (FullTableStructureController) actionRequest.getController(); OperationData data = (OperationData) actionRequest.getProperty("sourceData"); AbstractTableStructure ts = controller.getTableStructure(); IBuildable source = actionRequest.getSource(); data.getAttributes().put("status","waiting for acceptance"); if(ts instanceof TableContent) { ((TableContent)ts).refreshTable(); } } }