public Set<KProperty<?>> visit() { model.getEntries().stream().forEach(e -> addSharedReference(e.getPathHead().toURI(), PartType.PATH)); results.addAll(builder.build()); return results; } }
private void assertContains(final Set<GuidedDecisionTableGraphEntry> entries, final ObservablePath path, final Double x, final Double y) { if (entries.stream().filter((e) -> e.getPathHead().equals(path) && x.equals(e.getX()) && y.equals(e.getY())).collect(Collectors.toList()).isEmpty()) { fail("Path [" + path.toURI() + " not found in GuidedDecisionTableEditorGraphModel.entries()"); } }
private void updateGraphElementPath(final Path source, final Path destination, final Path graphPath) { final GuidedDecisionTableEditorGraphModel dtGraphModel = dtableGraphService.load(graphPath); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> dtGraphEntries = dtGraphModel.getEntries(); dtGraphEntries.stream().filter((e) -> e.getPathHead().equals(source)).forEach((e) -> e.setPathVersion(destination)); ioService.write(Paths.convert(graphPath), GuidedDTGraphXMLPersistence.getInstance().marshal(dtGraphModel), commentedOptionFactory.makeCommentedOption("Updated Path version for [" + source.toURI() + "] to [" + destination.toURI() + "].")); }
newModel.getEntries().size() ); assertEquals( destination.toURI(), newModel.getEntries().iterator().next().getPathHead().toURI() );
newModel.getEntries().size() ); assertEquals( destination.toURI(), newModel.getEntries().iterator().next().getPathHead().toURI() );
private RemoteCallback<GuidedDecisionTableEditorGraphContent> getLoadGraphContentSuccessCallback() { return (content) -> { this.content = content; this.originalGraphHash = content.getModel().hashCode(); this.concurrentUpdateSessionInfo = null; final GuidedDecisionTableEditorGraphModel model = content.getModel(); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> modelEntries = model.getEntries(); initialiseEditorTabsWhenNoDocuments(); if (modelEntries == null || modelEntries.isEmpty()) { view.hideBusyIndicator(); return; } loadGraphLatch = new LoadGraphLatch(modelEntries.size(), getSelectDecisionTableCommand(modelEntries.iterator().next().getPathHead()), () -> { originalGraphHash = buildModelFromEditor().hashCode(); modeller.getView().getGridPanel().setFocus(true); }); modelEntries.stream().forEach(loadGraphLatch::loadDocumentGraphEntry); }; }
private RemoteCallback<GuidedDecisionTableEditorGraphContent> getLoadGraphContentSuccessCallback() { return (content) -> { this.content = content; this.originalGraphHash = content.getModel().hashCode(); this.concurrentUpdateSessionInfo = null; final GuidedDecisionTableEditorGraphModel model = content.getModel(); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> modelEntries = model.getEntries(); initialiseEditorTabsWhenNoDocuments(); if (modelEntries == null || modelEntries.isEmpty()) { view.hideBusyIndicator(); return; } loadGraphLatch = new LoadGraphLatch(modelEntries.size(), getSelectDecisionTableCommand(modelEntries.iterator().next().getPathHead()), () -> { originalGraphHash = buildModelFromEditor().hashCode(); modeller.getView().getGridPanel().setFocus(true); }); modelEntries.stream().forEach(loadGraphLatch::loadDocumentGraphEntry); }; }
private void loadDocumentGraphEntry(final GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry entry) { final PathPlaceRequest placeRequest = getPathPlaceRequest(entry.getPathHead()); final ObservablePath pathHead = placeRequest.getPath(); final Path pathVersion = entry.getPathVersion(); final Double x = entry.getX(); final Double y = entry.getY(); if (isReadOnly()) { placeRequest.addParameter("readOnly", ""); } service.call(getLoadDocumentGraphEntryContentSuccessCallback(pathHead, placeRequest, x, y), getLoadErrorCallback()).loadContent(pathVersion); }
private void loadDocumentGraphEntry(final GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry entry) { final PathPlaceRequest placeRequest = getPathPlaceRequest(entry.getPathHead()); final ObservablePath pathHead = placeRequest.getPath(); final Path pathVersion = entry.getPathVersion(); final Double x = entry.getX(); final Double y = entry.getY(); if (isReadOnly()) { placeRequest.addParameter("readOnly", ""); } service.call(getLoadDocumentGraphEntryContentSuccessCallback(pathHead, placeRequest, x, y), getLoadErrorCallback()).loadContent(pathVersion); }
void updateGraphElementPath(final Path source, final Path destination, final Path graphPath) { final GuidedDecisionTableEditorGraphModel dtGraphModel = dtableGraphService.load(graphPath); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> dtGraphEntries = dtGraphModel.getEntries(); dtGraphEntries.forEach((e) -> { if (e.getPathHead().equals(source)) { e.setPathHead(destination); e.setPathVersion(destination); } }); ioService.write(Paths.convert(graphPath), GuidedDTGraphXMLPersistence.getInstance().marshal(dtGraphModel), commentedOptionFactory.makeCommentedOption("File [" + source.toURI() + "] renamed to [" + destination.toURI() + "].")); } }
private void versionEntriesPaths(final GuidedDecisionTableEditorGraphModel model) { for (GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry entry : model.getEntries()) { entry.setPathVersion(getLatestVersionPath(entry.getPathHead())); } }
void updateGraphReferences(final Path path, final Path graphPath) { final GuidedDecisionTableEditorGraphModel dtGraphModel = dtableGraphService.load(graphPath); final Set<GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry> dtGraphEntries = dtGraphModel.getEntries(); dtGraphEntries.removeIf((e) -> e.getPathHead().equals(path)); ioService.write(Paths.convert(graphPath), GuidedDTGraphXMLPersistence.getInstance().marshal(dtGraphModel), commentedOptionFactory.makeCommentedOption("File [" + path.toURI() + "] deleted.")); } }