Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2013-05-28 15:49:13 +0000
committercletavernie2013-05-28 15:49:13 +0000
commitf02842995f54c8059f121b396658e288b71cc1be (patch)
tree92b26461a31954685a6dcb8509222c6233f1ed6d /plugins/infra/services/org.eclipse.papyrus.infra.services.navigation
parent183d971527e1b1514460b85aa0aa26fb9dacbdc4 (diff)
downloadorg.eclipse.papyrus-f02842995f54c8059f121b396658e288b71cc1be.tar.gz
org.eclipse.papyrus-f02842995f54c8059f121b396658e288b71cc1be.tar.xz
org.eclipse.papyrus-f02842995f54c8059f121b396658e288b71cc1be.zip
402662: [Editor - Services] Papyrus shall provide a Service to open page(s) associated to an Element
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402662 399882: [ModelExplorer] Papyrus shall enable navigation between typed model elements shown in views and the model explorer https://bugs.eclipse.org/bugs/show_bug.cgi?id=399882 Let the OpenElementService use the NavigationService to reveal elements in Diagrams and ModelExplorer
Diffstat (limited to 'plugins/infra/services/org.eclipse.papyrus.infra.services.navigation')
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationService.java21
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/impl/NavigationServiceImpl.java21
2 files changed, 41 insertions, 1 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationService.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationService.java
index 28270407290..729e2f5ca3c 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationService.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/NavigationService.java
@@ -29,7 +29,26 @@ import org.eclipse.swt.widgets.Control;
*/
public interface NavigationService extends IService, NavigationContributor {
- public SelectionMenu createNavigationList(Object data, Control parent);
+ /**
+ * Creates a Selection Menu to display all the NavigableElement which can be reached from an element
+ *
+ * @param fromElement
+ * @param parent
+ * @return
+ */
+ public SelectionMenu createNavigationList(Object fromElement, Control parent);
+ /**
+ * Navigate to the target of the given NavigableElement (e.g. To the type of a TypedElement)
+ *
+ * @param navigableElement
+ */
public void navigate(NavigableElement navigableElement);
+
+ /**
+ * Navigate directly to the given element (e.g. a UML Element)
+ *
+ * @param element
+ */
+ public void navigate(Object element);
}
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/impl/NavigationServiceImpl.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/impl/NavigationServiceImpl.java
index b01eb1865ad..e27797002d3 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/impl/NavigationServiceImpl.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.navigation/src/org/eclipse/papyrus/infra/services/navigation/service/impl/NavigationServiceImpl.java
@@ -361,4 +361,25 @@ public class NavigationServiceImpl implements NavigationService {
}
}
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void navigate(Object element) {
+ if(registry == null) {
+ throw new IllegalStateException("The navigation service is not initialized");
+ }
+
+ for(NavigationTargetProvider provider : getNavigationTargetProviders()) {
+ NavigationTarget target = provider.getNavigationTarget(registry);
+
+ if(target == null) {
+ continue;
+ }
+
+ if(target.revealElement(element)) {
+ return;
+ }
+ }
+ }
}

Back to the top