]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/ui/DiagramModelHints.java
Rid TypicalPropertyTester of database read transactions
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / ui / DiagramModelHints.java
index e410edb2a46f1e7b8fa28a06e3658573ac1361ec..84a25f2de4654eb489bed7460f8a5e1cd8f91c2a 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * Copyright (c) 2007, 2019 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,9 +8,12 @@
  *
  * Contributors:
  *     VTT Technical Research Centre of Finland - initial API and implementation
+ *     Semantum Oy - gitlab #399
  *******************************************************************************/
 package org.simantics.diagram.ui;
 
+import java.util.Set;
+
 import org.simantics.db.Resource;
 import org.simantics.db.UndoContext;
 import org.simantics.db.common.ResourceArray;
@@ -40,6 +43,29 @@ public class DiagramModelHints {
 
     public static final Key KEY_DIAGRAM_RESOURCE_ARRAY = new KeyOf(ResourceArray.class, "DIAGRAM_RESOURCE_ARRAY");
 
+    /**
+     * Holds a value of Set<String> which should contain the type {@link Resource}
+     * URIs of all the types of the diagram resource. This allows doing
+     * type-checking for the diagram based on pure string instead of having to do
+     * database transactions to check types.
+     */
+    public static final Key KEY_DIAGRAM_RESOURCE_TYPE_URIS = new KeyOf(Set.class, "DIAGRAM_RESOURCE_TYPE_URIS");
+
+    /**
+     * Holds a value of Set<String> which should contain the type {@link Resource}
+     * URIs of all the types of the composite resource mapped to the diagram
+     * resource. This allows doing type-checking for the diagram based on pure
+     * string instead of having to do database transactions to check types.
+     */
+    public static final Key KEY_MAPPED_COMPOSITE_RESOURCE_TYPE_URIS = new KeyOf(Set.class, "MAPPED_DIAGRAM_COMPOSITE_RESOURCE_TYPE_URIS");
+
+    /**
+     * Set to the object value if the current diagram editor has a single
+     * statement/object for the {@link ModelingResources#URIs#HasDiagramSource}
+     * relation.
+     */
+    public static final Key KEY_HAS_DIAGRAM_SOURCE = new KeyOf(Resource.class, "MOD.HasDiagramSource");
+
     /**
      * A hint for defining and extra pass for loading/initializing an element
      * after the current pass. It is possible to request for infinitely many