From 2c71270a02a8d18b780c93d417e9f68fb38b28f7 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Fri, 13 Jan 2017 08:56:18 +0200 Subject: [PATCH] Preliminary support for purely Variable based dynamic issue sources refs #6948 Change-Id: I7da7446a57a3da7836b59eb2e2c3dc60858818bf --- .../common/ActiveModelIssueSources.java | 14 +-- .../common/ActiveProjectIssueSources.java | 23 ++-- .../issues/common/DynamicIssueSources.java | 51 ++++++++ .../simantics/issues/common/IssueUtils.java | 2 +- .../SelectedModelBatchIssueSources.java | 14 +-- .../org.simantics.issues.ontology/graph.tg | Bin 14510 -> 14830 bytes .../graph/Issue.pgraph | 3 + .../issues/ontology/IssueResource.java | 3 + .../org.simantics.issues.ui.ontology/graph.tg | Bin 15066 -> 15919 bytes .../graph/IssueUI.pgraph | 117 +++++++++++------- .../issues/ui/ontology/IssueUIResource.java | 15 ++- bundles/org.simantics.issues.ui/adapters.xml | 20 +-- bundles/org.simantics.issues.ui/plugin.xml | 2 +- .../ui/DynamicIssueSourceHierarchyRule.java | 34 +++++ .../issues/ui/DynamicIssueSourceRule.java | 33 +++++ .../simantics/issues/ui/IssueImageRule.java | 60 ++++++--- .../simantics/issues/ui/IssueLabelRule.java | 2 - .../simantics/issues/ui/ModeledActions.java | 17 --- .../ui/handler/RunActiveValidations.java | 25 ++-- .../handler/UpdateIssuesForOpenDiagrams.java | 17 ++- 20 files changed, 308 insertions(+), 144 deletions(-) create mode 100644 bundles/org.simantics.issues.common/src/org/simantics/issues/common/DynamicIssueSources.java create mode 100644 bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceHierarchyRule.java create mode 100644 bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceRule.java delete mode 100644 bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/ModeledActions.java diff --git a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveModelIssueSources.java b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveModelIssueSources.java index 40d7f2ec3..1803d4274 100644 --- a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveModelIssueSources.java +++ b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveModelIssueSources.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * Copyright (c) 2007, 2017 Association for Decentralized Information Management * in Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation + * Semantum Oy - #6948 *******************************************************************************/ package org.simantics.issues.common; @@ -16,18 +17,17 @@ import java.util.Collection; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.request.ObjectsWithType; -import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.common.request.ResourceRead2; import org.simantics.db.exception.DatabaseException; -import org.simantics.issues.ontology.IssueResource; import org.simantics.operation.Layer0X; /** * @author Tuukka Lehtonen */ -public class ActiveModelIssueSources extends ResourceRead> { +public class ActiveModelIssueSources extends ResourceRead2> { - public ActiveModelIssueSources(Resource resource) { - super(resource); + public ActiveModelIssueSources(Resource resource, Resource expectedSourceType) { + super(resource, expectedSourceType); } @Override @@ -36,7 +36,7 @@ public class ActiveModelIssueSources extends ResourceRead> new ObjectsWithType( resource, Layer0X.getInstance(graph).Activates, - IssueResource.getInstance(graph).ContinuousIssueSource) + resource2) ); } diff --git a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveProjectIssueSources.java b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveProjectIssueSources.java index 3f593e643..b44e80f74 100644 --- a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveProjectIssueSources.java +++ b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/ActiveProjectIssueSources.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * Copyright (c) 2007, 2017 Association for Decentralized Information Management * in Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation + * Semantum Oy - #6948 *******************************************************************************/ package org.simantics.issues.common; @@ -16,28 +17,26 @@ import java.util.Collection; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; -import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.common.request.ResourceRead2; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.request.ActiveModels; /** * @author Tuukka Lehtonen */ -public class ActiveProjectIssueSources extends ResourceRead> { +public class ActiveProjectIssueSources extends ResourceRead2> { - public ActiveProjectIssueSources(Resource resource) { - super(resource); + public ActiveProjectIssueSources(Resource resource, Resource expectedType) { + super(resource, expectedType); } @Override public Collection perform(ReadGraph graph) throws DatabaseException { - - ArrayList result = new ArrayList(); - for(Resource model : graph.sync(new ActiveModels(resource))) { - result.addAll(graph.sync(new ActiveModelIssueSources(model))); - } - return result; - + ArrayList result = new ArrayList<>(); + for (Resource model : graph.syncRequest(new ActiveModels(resource))) { + result.addAll(graph.syncRequest(new ActiveModelIssueSources(model, resource2))); + } + return result; } } diff --git a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/DynamicIssueSources.java b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/DynamicIssueSources.java new file mode 100644 index 000000000..c0b0adee6 --- /dev/null +++ b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/DynamicIssueSources.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2017 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package org.simantics.issues.common; + +import java.util.Set; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.common.request.ResourceRead; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.request.PossibleVariable; +import org.simantics.db.layer0.variable.Variable; +import org.simantics.issues.ontology.IssueResource; + +import gnu.trove.set.hash.THashSet; + +/** + * @author Tuukka Lehtonen + * @since 1.27 + */ +public class DynamicIssueSources extends ResourceRead> { + + public DynamicIssueSources(Resource project) { + super(project); + } + + @Override + public Set perform(ReadGraph graph) throws DatabaseException { + IssueResource ISSUE = IssueResource.getInstance(graph); + Set result = new THashSet<>(); + for (Resource source : graph.syncRequest(new ActiveProjectIssueSources(resource, ISSUE.DynamicIssueSource))) { + boolean selected = graph.hasStatement(source, ISSUE.IssueSource_Selected); + if (!selected) + continue; + Variable v = graph.syncRequest(new PossibleVariable(source)); + if (v != null) + result.add(v); + } + return result; + } + +} diff --git a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/IssueUtils.java b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/IssueUtils.java index 866323bab..bb0c8a5b1 100644 --- a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/IssueUtils.java +++ b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/IssueUtils.java @@ -278,7 +278,7 @@ public class IssueUtils { public static Disposable listenActiveProjectIssueSources(RequestProcessor processor, Resource project) throws DatabaseException { final AtomicBoolean disposed = new AtomicBoolean(false); processor.syncRequest( - new ActiveProjectIssueSources(project), + new ActiveProjectIssueSources(project, IssueResource.getInstance(processor).ContinuousIssueSource), new ActiveIssueSourceListener(disposed)); return new Disposable() { @Override diff --git a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/SelectedModelBatchIssueSources.java b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/SelectedModelBatchIssueSources.java index 9d2df7a04..9931ec64b 100644 --- a/bundles/org.simantics.issues.common/src/org/simantics/issues/common/SelectedModelBatchIssueSources.java +++ b/bundles/org.simantics.issues.common/src/org/simantics/issues/common/SelectedModelBatchIssueSources.java @@ -33,13 +33,13 @@ public class SelectedModelBatchIssueSources extends ResourceRead perform(ReadGraph graph) throws DatabaseException { - Layer0 L0 = Layer0.getInstance(graph); - IssueResource ISSUE = IssueResource.getInstance(graph); - ArrayList result = new ArrayList(); - for(Resource issueSource : graph.sync(new ObjectsWithType(resource, L0.ConsistsOf, ISSUE.IssueSource))) { - if(graph.hasStatement(issueSource, ISSUE.IssueSource_Selected)) result.add(issueSource); - } - return result; + Layer0 L0 = Layer0.getInstance(graph); + IssueResource ISSUE = IssueResource.getInstance(graph); + ArrayList result = new ArrayList<>(); + for(Resource issueSource : graph.sync(new ObjectsWithType(resource, L0.ConsistsOf, ISSUE.IssueSource))) { + if(graph.hasStatement(issueSource, ISSUE.IssueSource_Selected)) result.add(issueSource); + } + return result; } } diff --git a/bundles/org.simantics.issues.ontology/graph.tg b/bundles/org.simantics.issues.ontology/graph.tg index 23e0bb966130559958b64a621b58761346a6a198..d0ad31bf4c0463847af4658c7484b4f053f0fcaf 100644 GIT binary patch literal 14830 zcmeHO33n7#77j^w(w#s;2&kZ9>4=JARNQyMqC`R{Z)eRtgV zec$IV&V1jkcaz(dsG|p+IdkZ9F1+vF@7=fG_o`l{Jd^mX*{-gx6_Bnz{^Ne-RY{P> z?W7j$h}%)tO?7|pU=~Da7)NQ9xR?K|G7E8&w<;r-pn6uoU zW_}hlktwgRWbK{v8|~k2L0M?hZdCrCt^rSLOVF9po5M$s9vw}?rjL%PrK52&14gL_ z|E#Evr)fJl|Dw^YKr>X8`fKRbEb+rA13W0YzDXH?6pDMOI5@mBXay0vx;8(R__ZTJ z0_}Y?-Lq=9pH2pTQk$JZUqSN`)%W#{M{_}vQgK*#gJV$~%{SwADs_N95PeypFK`I% zw)<&tLp!Rm6T$n02H!ZG7A6bcVe9@W)zgM|NO&v3x!wYNx>J?P-u`0~?|m^o#wlAVKc;GGpFNMX7gpSjS{T z@_xZ14ej}k0beP`A?dh$#<~IAB!+dYM;Ntr%HlR+b>WkTC1nqD8%c#gyKChN*6b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9U&TTuf`cK$SoFzD{;)>h5z;@!l5H;L4Mi*|&@yADv?Pxu2BW%== zZH0>(e9|Y@sKN2^zYt|~OTw~Uh^TYADeAOlU%JkI5!zX8`XZ)rF~polh~co|#f7A& zWwvdpYHgYQv>4`GYm>n1ERQ7e?OXFBiR|=?=8;79;B5;&l4M))*>AOFA5olzvdQn_ zUch|MxzIjB9*h>3?L$a5fphza?9rn6Atd|sE&mXbJxz&Jr4I8gpPfs53&>qS+1Y8cm~Tn#_MKCRI`z+vCRYD^oFLZ61N!Gx zKbN_eUYvXXhjVZK?CQXxY-nP4|GW%l`elF@B6+5zbd+r0$CoWFS z^O%}^4&%j_DJAK8ajq(#3mviL6Dyw!C#RfUT#4=CXfg9* p9_o*C%`U$B?yM}Y=WoRC;>@q)vZJa#{9;Ic=Fum=g3(_A{2S}S2`vBs diff --git a/bundles/org.simantics.issues.ontology/graph/Issue.pgraph b/bundles/org.simantics.issues.ontology/graph/Issue.pgraph index f97f68240..3d428ed59 100644 --- a/bundles/org.simantics.issues.ontology/graph/Issue.pgraph +++ b/bundles/org.simantics.issues.ontology/graph/Issue.pgraph @@ -24,6 +24,9 @@ ISSUE.IssueSource -- ISSUE.ContinuousIssueSource.lastUpdateRevision --> L0.Long -- ISSUE.Issue.HasContext 1++zNM~Uu)zvTEMXIaXT9P#TzJ|py zGC)Q}#T|Ftl@UadK^atZ6h#?8LxeD@2{G?Uusu5;!+NRdtQqr<1Tdn14(J&gh4olPKExBU-{~ke;$Yk7@ zxLf@I{-Ps+O=h!m>(;H^)xvNN6O*rYmn(x%w9^%iTTvc}iiOhPocY~H!0=02+uN4Z zOL_LV3i=gIzwAUeO9Q#e!0M<{EmUje3asPC;-9d+w_2@7>v|DlK6q~$$F(eo1KdW# z-p%VuL%24m?jt<4FWM4S3bj!u?7<`qmMf$1A0YnDzNpqHfom3B2edECRn>+3n`oTX z(py5jDid5U0b15z*%Y_Xuw4w9WiJ0sLT&3xTn$dJm8NkWzAI&1pKUc*_7wAk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ui)HrJGRMj?=gKnAD$AoO-j(88JYye*m!r{mwH} z+e_Udly9Oq%{SuOR~n@1#9xlZU*ee+wBbjU`2qQDOa=HwwS6bx3u2L3w`%n!(C7DN z|2Yvhx!*Ox=(Fn2#(f6G{rj|w)t`n;JtF~)IWd08BYUkm9|9q7r|AXc$oN@Ad=gUM8|2+B-- ACTIONS.SetSeverityAction.HasSeverity --> ISSUE.Severity -- IBC.SeverityFolderRule.HasSeverity --> ISSUE.Severity -- IBC.SeverityChildRule.HasSeverity --> ISSUE.Severity -- IBC.SeverityFolderLabelRule.HasSeverity --> ISSUE.Severity -- ACTIONS.SetSeverityAction.HasSeverity --> ISSUE.Severity + class="org.simantics.issues.ui.IssueImageRule"> + + @@ -45,8 +47,7 @@ class="org.simantics.issues.ui.contribution.IssueContextDropAction" /> - - + @@ -55,8 +56,11 @@ class="org.simantics.issues.ui.SeverityChildRule"> - - + + + @@ -74,7 +78,7 @@ - - + + - \ No newline at end of file + diff --git a/bundles/org.simantics.issues.ui/plugin.xml b/bundles/org.simantics.issues.ui/plugin.xml index 88623c5b2..e67d2e12b 100644 --- a/bundles/org.simantics.issues.ui/plugin.xml +++ b/bundles/org.simantics.issues.ui/plugin.xml @@ -156,7 +156,7 @@ id="org.simantics.issues.actions"> diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceHierarchyRule.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceHierarchyRule.java new file mode 100644 index 000000000..0e6120951 --- /dev/null +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceHierarchyRule.java @@ -0,0 +1,34 @@ +package org.simantics.issues.ui; + +import java.util.Collection; +import java.util.Collections; + +import org.simantics.browsing.ui.model.children.ChildRule; +import org.simantics.db.ReadGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.variable.Variable; + +/** + * @author Tuukka Lehtonen + * @since 1.27 + */ +public class DynamicIssueSourceHierarchyRule implements ChildRule { + + @Override + public boolean isCompatible(Class contentType) { + return contentType.equals(Variable.class); + } + + @Override + public Collection getChildren(ReadGraph graph, Object parent) throws DatabaseException { + Variable v = (Variable) parent; + return v.getChildren(graph); + } + + @Override + public Collection getParents(ReadGraph graph, Object child) throws DatabaseException { + Variable parent = ((Variable)child).getParent(graph); + return parent != null ? Collections.singleton(parent) : Collections.emptyList(); + } + +} diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceRule.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceRule.java new file mode 100644 index 000000000..3a62551eb --- /dev/null +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/DynamicIssueSourceRule.java @@ -0,0 +1,33 @@ +package org.simantics.issues.ui; + +import java.util.Collection; +import java.util.Collections; + +import org.simantics.browsing.ui.model.children.ChildRule; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.issues.common.DynamicIssueSources; + +/** + * @author Tuukka Lehtonen + * @since 1.27 + */ +public class DynamicIssueSourceRule implements ChildRule { + + @Override + public boolean isCompatible(Class contentType) { + return contentType.equals(Resource.class); + } + + @Override + public Collection getChildren(ReadGraph graph, Object parent) throws DatabaseException { + return graph.syncRequest(new DynamicIssueSources((Resource) parent)); + } + + @Override + public Collection getParents(ReadGraph graph, Object child) throws DatabaseException { + return Collections.singleton(child); + } + +} diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueImageRule.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueImageRule.java index b19a1f711..10de114c7 100644 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueImageRule.java +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueImageRule.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * Copyright (c) 2007, 2017 Association for Decentralized Information Management * in Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation + * Semantum Oy - #6948 *******************************************************************************/ package org.simantics.issues.ui; @@ -31,6 +32,25 @@ public class IssueImageRule implements ImageRule { private final String DESCRIPTION = ColumnKeys.SINGLE; + private final ImageDescriptor tick; + private final ImageDescriptor fatal; + private final ImageDescriptor error; + private final ImageDescriptor warning; + private final ImageDescriptor info; + private final ImageDescriptor note; + private final ImageDescriptor help; + + public IssueImageRule(ReadGraph graph) throws DatabaseException { + SilkResources SILK = SilkResources.getInstance(graph); + tick = graph.adapt(SILK.tick, ImageDescriptor.class); + fatal = graph.adapt(SILK.bomb, ImageDescriptor.class); + error = graph.adapt(SILK.exclamation, ImageDescriptor.class); + warning = graph.adapt(SILK.error, ImageDescriptor.class); + info = graph.adapt(SILK.information, ImageDescriptor.class); + note = graph.adapt(SILK.note, ImageDescriptor.class); + help = graph.adapt(SILK.help, ImageDescriptor.class); + } + @Override public boolean isCompatible(Class contentType) { return contentType.equals(Variable.class); @@ -38,26 +58,32 @@ public class IssueImageRule implements ImageRule { @Override public Map getImage(ReadGraph graph, Object content) throws DatabaseException { + Variable issue = (Variable) content; + String severity = issue.getPossiblePropertyValue(graph, "severity"); + if (severity == null) + return Collections.emptyMap(); + boolean resolved = isResolved(graph, issue); + return Collections.singletonMap(DESCRIPTION, resolved ? tick : toImageDescriptor(severity)); + } - Variable issue = (Variable)content; - - IssueResource ISSUE = IssueResource.getInstance(graph); - SilkResources SILK = SilkResources.getInstance(graph); - String severity = issue.getPropertyValue(graph, "severity"); - - // TODO: now to do this with variables? + public boolean isResolved(ReadGraph graph, Variable issue) throws DatabaseException { Resource issueResource = issue.getPossibleRepresents(graph); - boolean resolved = issueResource != null ? graph.hasStatement(issueResource, ISSUE.Resolved) : false; - if (resolved) - return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.tick, ImageDescriptor.class)); + if (issueResource != null) + return graph.hasStatement(issueResource, IssueResource.getInstance(graph).Resolved); - if("Fatal".equals(severity)) return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.bomb, ImageDescriptor.class)); - else if("Error".equals(severity)) return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.exclamation, ImageDescriptor.class)); - else if("Warning".equals(severity)) return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.error, ImageDescriptor.class)); - else if("Info".equals(severity)) return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.information, ImageDescriptor.class)); - else if("Note".equals(severity)) return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.note, ImageDescriptor.class)); - else return Collections.singletonMap(DESCRIPTION, graph.adapt(SILK.help, ImageDescriptor.class)); + Boolean resolved = issue.getPossiblePropertyValue(graph, "resolved"); + return Boolean.TRUE.equals(resolved); + } + private ImageDescriptor toImageDescriptor(String severity) { + switch (severity) { + case "Fatal": return fatal; + case "Error": return error; + case "Warning": return warning; + case "Info": return info; + case "Note": return note; + default: return help; + } } } diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueLabelRule.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueLabelRule.java index 1a58f4d81..1d9b1099c 100644 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueLabelRule.java +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/IssueLabelRule.java @@ -39,8 +39,6 @@ public class IssueLabelRule implements LabelRule { public Map getLabel(ReadGraph graph, Object content) throws DatabaseException { Variable issue = (Variable)content; - //Layer0 L0 = Layer0.getInstance(graph); - //IssueResource ISSUE = IssueResource.getInstance(graph); String description = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "HasDescription") ); String resource = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "resource") ); String path = StringUtils.safeString( (String) issue.getPossiblePropertyValue(graph, "path") ); diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/ModeledActions.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/ModeledActions.java deleted file mode 100644 index 84118d08a..000000000 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/ModeledActions.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.simantics.issues.ui; - -import java.util.Collection; -import java.util.Collections; -import java.util.Set; - -import org.simantics.issues.ui.ontology.IssueUIResource; - -public class ModeledActions extends org.simantics.modeling.ui.actions.ModeledActions { - - final static public Set browseContexts = Collections.singleton(IssueUIResource.URIs.ActionContext); - - public Collection getBrowseContexts() { - return browseContexts; - } - -} diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/RunActiveValidations.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/RunActiveValidations.java index d2e257211..803324613 100644 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/RunActiveValidations.java +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/RunActiveValidations.java @@ -31,6 +31,7 @@ import org.simantics.Simantics; import org.simantics.SleepingDatabaseJob; import org.simantics.db.Issue; import org.simantics.db.ReadGraph; +import org.simantics.db.RequestProcessor; import org.simantics.db.Resource; import org.simantics.db.Session; import org.simantics.db.common.request.Queries; @@ -66,7 +67,7 @@ public class RunActiveValidations extends AbstractHandler { final Session session = Simantics.getSession(); // 1. query for which composites to run the validation - final Collection validations = new ArrayList(); + final Collection validations = new ArrayList<>(); final BatchIssueValidationContext context = new BatchIssueValidationContext(); try { @@ -79,12 +80,9 @@ public class RunActiveValidations extends AbstractHandler { Resource model = session.sync(new PossibleActiveModel(Simantics.getProjectResource())); if(model == null) return; - Collection activeSources = session.syncRequest(new SelectedModelBatchIssueSources(model)); - for(Resource source : activeSources) { - BatchIssueSource bis = session.syncRequest(Queries.adapt(source, BatchIssueSource.class, true)); - if(bis != null) - validations.add(bis); - } + toBatchIssueSources(session, + session.syncRequest(new SelectedModelBatchIssueSources(model)), + validations); SubMonitor.convert(monitor, "Preparing resources for validation", 100); context.contexts = Collections.singletonList(model); @@ -111,12 +109,21 @@ public class RunActiveValidations extends AbstractHandler { // Operation cancelled, ignore. return; } - + if(!validations.isEmpty() && !context.contexts.isEmpty()) run(postValidation, validations, context); } + static Collection toBatchIssueSources(RequestProcessor processor, Collection sources, Collection result) throws DatabaseException { + for (Resource source : sources) { + BatchIssueSource bis = processor.syncRequest(Queries.adapt(source, BatchIssueSource.class, true)); + if (bis != null) + result.add(bis); + } + return result; + } + public static void run(Runnable postValidation, final Collection validations, final BatchIssueValidationContext context) { // Run the validations for the selected composites SleepingDatabaseJob dbLock = new SleepingDatabaseJob("Validation"); @@ -139,7 +146,7 @@ public class RunActiveValidations extends AbstractHandler { @Override public Collection perform(ReadGraph graph) throws DatabaseException { IssueResource ISSUE = IssueResource.getInstance(graph); - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList<>(); for (Resource issue : graph.syncRequest(new ManagedIssues(resource))) { Resource list = graph.getSingleObject(issue, ISSUE.Issue_HasContexts); List l = ListUtils.toList(graph, list); diff --git a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/UpdateIssuesForOpenDiagrams.java b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/UpdateIssuesForOpenDiagrams.java index 9b2040c4b..0f7cec48d 100644 --- a/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/UpdateIssuesForOpenDiagrams.java +++ b/bundles/org.simantics.issues.ui/src/org/simantics/issues/ui/handler/UpdateIssuesForOpenDiagrams.java @@ -34,7 +34,6 @@ import org.simantics.browsing.ui.common.ErrorLogger; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.Session; -import org.simantics.db.common.request.Queries; import org.simantics.db.common.request.ReadRequest; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.request.ActiveModels; @@ -67,7 +66,7 @@ public class UpdateIssuesForOpenDiagrams extends AbstractHandler { } public static void update(Runnable postValidation) throws DatabaseException, PartInitException { - final List inputs = new ArrayList(); + final List inputs = new ArrayList<>(); IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); for (IWorkbenchWindow wb : windows) { IWorkbenchPage pages[] = wb.getPages(); @@ -82,9 +81,9 @@ public class UpdateIssuesForOpenDiagrams extends AbstractHandler { } } - final Set compositesToValidate = new TreeSet(); - final Collection validations = new ArrayList(); - final Collection activeModels = new ArrayList(); + final Set compositesToValidate = new TreeSet<>(); + final Collection validations = new ArrayList<>(); + final Collection activeModels = new ArrayList<>(); final BatchIssueValidationContext context = new BatchIssueValidationContext(); try { @@ -98,11 +97,9 @@ public class UpdateIssuesForOpenDiagrams extends AbstractHandler { activeModels.addAll(session.syncRequest(new ActiveModels(project))); if(activeModels.size() != 1) return; - Collection activeSources = session.syncRequest(new SelectedModelBatchIssueSources(activeModels.iterator().next())); - for(Resource source : activeSources) { - BatchIssueSource bis = session.syncRequest(Queries.adapt(source, BatchIssueSource.class)); - validations.add(bis); - } + RunActiveValidations.toBatchIssueSources(session, + session.syncRequest(new SelectedModelBatchIssueSources(activeModels.iterator().next())), + validations); session.syncRequest(new ReadRequest() { @Override -- 2.47.1