Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/RepresentationDescriptionQuery.java')
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/RepresentationDescriptionQuery.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/RepresentationDescriptionQuery.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/RepresentationDescriptionQuery.java
new file mode 100644
index 0000000000..d1d3badba6
--- /dev/null
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/RepresentationDescriptionQuery.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.business.api.query;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.sirius.description.RepresentationDescription;
+import org.eclipse.sirius.description.Sirius;
+
+/**
+ * A class aggregating all the queries (read-only!) having a
+ * RepresentationDescription as a starting point.
+ *
+ * @author cbrun
+ *
+ */
+public class RepresentationDescriptionQuery {
+
+ private RepresentationDescription vp;
+
+ /**
+ * Create a new query.
+ *
+ * @param vp
+ * the starting description.
+ */
+ public RepresentationDescriptionQuery(RepresentationDescription vp) {
+ this.vp = vp;
+ }
+
+ /**
+ * return the Sirius defining the representation description.
+ *
+ * @return the Sirius defining the representation description.
+ */
+ public Sirius getParentSirius() {
+ EObject current = vp;
+ while (current != null) {
+ current = current.eContainer();
+ if (current instanceof Sirius) {
+ return (Sirius) current;
+ }
+ }
+ return null;
+ }
+}

Back to the top