Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2011-10-25 07:59:50 -0400
committercletavernie2011-10-25 07:59:50 -0400
commit6c8ef497ffecc43373f9c5e66089f26e2d9afba2 (patch)
tree193e1971a7fc9cdb600a3fd7d01bf9fe59299ce9 /plugins/core/org.eclipse.papyrus.navigation
parent734e34828d49771a6e1f9a807018be1cee5ea41e (diff)
downloadorg.eclipse.papyrus-6c8ef497ffecc43373f9c5e66089f26e2d9afba2.tar.gz
org.eclipse.papyrus-6c8ef497ffecc43373f9c5e66089f26e2d9afba2.tar.xz
org.eclipse.papyrus-6c8ef497ffecc43373f9c5e66089f26e2d9afba2.zip
359057: [Architecture - SVN - Build] The Papyrus architecture should be refactored
https://bugs.eclipse.org/bugs/show_bug.cgi?id=359057
Diffstat (limited to 'plugins/core/org.eclipse.papyrus.navigation')
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/.classpath7
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/.project28
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/META-INF/MANIFEST.MF23
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/about.html28
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/build.properties13
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/icons/BACK.pngbin655 -> 0 bytes
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/icons/NEXT.pngbin676 -> 0 bytes
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/icons/TOP.pngbin636 -> 0 bytes
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/icons/UP.pngbin652 -> 0 bytes
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/plugin.properties12
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/plugin.xml244
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/schema/navigationColorProviders.exsd86
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/schema/navigationDecoratorRules.exsd111
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/schema/navigationRules.exsd87
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Activator.java98
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreateDiagramWithNavigationHandler.java141
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreatedNavigableElement.java66
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/ExistingNavigableElement.java37
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IBaseNameSetter.java29
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IModelLinker.java27
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/INavigationRule.java43
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Messages.java31
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigableElement.java66
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigationHelper.java154
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecorator.java216
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java98
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/BackNavigateHandler.java54
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/NextNavigateHandler.java53
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/TopNavigateHandler.java105
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/UpNavigateHandler.java93
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/messages.properties8
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/INavigationPreferenceConstant.java37
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferenceInitializer.java40
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferencePage.java49
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/Messages.java27
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/MultiDiagramDialog.java176
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/PropertyTester.java77
-rw-r--r--plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/messages.properties6
39 files changed, 0 insertions, 2378 deletions
diff --git a/plugins/core/org.eclipse.papyrus.navigation/.classpath b/plugins/core/org.eclipse.papyrus.navigation/.classpath
deleted file mode 100644
index 2d1a4302f04..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/.project b/plugins/core/org.eclipse.papyrus.navigation/.project
deleted file mode 100644
index 9e5180418f0..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.navigation</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/.settings/org.eclipse.jdt.core.prefs b/plugins/core/org.eclipse.papyrus.navigation/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 07082ae85ea..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Jan 24 11:06:16 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/core/org.eclipse.papyrus.navigation/META-INF/MANIFEST.MF b/plugins/core/org.eclipse.papyrus.navigation/META-INF/MANIFEST.MF
deleted file mode 100644
index 13787829129..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.papyrus.navigation;singleton:=true
-Bundle-Version: 0.8.1.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.papyrus.core;bundle-version="0.8.0";visibility:=reexport,
- org.eclipse.papyrus.commands,
- org.eclipse.papyrus.preferences;bundle-version="0.8.0",
- org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.8.0",
- org.eclipse.papyrus.ui.toolbox;bundle-version="0.8.0",
- org.eclipse.core.expressions;bundle-version="3.4.300",
- org.eclipse.papyrus.modelexplorer;bundle-version="0.8.1",
- org.eclipse.ui.navigator;bundle-version="3.5.100",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
- org.eclipse.papyrus.ui.perspectiveconfiguration
-Export-Package: org.eclipse.papyrus.navigation,
- org.eclipse.papyrus.navigation.decorator,
- org.eclipse.papyrus.navigation.preference
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.papyrus.navigation.Activator
diff --git a/plugins/core/org.eclipse.papyrus.navigation/about.html b/plugins/core/org.eclipse.papyrus.navigation/about.html
deleted file mode 100644
index 82d49bf5f81..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/build.properties b/plugins/core/org.eclipse.papyrus.navigation/build.properties
deleted file mode 100644
index 9e312115619..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-#Mon Sep 12 09:29:58 CEST 2011
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- schema/,\
- plugin.properties,\
- about.html,\
- icons/
-output..=bin/
-src.includes=about.html,schema/,META-INF/,.,plugin.xml,plugin.properties
-source..=src/
-bin..=bin/
diff --git a/plugins/core/org.eclipse.papyrus.navigation/icons/BACK.png b/plugins/core/org.eclipse.papyrus.navigation/icons/BACK.png
deleted file mode 100644
index 659cd90d7f8..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/icons/BACK.png
+++ /dev/null
Binary files differ
diff --git a/plugins/core/org.eclipse.papyrus.navigation/icons/NEXT.png b/plugins/core/org.eclipse.papyrus.navigation/icons/NEXT.png
deleted file mode 100644
index 6ef8de76e0f..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/icons/NEXT.png
+++ /dev/null
Binary files differ
diff --git a/plugins/core/org.eclipse.papyrus.navigation/icons/TOP.png b/plugins/core/org.eclipse.papyrus.navigation/icons/TOP.png
deleted file mode 100644
index 70f2c996cd7..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/icons/TOP.png
+++ /dev/null
Binary files differ
diff --git a/plugins/core/org.eclipse.papyrus.navigation/icons/UP.png b/plugins/core/org.eclipse.papyrus.navigation/icons/UP.png
deleted file mode 100644
index fa9a7d71b56..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/icons/UP.png
+++ /dev/null
Binary files differ
diff --git a/plugins/core/org.eclipse.papyrus.navigation/plugin.properties b/plugins/core/org.eclipse.papyrus.navigation/plugin.properties
deleted file mode 100644
index fcdcaf2ad07..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/plugin.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#################################################################################
-# Copyright (c) 2010 Atos Origin.
-# 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:
-# Atos Origin - Initial API and Implementation
-##################################################################################
-pluginName=Papyrus navigation (Incubation)
-providerName=Eclipse Modeling Project
diff --git a/plugins/core/org.eclipse.papyrus.navigation/plugin.xml b/plugins/core/org.eclipse.papyrus.navigation/plugin.xml
deleted file mode 100644
index 75f4a22b0ed..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/plugin.xml
+++ /dev/null
@@ -1,244 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension-point id="navigationRules" name="navigationRules" schema="schema/navigationRules.exsd"/>
- <extension-point id="navigationDecoratorRules" name="navigationDecoratorRules" schema="schema/navigationDecoratorRules.exsd"/>
- <extension-point id="navigationColorProviders" name="navigationColorProviders" schema="schema/navigationColorProviders.exsd"/>
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- category="org.eclipse.papyrus.preferences.generalcategory"
- class="org.eclipse.papyrus.navigation.preference.NavigationPreferencePage"
- id="org.eclipse.papyrus.navigation"
- name="Navigation">
- </page>
- </extension>
- <extension
- point="org.eclipse.core.runtime.preferences">
- <initializer
- class="org.eclipse.papyrus.navigation.preference.NavigationPreferenceInitializer">
- </initializer>
- </extension>
- <extension
- point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <decoratorProvider
- class="org.eclipse.papyrus.navigation.decorator.NavigationDecoratorProvider">
- <Priority
- name="Medium">
- </Priority>
- </decoratorProvider>
- </extension>
-
- <extension
- point="org.eclipse.ui.commands">
- <category
- name="Navigation Command"
- id="org.eclipse.papyrus.navigation.commands.category">
- </category>
- <command
- name="Back Navigation Command"
- categoryId="org.eclipse.papyrus.navigation.commands.category"
- id="org.eclipse.papyrus.navigation.commands.backNavigationCommand">
- </command>
- <command
- categoryId="org.eclipse.papyrus.navigation.commands.category"
- id="org.eclipse.papyrus.navigation.commands.upNavigationCommand"
- name="Up Navigation Command">
- </command>
- <command
- categoryId="org.eclipse.papyrus.navigation.commands.category"
- id="org.eclipse.papyrus.navigation.commands.topNavigationCommand"
- name="Top Navigation Command">
- </command>
- <command
- categoryId="org.eclipse.papyrus.navigation.commands.category"
- id="org.eclipse.papyrus.navigation.commands.nextNavigationCommand"
- name="Next Navigation Command">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- commandId="org.eclipse.papyrus.navigation.commands.backNavigationCommand"
- class="org.eclipse.papyrus.navigation.handlers.BackNavigateHandler">
- <enabledWhen>
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.navigation.isBackCommandPossible">
- </test>
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.papyrus.navigation.handlers.NextNavigateHandler"
- commandId="org.eclipse.papyrus.navigation.commands.nextNavigationCommand">
- <enabledWhen>
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.navigation.isNextCommandPossible">
- </test>
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.papyrus.navigation.handlers.UpNavigateHandler"
- commandId="org.eclipse.papyrus.navigation.commands.upNavigationCommand">
- <enabledWhen>
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.navigation.isUpCommandPossible">
- </test>
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.papyrus.navigation.handlers.TopNavigateHandler"
- commandId="org.eclipse.papyrus.navigation.commands.topNavigationCommand">
- <enabledWhen>
- <with
- variable="selection">
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.navigation.isTopCommandPossible">
- </test>
- </with>
- </enabledWhen>
- </handler>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
- <toolbar
- id="org.eclipse.papyrus.navigation.toolbars.navigationToolbar"
- label="Navigation Papyrus Diagram">
- <command
- commandId="org.eclipse.papyrus.navigation.commands.backNavigationCommand"
- icon="icons/BACK.png"
- id="org.eclipse.papyrus.navigation.toolbars.BackCommand"
- style="push"
- tooltip="BACK">
- <visibleWhen>
- <or>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- <reference
- definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
- </reference>
- </or>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.navigation.commands.nextNavigationCommand"
- icon="icons/NEXT.png"
- id="org.eclipse.papyrus.navigation.toolbars.NextCommand"
- style="push"
- tooltip="NEXT">
- <visibleWhen>
- <or>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- <reference
- definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
- </reference>
- </or>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.navigation.commands.upNavigationCommand"
- icon="icons/UP.png"
- id="org.eclipse.papyrus.navigation.toolbars.UpCommand"
- style="push"
- tooltip="UP">
- <visibleWhen>
- <or>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- <reference
- definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
- </reference>
- </or>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.navigation.commands.topNavigationCommand"
- icon="icons/TOP.png"
- id="org.eclipse.papyrus.navigation.toolbars.TopCommand"
- style="push"
- tooltip="TOP">
- <visibleWhen>
- <or>
- <reference
- definitionId="org.eclipse.papyrus.diagram.common.IsPapyrusActiveWithUMLModel">
- </reference>
- <reference
- definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML">
- </reference>
- </or>
- </visibleWhen>
- </command>
- </toolbar>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.papyrus.navigation.utils.PropertyTester"
- id="org.eclipse.papyrus.navigation.PropertyTester"
- namespace="org.eclipse.papyrus.navigation"
- properties="isNextCommandPossible"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- <propertyTester
- class="org.eclipse.papyrus.navigation.utils.PropertyTester"
- id="org.eclipse.papyrus.navigation.PropertyTester"
- namespace="org.eclipse.papyrus.navigation"
- properties="isBackCommandPossible"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- <propertyTester
- class="org.eclipse.papyrus.navigation.utils.PropertyTester"
- id="org.eclipse.papyrus.navigation.PropertyTester"
- namespace="org.eclipse.papyrus.navigation"
- properties="isUpCommandPossible"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- <propertyTester
- class="org.eclipse.papyrus.navigation.utils.PropertyTester"
- id="org.eclipse.papyrus.navigation.PropertyTester"
- namespace="org.eclipse.papyrus.navigation"
- properties="isTopCommandPossible"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
- </extension>
- <extension
- point="org.eclipse.papyrus.ui.perspectiveconfiguration">
- <configuration
- perspectiveID="org.eclipse.papyrus.core.perspective">
- <toolbar
- toolbarID="org.eclipse.papyrus.navigation.toolbars.navigationToolbar">
- </toolbar>
- <command
- commandID="org.eclipse.papyrus.navigation.commands.backNavigationCommand">
- </command>
- <command
- commandID="org.eclipse.papyrus.navigation.commands.nextNavigationCommand">
- </command>
- <command
- commandID="org.eclipse.papyrus.navigation.commands.topNavigationCommand">
- </command>
- <command
- commandID="org.eclipse.papyrus.navigation.commands.upNavigationCommand">
- </command>
- </configuration>
- </extension>
-</plugin>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationColorProviders.exsd b/plugins/core/org.eclipse.papyrus.navigation/schema/navigationColorProviders.exsd
deleted file mode 100644
index 9ac9da2c940..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationColorProviders.exsd
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.navigation" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.navigation" id="navigationColorProviders" name="navigationColorProviders"/>
- </appinfo>
- <documentation>
- Color provider used by the decorator to set the color of the navigation arrow.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="navigationColorProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="navigationColorProvider">
- <annotation>
- <documentation>
- Color provider used by the decorator to set the color of the navigation arrow.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="provider" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jface.viewers.IColorProvider"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationDecoratorRules.exsd b/plugins/core/org.eclipse.papyrus.navigation/schema/navigationDecoratorRules.exsd
deleted file mode 100644
index eab5400d3b5..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationDecoratorRules.exsd
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.navigation" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.navigation" id="navigationDecoratorRules" name="navigationDecoratorRules"/>
- </appinfo>
- <documentation>
- Allow to specify classes where the navigation decorator should be used.
-Navigation computation can be intensive so the decorator is not registered on each element.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="decoratedClass" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="forbiddenClass" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="decoratedClass">
- <annotation>
- <documentation>
- Elements of this class should have the navigation decorator.
-It uses instanceof so all the subclasses are also decorated.
-You can use forbiddenClass to restrict this behavior.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="forbiddenClass">
- <annotation>
- <documentation>
- Elements of this class should not have the navigation decorator.
-It uses instanceof so all the subclasses are also forbidden.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationRules.exsd b/plugins/core/org.eclipse.papyrus.navigation/schema/navigationRules.exsd
deleted file mode 100644
index 8a588bd3ba2..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/schema/navigationRules.exsd
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.navigation" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.navigation" id="navigationRules" name="navigationRules"/>
- </appinfo>
- <documentation>
- This extension point allows to register navigation rules so they can be used by the navigation handler.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="navigationRule" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="navigationRule">
- <annotation>
- <documentation>
- Contribute a navigation rule to the navigation handler.
-see INavigationRule for more informations.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="rule" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.navigation.INavigationRule"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
-
-
-
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Activator.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Activator.java
deleted file mode 100644
index 08a476750a8..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Activator.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.papyrus.navigation.preference.NavigationPreferenceInitializer;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.navigation"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- NavigationPreferenceInitializer preferenceInitializer = new NavigationPreferenceInitializer();
- preferenceInitializer.initializeDefaultPreferences();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Returns the active workbench shell
- *
- * @return the active workbench shell
- */
- public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow workBenchWindow = getActiveWorkbenchWindow();
- if(workBenchWindow == null) {
- return null;
- }
- return workBenchWindow.getShell();
- }
-
- /**
- * Returns the active workbench window
- *
- * @return the active workbench window
- */
- public static IWorkbenchWindow getActiveWorkbenchWindow() {
- if(getDefault() == null) {
- return null;
- }
- IWorkbench workBench = getDefault().getWorkbench();
- if(workBench == null) {
- return null;
- }
- return workBench.getActiveWorkbenchWindow();
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreateDiagramWithNavigationHandler.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreateDiagramWithNavigationHandler.java
deleted file mode 100644
index 4843b43c427..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreateDiagramWithNavigationHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.core.extension.commands.ICreationCommand;
-import org.eclipse.papyrus.core.extension.commands.ICreationCondition;
-import org.eclipse.papyrus.core.utils.BusinessModelResolver;
-import org.eclipse.papyrus.core.utils.DiResourceSet;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.ui.toolbox.dialog.InformationDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This command handler will try to create a diagram on the currently selected
- * element, using navigation if necessary. The action is always available and
- * the check is done in the run to avoid heavy navigation computation on each
- * selection change.
- *
- * @author mvelten
- *
- */
-public abstract class CreateDiagramWithNavigationHandler extends AbstractHandler {
-
- private ICreationCondition creationCondition;
-
- private ICreationCommand creationCommand;
-
- public CreateDiagramWithNavigationHandler(ICreationCommand creationCommand, ICreationCondition creationCondition) {
- super();
- this.creationCommand = creationCommand;
- this.creationCondition = creationCondition;
- }
-
- @Override
- public boolean isEnabled() {
- return true;
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- NavigableElement navElement = getNavigableElementWhereToCreateDiagram();
-
- if(navElement == null) {
- InformationDialog dialog = new InformationDialog(Display.getCurrent().getActiveShell(), "Impossible diagram creation", "It is not possible to create this diagram on the selected element.", null, null, SWT.OK, MessageDialog.WARNING, new String[]{ IDialogConstants.OK_LABEL });
- dialog.open();
- } else {
- createDiagram(navElement);
- }
- return null;
- }
-
- private NavigableElement getNavigableElementWhereToCreateDiagram() {
- EObject selectedElement = getSelectedElement();
-
- if(selectedElement != null) {
- // First check if the current element can host the requested diagram
- if(creationCondition.create(selectedElement)) {
- return new ExistingNavigableElement(selectedElement, null);
- } else {
- List<NavigableElement> navElements = NavigationHelper.getInstance().getAllNavigableElements(selectedElement);
- // this will sort elements by navigation depth
- Collections.sort(navElements);
-
- for(NavigableElement navElement : navElements) {
- // ignore existing elements because we want a hierarchy to
- // be created if it is not on the current element
- if(navElement instanceof CreatedNavigableElement && creationCondition.create(navElement.getElement())) {
- return navElement;
- }
- }
- }
- }
- return null;
- }
-
- private void createDiagram(NavigableElement navElement) {
- DiResourceSet diResourceSet = EditorUtils.getDiResourceSet();
-
- if(navElement != null && diResourceSet != null) {
- try {
- CompositeCommand command = NavigationHelper.getLinkCreateAndOpenNavigableDiagramCommand(navElement, creationCommand, null, diResourceSet);
- diResourceSet.getTransactionalEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- } catch (Exception e) {
- }
- }
- }
-
- private EObject getSelectedElement() {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- return resolveSemanticObject(obj);
- }
- return null;
- }
-
- /**
- * Resolve semantic element
- *
- * @param object
- * the object to resolve
- * @return <code>null</code> or the semantic element associated to the
- * specified object
- */
- protected EObject resolveSemanticObject(Object object) {
- if(object instanceof EObject) {
- return (EObject)object;
- }
- Object businessObject = BusinessModelResolver.getInstance().getBusinessModel(object);
- if(businessObject instanceof EObject) {
- return (EObject)businessObject;
- }
- return null;
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreatedNavigableElement.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreatedNavigableElement.java
deleted file mode 100644
index 907f0436f25..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/CreatedNavigableElement.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * This class represents an element that have been created by the navigation.
- * This element is not currently linked to the model, but it can be by using
- * linkToModel if the user decides to navigate to it, to create a diagram on it
- * for example.
- *
- * @author mvelten
- *
- */
-public class CreatedNavigableElement extends NavigableElement {
-
- protected NavigableElement previousNavigableElement = null;
-
- private IModelLinker modelLinker = null;
-
- private IBaseNameSetter baseNameSetter = null;
-
- /**
- * This constructor initiates a navigable element from a newly created
- * element. This element is not directly linked to its container.
- * linkToModel() needs to be defined and call when you want to link it.
- *
- * @param element
- * @param previousNavigableElement
- */
- public CreatedNavigableElement(EObject element, NavigableElement previousNavigableElement, EStructuralFeature feature, IModelLinker modelLinker, IBaseNameSetter baseNameSetter) {
- super(element, previousNavigableElement, feature);
- this.previousNavigableElement = previousNavigableElement;
- this.modelLinker = modelLinker;
- this.baseNameSetter = baseNameSetter;
- }
-
- public NavigableElement getPreviousNavigableElement() {
- return previousNavigableElement;
- }
-
- public void linkToModel() {
- if(modelLinker != null) {
- modelLinker.linkToModel(getElement());
- }
- }
-
- public void setBaseName(String base) {
- if(baseNameSetter != null) {
- baseNameSetter.setBaseName(base, getElement());
- }
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/ExistingNavigableElement.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/ExistingNavigableElement.java
deleted file mode 100644
index 729569f9947..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/ExistingNavigableElement.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * This class represents an element that already exists in the navigated model.
- *
- * @author mvelten
- *
- */
-public class ExistingNavigableElement extends NavigableElement {
-
- /**
- * This constructor initiates a navigable element from an existing model
- * element.
- *
- * @param element
- */
- public ExistingNavigableElement(EObject element, EStructuralFeature feature) {
- super(element, feature);
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IBaseNameSetter.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IBaseNameSetter.java
deleted file mode 100644
index 6b03450c0b5..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IBaseNameSetter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * This interface allows to set the base name of an element. The base can then
- * be used to derive a more useful name, containing the name of the element type
- * for example.
- *
- * @author mvelten
- *
- */
-public interface IBaseNameSetter {
-
- public void setBaseName(String base, EObject toName);
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IModelLinker.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IModelLinker.java
deleted file mode 100644
index 464844fee65..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/IModelLinker.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * This interface is used to link an element to the original model.
- *
- * @author mvelten
- *
- */
-public interface IModelLinker {
-
- public void linkToModel(EObject toLink);
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/INavigationRule.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/INavigationRule.java
deleted file mode 100644
index c07a1347174..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/INavigationRule.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * This interface defines a navigation rule.
- *
- * @author mvelten
- *
- */
-public interface INavigationRule {
-
- /**
- * Tests if an element is supported by this rule.
- *
- * @param element
- * @return
- */
- public boolean handle(EObject element);
-
- /**
- * Retrieve a list of the next possible navigation possibilities.
- *
- * @param currentNavElement
- * @return a list of navigable elements
- */
- public List<NavigableElement> getNextPossibleElements(NavigableElement currentNavElement);
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Messages.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Messages.java
deleted file mode 100644
index 76b96a2430c..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/Messages.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.navigation.messages"; //$NON-NLS-1$
-
- public static String DoubleClickNavigationText;
-
- public static String Explicit_ImplicitNavigation_Text;
-
- public static String ExplicitNavigation_Text;
-
- public static String No_Navigation_Text;
-
- public static String DecoratorVisibilityText;
-
- public static String DecoratorDisabled_Text;
-
- public static String DisplayOnly_Text;
-
- public static String Everywhere_Text;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigableElement.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigableElement.java
deleted file mode 100644
index a776559f333..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigableElement.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-/**
- * This class represents an element which can be accessed from an other element
- * throught a feature using defined navigation rules.
- *
- * @author mvelten
- *
- */
-public abstract class NavigableElement implements Comparable<NavigableElement> {
-
- private EObject element = null;
-
- private EStructuralFeature feature = null;
-
- private int depth = 0;
-
- public NavigableElement(EObject element, EStructuralFeature feature) {
- this.element = element;
- this.feature = feature;
- }
-
- public NavigableElement(EObject element, NavigableElement previousNavigableElement, EStructuralFeature feature) {
- this(element, feature);
- if(previousNavigableElement != null) {
- this.depth = previousNavigableElement.getDepth() + 1;
- }
- }
-
- public EObject getElement() {
- return element;
- }
-
- public EStructuralFeature getFeature() {
- return feature;
- }
-
- /**
- * Retrieve the navigation depth.
- *
- * @return the navigation depth
- */
- public int getDepth() {
- return depth;
- }
-
- public int compareTo(NavigableElement o) {
- return getDepth() - o.getDepth();
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigationHelper.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigationHelper.java
deleted file mode 100644
index 5b5d5f0f705..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/NavigationHelper.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.core.extension.commands.ICreationCommand;
-import org.eclipse.papyrus.core.utils.DiResourceSet;
-import org.eclipse.papyrus.core.utils.OpenDiagramCommand;
-
-public class NavigationHelper {
-
- private static class NavigationHelperHolder {
-
- public static final NavigationHelper instance = new NavigationHelper();
- }
-
- public static NavigationHelper getInstance() {
- return NavigationHelperHolder.instance;
- }
-
- private static final String EXTENSION_ID = "org.eclipse.papyrus.navigation.navigationRules";
-
- private static final String NAVIGATIONRULE_ID = "navigationRule";
-
- private static final String RULE_ID = "rule";
-
- private List<INavigationRule> navigationRules = new LinkedList<INavigationRule>();
-
- private NavigationHelper() {
- // Reading data from plugins
- IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
- for(IConfigurationElement configElement : configElements) {
- if(NAVIGATIONRULE_ID.equals(configElement.getName())) {
- try {
- Object obj = configElement.createExecutableExtension(RULE_ID);
- if(obj instanceof INavigationRule) {
- navigationRules.add((INavigationRule)obj);
- }
- } catch (CoreException e) {
- }
- }
- }
- }
-
- private void addNextNavigableElements(NavigableElement currentNavElement, List<NavigableElement> navElements) {
-
- navElements.add(currentNavElement);
-
- for(INavigationRule navigationRule : navigationRules) {
- if(navigationRule.handle(currentNavElement.getElement())) {
- List<NavigableElement> nextNavigableElements = navigationRule.getNextPossibleElements(currentNavElement);
- for(NavigableElement nextNavigableElement : nextNavigableElements) {
- addNextNavigableElements(nextNavigableElement, navElements);
- }
- }
- }
- }
-
- /**
- * get all navigation possibilities (existing or "to create" elements) from
- * the specified element.
- *
- * @param element
- * the element
- * @return a list of navigation possibilities
- */
- public List<NavigableElement> getAllNavigableElements(EObject element) {
- ArrayList<NavigableElement> navElements = new ArrayList<NavigableElement>();
- if(element != null) {
- addNextNavigableElements(new ExistingNavigableElement(element, null), navElements);
- }
- return navElements;
- }
-
- /**
- * This method link the created element with its parent and browse the
- * hierarchy to link the parents between them. Ultimately the hierarchy will
- * be attached to an {@link ExistingNavigableElement}, so to the original
- * model.
- *
- * @param createdNavElement
- */
- public static void linkToModel(CreatedNavigableElement createdNavElement) {
- NavigableElement navElement = createdNavElement;
- while(navElement instanceof CreatedNavigableElement) {
- CreatedNavigableElement cne = (CreatedNavigableElement)navElement;
- cne.linkToModel();
- navElement = cne.getPreviousNavigableElement();
- }
- }
-
- /**
- * Same behavior as {@link NavigationHelper#linkToModel(CreatedNavigableElement)} but set the
- * base name of the elements.
- *
- * @param createdNavElement
- * @param base
- */
- public static void setBaseName(CreatedNavigableElement createdNavElement, String base) {
- NavigableElement navElement = createdNavElement;
- while(navElement instanceof CreatedNavigableElement) {
- CreatedNavigableElement cne = (CreatedNavigableElement)navElement;
- cne.setBaseName(base);
- navElement = cne.getPreviousNavigableElement();
- }
- }
-
- public static CompositeCommand getLinkCreateAndOpenNavigableDiagramCommand(final NavigableElement navElement, ICreationCommand creationCommandInterface, final String diagramName, DiResourceSet diResourceSet) {
- CompositeCommand compositeCommand = new CompositeCommand("Create diagram");
-
- if(navElement instanceof CreatedNavigableElement) {
- compositeCommand.add(new AbstractTransactionalCommand(diResourceSet.getTransactionalEditingDomain(), "Create hierarchy", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- NavigationHelper.linkToModel((CreatedNavigableElement)navElement);
- NavigationHelper.setBaseName((CreatedNavigableElement)navElement, "");
- return CommandResult.newOKCommandResult();
- }
- });
- }
-
- ICommand createDiagCommand = creationCommandInterface.getCreateDiagramCommand(diResourceSet, navElement.getElement(), diagramName);
- compositeCommand.add(createDiagCommand);
- compositeCommand.add(new OpenDiagramCommand(diResourceSet.getTransactionalEditingDomain(), createDiagCommand));
-
- return compositeCommand;
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecorator.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecorator.java
deleted file mode 100644
index 27ab0aa2d42..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecorator.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010-2011 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation.decorator;
-
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.AbstractDecorator;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.papyrus.core.adaptor.gmf.DiagramsUtil;
-import org.eclipse.papyrus.core.utils.DiResourceSet;
-import org.eclipse.papyrus.navigation.ExistingNavigableElement;
-import org.eclipse.papyrus.navigation.NavigableElement;
-import org.eclipse.papyrus.navigation.NavigationHelper;
-import org.eclipse.papyrus.navigation.preference.INavigationPreferenceConstant;
-import org.eclipse.papyrus.preferences.Activator;
-import org.eclipse.papyrus.ui.toolbox.draw2d.ManuallyDrawnShortcutDecorationFigure;
-import org.eclipse.swt.graphics.Color;
-
-public class NavigationDecorator extends AbstractDecorator implements Adapter {
-
- private static final String EXTENSION_ID = "org.eclipse.papyrus.navigation.navigationColorProviders";
-
- private static final String COLORPROVIDER_ID = "navigationColorProvider";
-
- private static final String PROVIDER_ID = "provider";
-
- private static List<IColorProvider> navigationColorProviders = new LinkedList<IColorProvider>();
-
- static {
- // Reading data from plugins
- IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
- for(IConfigurationElement configElement : configElements) {
- if(COLORPROVIDER_ID.equals(configElement.getName())) {
- try {
- Object obj = configElement.createExecutableExtension(PROVIDER_ID);
- if(obj instanceof IColorProvider) {
- navigationColorProviders.add((IColorProvider)obj);
- }
- } catch (CoreException e) {
- }
- }
- }
- }
-
- private Set<Resource> listenedNotationResources = new HashSet<Resource>();
-
- private ManuallyDrawnShortcutDecorationFigure shortcutFigure = new ManuallyDrawnShortcutDecorationFigure();
-
- private IGraphicalEditPart gep = null;
-
- private boolean displayOnly;
-
- public NavigationDecorator(IDecoratorTarget decoratorTarget) {
- super(decoratorTarget);
- decoratorTarget.installDecorator("navigationDecorator", this);
- shortcutFigure.setVisible(false);
-
- String decoratorVisibility = Activator.getDefault().getPreferenceStore().getString(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY);
- displayOnly = INavigationPreferenceConstant.DISPLAY_ONLY.equals(decoratorVisibility);
- }
-
- @Override
- public void deactivate() {
- super.deactivate();
- removeListenerFromAllResources();
- }
-
- public void activate() {
- EditPart editPart = (EditPart)getDecoratorTarget().getAdapter(EditPart.class);
- if(editPart instanceof IGraphicalEditPart) {
- gep = (IGraphicalEditPart)editPart;
-
- if(editPart instanceof ShapeEditPart) {
- setDecoration(getDecoratorTarget().addShapeDecoration(shortcutFigure, IDecoratorTarget.Direction.NORTH_EAST, -5, displayOnly));
- } else if(editPart instanceof ConnectionEditPart) {
- setDecoration(getDecoratorTarget().addConnectionDecoration(shortcutFigure, 20, displayOnly));
- }
- }
- refresh();
- }
-
- public void refresh() {
- if(gep != null) {
- View view = gep.getNotationView();
- EObject element = gep.resolveSemanticElement();
-
- removeListenerFromAllResources();
-
- Diagram currentDiagram = null;
- if(view != null) {
- currentDiagram = view.getDiagram();
- }
-
- if(currentDiagram != null) {
- addResourceListener(currentDiagram.eResource());
- }
-
- List<NavigableElement> navElements = NavigationHelper.getInstance().getAllNavigableElements(element);
-
- Color shortcutColor = null;
-
- for(NavigableElement navElement : navElements) {
- if(navElement instanceof ExistingNavigableElement) {
- EObject eObj = navElement.getElement();
- Resource res = eObj.eResource();
- if(res != null && res.getResourceSet() instanceof DiResourceSet) {
- Resource notationResource = ((DiResourceSet)res.getResourceSet()).getAssociatedNotationResource(eObj);
-
- addResourceListener(notationResource);
-
- List<Diagram> associatedDiagrams = DiagramsUtil.getAssociatedDiagramsFromNotationResource(eObj, notationResource);
-
- if(associatedDiagrams != null) {
- for(Diagram diag : associatedDiagrams) {
- addResourceListener(diag.eResource());
- if(!diag.equals(currentDiagram)) {
- for(IColorProvider provider : navigationColorProviders) {
- Color color = provider.getBackground(navElement);
- if(color != null) {
- if(shortcutColor == null) {
- shortcutColor = color;
- } else if(!shortcutColor.equals(color)) {
- // more than one color for this
- // element :
- // just use white in this case
- shortcutColor = ColorConstants.white;
- }
- break;
- }
- }
- }
- }
- }
- }
- }
- }
-
- if(shortcutColor == null) {
- shortcutFigure.setVisible(false);
- } else {
- shortcutFigure.setVisible(true);
- shortcutFigure.setBackgroundColor(shortcutColor);
- }
- }
- }
-
- private void addResourceListener(Resource r) {
- if(r != null) {
- synchronized(listenedNotationResources) {
- if(listenedNotationResources.add(r)) {
- r.eAdapters().add(this);
- }
- }
- }
- }
-
- private void removeListenerFromAllResources() {
- synchronized(listenedNotationResources) {
- for(Resource r : listenedNotationResources) {
- r.eAdapters().remove(this);
- }
- listenedNotationResources.clear();
- }
- }
-
- public void notifyChanged(Notification notification) {
- if(!notification.isTouch() && notification.getFeatureID(Resource.class) == Resource.RESOURCE__CONTENTS) {
- refresh();
- }
- }
-
- Notifier notifier;
-
- public Notifier getTarget() {
- return notifier;
- }
-
- public void setTarget(Notifier newTarget) {
- notifier = newTarget;
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java
deleted file mode 100644
index 4812a674be5..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/decorator/NavigationDecoratorProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation.decorator;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.papyrus.navigation.preference.INavigationPreferenceConstant;
-import org.eclipse.papyrus.preferences.Activator;
-
-public class NavigationDecoratorProvider extends AbstractProvider implements IDecoratorProvider {
-
- private static Set<Class<?>> forbiddenClasses = new HashSet<Class<?>>();
-
- private static Set<Class<?>> decoratedClasses = new HashSet<Class<?>>();
-
- private static final String EXTENSION_ID = "org.eclipse.papyrus.navigation.navigationDecoratorRules";
-
- private static final String FORBIDDENCLASS_ID = "forbiddenClass";
-
- private static final String DECORATEDCLASS_ID = "decoratedClass";
-
- private static final String CLASS_ID = "class";
-
- static {
- // Reading data from plugins
- IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
- for(IConfigurationElement configElement : configElements) {
- String className = configElement.getAttribute(CLASS_ID);
- Class<?> class_ = null;
- try {
- class_ = Platform.getBundle(configElement.getContributor().getName()).loadClass(className);
- } catch (Exception e) {
- }
-
- if(class_ != null) {
- if(FORBIDDENCLASS_ID.equals(configElement.getName())) {
- forbiddenClasses.add(class_);
- } else if(DECORATEDCLASS_ID.equals(configElement.getName())) {
- decoratedClasses.add(class_);
- }
- }
- }
- }
-
- public boolean provides(IOperation operation) {
- String decoratorVisibility = Activator.getDefault().getPreferenceStore().getString(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY);
- if(operation instanceof CreateDecoratorsOperation && !INavigationPreferenceConstant.DISABLED.equals(decoratorVisibility)) {
- IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation).getDecoratorTarget();
- EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart instanceof IPrimaryEditPart) {
- EObject element = ((IGraphicalEditPart)editPart).resolveSemanticElement();
- boolean decorate = false;
- for(Class<?> class_ : decoratedClasses) {
- if(class_.isInstance(element)) {
- decorate = true;
- break;
- }
- }
- for(Class<?> class_ : forbiddenClasses) {
- if(class_.isInstance(element)) {
- decorate = false;
- break;
- }
- }
- return decorate;
- }
- }
- return false;
- }
-
- public void createDecorators(IDecoratorTarget decoratorTarget) {
- new NavigationDecorator(decoratorTarget);
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/BackNavigateHandler.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/BackNavigateHandler.java
deleted file mode 100644
index eb3f3df020f..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/BackNavigateHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS)
- *******************************************************************************/
-
-package org.eclipse.papyrus.navigation.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * handler for Up command
- *
- */
-public class BackNavigateHandler extends AbstractHandler {
-
- private IEditorPart editor;
-
- private IPageMngr pageMngr;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- editor = HandlerUtil.getActiveEditor(event);
-
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- EditingDomain editingDomain = papyrusEditor.getEditingDomain();
- if(editingDomain instanceof TransactionalEditingDomain) {
- try {
- pageMngr = papyrusEditor.getServicesRegistry().getService(IPageMngr.class);
- pageMngr.openPrevious();
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
- }
-
- return null;
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/NextNavigateHandler.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/NextNavigateHandler.java
deleted file mode 100644
index 4a3d3bb8f7d..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/NextNavigateHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS)
- *******************************************************************************/
-
-package org.eclipse.papyrus.navigation.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * handler for Next command
- *
- */
-public class NextNavigateHandler extends AbstractHandler {
-
- private IEditorPart editor;
-
- private IPageMngr pageMngr;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- editor = HandlerUtil.getActiveEditor(event);
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- EditingDomain editingDomain = papyrusEditor.getEditingDomain();
- if(editingDomain instanceof TransactionalEditingDomain) {
- try {
- pageMngr = papyrusEditor.getServicesRegistry().getService(IPageMngr.class);
- pageMngr.openNext();
- } catch (ServiceException e) {
- e.printStackTrace();
- }
- }
- }
-
- return null;
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/TopNavigateHandler.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/TopNavigateHandler.java
deleted file mode 100644
index 50fc5fbe1f4..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/TopNavigateHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS)
- *******************************************************************************/
-
-package org.eclipse.papyrus.navigation.handlers;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.core.adaptor.gmf.DiagramsUtil;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.core.utils.OpenDiagramCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.navigation.Activator;
-import org.eclipse.papyrus.navigation.utils.MultiDiagramDialog;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.window.Window;
-
-/**
- * handler for Up command
- *
- */
-public class TopNavigateHandler extends AbstractHandler {
-
- private IEditorPart editor;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- editor = HandlerUtil.getActiveEditor(event);
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- EObject parent = papyrusEditor.getDiagram().getElement().eContainer();
- List<List<Diagram>> diagramsTemp = new Vector<List<Diagram>>();
- List<Diagram> diagrams = Collections.emptyList();
- List<Diagram> associatedDiag = Collections.emptyList();
- if(parent != null) {
- while(parent != null) {
- associatedDiag = DiagramsUtil.getAssociatedDiagrams(parent, null);
- if(!associatedDiag.isEmpty()) {
- diagramsTemp.add(associatedDiag);
- }
- parent = parent.eContainer();
- }
-
- while(diagrams.size() == 0 && diagramsTemp.size() != 0) {
- diagrams = diagramsTemp.get(diagramsTemp.size() - 1);
- diagramsTemp.remove(diagramsTemp.size() - 1);
-
- }
- openDialog(papyrusEditor, diagrams);
-
- }
- }
- return null;
- }
-
- /**
- * open the diagram if there is just one or open a dialog to choose the
- * diagram to open if there is more than one
- *
- * @param papyrusEditor
- * @param diagrams
- */
- private void openDialog(CoreMultiDiagramEditor papyrusEditor, List<Diagram> diagrams) {
- if(diagrams != null) {
- if(diagrams.size() == 1) {
- openDiagram(papyrusEditor, diagrams.get(0));
- } else if(diagrams.size() > 1) {
- MultiDiagramDialog multiDiagramDialog = new MultiDiagramDialog(Activator.getActiveWorkbenchShell(), diagrams);
- if(multiDiagramDialog.open() == Window.OK) {
- openDiagram(papyrusEditor, diagrams.get(multiDiagramDialog.getSelectedDiagram()));
- }
- }
- }
- }
-
- /**
- * open a dialog to choose which diagram have to be opened
- *
- * @param papyrusEditor
- * @param diagram
- */
- private void openDiagram(CoreMultiDiagramEditor papyrusEditor, Diagram diagram) {
- if(papyrusEditor.getEditingDomain() instanceof TransactionalEditingDomain) {
- TransactionalEditingDomain domain = (TransactionalEditingDomain)papyrusEditor.getEditingDomain();
- OpenDiagramCommand openDiagramCommand = new OpenDiagramCommand(domain, diagram);
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(openDiagramCommand));
- }
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/UpNavigateHandler.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/UpNavigateHandler.java
deleted file mode 100644
index 2e595addb94..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/handlers/UpNavigateHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS)
- *******************************************************************************/
-
-package org.eclipse.papyrus.navigation.handlers;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.core.adaptor.gmf.DiagramsUtil;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.core.utils.OpenDiagramCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.navigation.Activator;
-import org.eclipse.papyrus.navigation.utils.MultiDiagramDialog;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.window.Window;
-
-/**
- * handler for Up command
- *
- */
-public class UpNavigateHandler extends AbstractHandler {
-
- private IEditorPart editor;
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- editor = HandlerUtil.getActiveEditor(event);
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- EObject parent = papyrusEditor.getDiagram().getElement().eContainer();
- List<Diagram> diagrams = Collections.emptyList();
- if(parent != null) {
- while(parent != null && diagrams.size() == 0) {
- diagrams = DiagramsUtil.getAssociatedDiagrams(parent, null);
- parent = parent.eContainer();
- }
- openDialog(papyrusEditor, diagrams);
-
- }
- }
- return null;
- }
-
- /**
- * open the diagram if there is just one or open a dialog to choose the
- * diagram to open if there is more than one
- *
- * @param papyrusEditor
- * @param diagrams
- */
- private void openDialog(CoreMultiDiagramEditor papyrusEditor, List<Diagram> diagrams) {
- if(diagrams != null) {
- if(diagrams.size() == 1) {
- openDiagram(papyrusEditor, diagrams.get(0));
- } else if(diagrams.size() > 1) {
- MultiDiagramDialog multiDiagramDialog = new MultiDiagramDialog(Activator.getActiveWorkbenchShell(), diagrams);
- if(multiDiagramDialog.open() == Window.OK) {
- openDiagram(papyrusEditor, diagrams.get(multiDiagramDialog.getSelectedDiagram()));
- }
- }
- }
- }
-
- /**
- * open a dialog to choose which diagram have to be opened
- *
- * @param papyrusEditor
- * @param diagram
- */
- private void openDiagram(CoreMultiDiagramEditor papyrusEditor, Diagram diagram) {
- if(papyrusEditor.getEditingDomain() instanceof TransactionalEditingDomain) {
- TransactionalEditingDomain domain = (TransactionalEditingDomain)papyrusEditor.getEditingDomain();
- OpenDiagramCommand openDiagramCommand = new OpenDiagramCommand(domain, diagram);
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(openDiagramCommand));
- }
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/messages.properties b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/messages.properties
deleted file mode 100644
index 53387152a23..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/messages.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-DoubleClickNavigationText=Navigation by double click:
-Explicit_ImplicitNavigation_Text=Explicit + Implicit navigation (if there is no default hyperlink, heuristic are used to propose navigation)
-ExplicitNavigation_Text=Explicit Navigation (use default hyperlinks)
-No_Navigation_Text=No Navigation
-DecoratorVisibilityText=Visibility of the navigation decorator (colored arrow):
-DecoratorDisabled_Text=Disabled
-DisplayOnly_Text=Only appears on displayed diagrams, not on exports and prints
-Everywhere_Text=Everywhere
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/INavigationPreferenceConstant.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/INavigationPreferenceConstant.java
deleted file mode 100644
index bdaba3dc752..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/INavigationPreferenceConstant.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.navigation.preference;
-
-/**
- * Constant to use for the management of navigation preference
- */
-
-public interface INavigationPreferenceConstant {
-
- public String PAPYRUS_NAVIGATION_DOUBLECLICK_KIND = "PAPYRUS_NAVIGATION_DOUBLECLICK_KIND";
-
- public String NO_NAVIGATION = "NO_NAVIGATION";
-
- public String EXPLICIT_NAVIGATION = "EXPLICIT_NAVIGATION";
-
- public String EXPLICIT_IMPLICIT_NAVIGATION = "EXPLICIT_IMPLICIT_NAVIGATION";
-
- public String PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY = "PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY";
-
- public String DISABLED = "DISABLED";
-
- public String DISPLAY_ONLY = "DISPLAY_ONLY";
-
- public String EVERYWHERE = "EVERYWHERE";
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferenceInitializer.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferenceInitializer.java
deleted file mode 100644
index e6755c35572..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferenceInitializer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.navigation.preference;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.preferences.Activator;
-
-/**
- * This preference initializer initializes Navigation preferences
- */
-public class NavigationPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * Initialize default preferences
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = getPreferenceStore();
- store.setDefault(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DOUBLECLICK_KIND, INavigationPreferenceConstant.EXPLICIT_IMPLICIT_NAVIGATION);
- store.setDefault(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY, INavigationPreferenceConstant.DISPLAY_ONLY);
- }
-
- /**
- * Get the preference store
- */
- protected IPreferenceStore getPreferenceStore() {
- return Activator.getDefault().getPreferenceStore();
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferencePage.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferencePage.java
deleted file mode 100644
index 8071f5e8884..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/preference/NavigationPreferencePage.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * 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:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.navigation.preference;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.papyrus.navigation.Messages;
-import org.eclipse.papyrus.preferences.Activator;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * preference page for the navigation It proposes to choose among 3
- * possibilities: no navigation, explicit navigation, or explicit + implicit
- * naviagation
- *
- */
-public class NavigationPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- protected RadioGroupFieldEditor dblClkFieldEditor;
-
- protected RadioGroupFieldEditor decoratorVisibilityFieldEditor;
-
- public void init(IWorkbench workbench) {
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
- }
-
- @Override
- protected void createFieldEditors() {
- dblClkFieldEditor = new RadioGroupFieldEditor(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DOUBLECLICK_KIND, Messages.DoubleClickNavigationText, 1, new String[][]{ { Messages.No_Navigation_Text, INavigationPreferenceConstant.NO_NAVIGATION }, { Messages.ExplicitNavigation_Text, INavigationPreferenceConstant.EXPLICIT_NAVIGATION }, { Messages.Explicit_ImplicitNavigation_Text, INavigationPreferenceConstant.EXPLICIT_IMPLICIT_NAVIGATION } }, getFieldEditorParent());
- addField(dblClkFieldEditor);
- dblClkFieldEditor.setPreferenceStore(Activator.getDefault().getPreferenceStore());
-
- decoratorVisibilityFieldEditor = new RadioGroupFieldEditor(INavigationPreferenceConstant.PAPYRUS_NAVIGATION_DECORATOR_VISIBILITY, Messages.DecoratorVisibilityText, 1, new String[][]{ { Messages.DecoratorDisabled_Text, INavigationPreferenceConstant.DISABLED }, { Messages.DisplayOnly_Text, INavigationPreferenceConstant.DISPLAY_ONLY }, { Messages.Everywhere_Text, INavigationPreferenceConstant.EVERYWHERE } }, getFieldEditorParent());
- addField(decoratorVisibilityFieldEditor);
- decoratorVisibilityFieldEditor.setPreferenceStore(Activator.getDefault().getPreferenceStore());
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/Messages.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/Messages.java
deleted file mode 100644
index a521f925a9f..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/Messages.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.eclipse.papyrus.navigation.utils;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.navigation.utils.messages"; //$NON-NLS-1$
-
- public static String MultiDiagramDialog_0;
-
- public static String MultiDiagramDialog_1;
-
- public static String IS_BACK_POSSIBLE;
-
- public static String IS_NEXT_POSSIBLE;
-
- public static String IS_UP_POSSIBLE;
-
- public static String IS_TOP_POSSIBLE;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/MultiDiagramDialog.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/MultiDiagramDialog.java
deleted file mode 100644
index 2f3cdef1f61..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/MultiDiagramDialog.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS)
- *******************************************************************************/
-
-package org.eclipse.papyrus.navigation.utils;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.papyrus.modelexplorer.MoDiscoLabelProvider;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.jface.viewers.TableViewer;
-
-/**
- * This class Provide a dialog filled with a list of reachable diagrams
- *
- * @author aradouan
- *
- */
-public class MultiDiagramDialog extends Dialog {
-
- private List<Diagram> diagrams;
-
- private Composite dialogComposite;
-
- protected int selectedDiagram;
-
- private Table table;
-
- private TableViewer list;
-
- public int getSelectedDiagram() {
- return selectedDiagram;
- }
-
- @Override
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(Messages.MultiDiagramDialog_0);
- }
-
- public MultiDiagramDialog(Shell parentShell, List<Diagram> diagrams) {
- super(parentShell);
- this.diagrams = diagrams;
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- dialogComposite = (Composite)super.createDialogArea(parent);
- parent.setLayout(new GridLayout());
- dialogComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- createDialogComposite();
- createDialogContents(dialogComposite);
- hookListeners();
- loadData();
- defaultSelection();
-
- return dialogComposite;
- }
-
- private void createDialogContents(Composite parent) {
- dialogComposite.setLayout(new GridLayout(1, false));
- Composite composite = new Composite(parent, SWT.NONE);
- composite.setLayout(new FillLayout(SWT.HORIZONTAL));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
-
- Label lblDiagrams = new Label(composite, SWT.NONE);
- lblDiagrams.setText(Messages.MultiDiagramDialog_1);
-
- Composite composite_1 = new Composite(parent, SWT.NONE);
- composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- composite_1.setLayout(new GridLayout(1, false));
-
- list = new TableViewer(composite_1, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
- list.setUseHashlookup(true);
- table = list.getTable();
- table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
- list.setLabelProvider(new MoDiscoLabelProvider());
- list.setContentProvider(new IStructuredContentProvider() {
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
-
- public void dispose() {
- }
-
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List) {
- return ((List)inputElement).toArray();
- } else {
- return new Object[]{ inputElement };
- }
- }
- });
- }
-
- private void createDialogComposite() {
- GridData dialogLayoutData = new GridData(GridData.FILL_BOTH);
- dialogComposite.setLayoutData(dialogLayoutData);
-
- }
-
- private void hookListeners() {
- table.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- MultiDiagramDialog.this.selectedDiagram = table.getSelectionIndex();
- }
-
- });
- }
-
- private void loadData() {
- list.setInput(diagrams);
- }
-
- private void defaultSelection() {
- boolean found = false;
- IPageMngr pageMngr;
- try {
- pageMngr = EditorUtils.getServiceRegistry().getService(IPageMngr.class);
-
- for(Diagram diagram : diagrams) {
- if(pageMngr.isOpen(diagram)) {
- table.select(diagrams.indexOf(diagram));
- found = true;
- break;
- }
- }
-
- if(!found) {
- int diagFound = 0;
- int diagFoundTemp = 0;
- for(Diagram diagram : diagrams) {
- diagFoundTemp = pageMngr.isInHsitory(diagram);
- if(diagFoundTemp > diagFound) {
- diagFound = diagFoundTemp;
- table.select(diagrams.indexOf(diagram));
- found = true;
- }
- }
- }
- } catch (ServiceException e) {
- e.printStackTrace();
- }
-
- if(!found) {
- table.select(0);
- }
- }
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/PropertyTester.java b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/PropertyTester.java
deleted file mode 100644
index 46d3d41a57d..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/PropertyTester.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 AtoS
- * 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:
- * Anass RADOUANI (AtoS) - test property to enable or disable Navigation Icons
- *******************************************************************************/
-package org.eclipse.papyrus.navigation.utils;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.core.adaptor.gmf.DiagramsUtil;
-import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.papyrus.navigation.Activator;
-import org.eclipse.papyrus.sasheditor.contentprovider.IPageMngr;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class PropertyTester extends org.eclipse.core.expressions.PropertyTester {
-
- @SuppressWarnings("deprecation")
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- boolean result = false;
-
- ServicesRegistry serviceRegistry = EditorUtils.getServiceRegistry();
- if(serviceRegistry != null && Messages.IS_BACK_POSSIBLE.equals(property)) {
- try {
- IPageMngr pageMngr = serviceRegistry.getService(IPageMngr.class);
- result = pageMngr.hasPreviousHistory();
- } catch (ServiceException e) {
- e.printStackTrace();
- }
-
- } else if(serviceRegistry != null && Messages.IS_NEXT_POSSIBLE.equals(property)) {
- try {
- IPageMngr pageMngr = serviceRegistry.getService(IPageMngr.class);
- result = pageMngr.hasNextHistory();
- } catch (ServiceException e) {
- e.printStackTrace();
- }
-
- } else if(Messages.IS_UP_POSSIBLE.equals(property) || Messages.IS_TOP_POSSIBLE.equals(property)) {
- IWorkbenchWindow activeWorkbenchWindow = Activator.getActiveWorkbenchWindow();
- if (activeWorkbenchWindow != null)
- {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if (activePage != null)
- {
- IEditorPart editor = activePage.getActiveEditor();
- if(editor instanceof CoreMultiDiagramEditor) {
- CoreMultiDiagramEditor papyrusEditor = (CoreMultiDiagramEditor)editor;
- EObject parent = null;
- if(papyrusEditor.getDiagram() != null && papyrusEditor.getDiagram().getElement() != null) {
- parent = papyrusEditor.getDiagram().getElement().eContainer();
- }
-
- if(parent != null) {
- while(parent != null && !result) {
- result = !DiagramsUtil.getAssociatedDiagrams(parent, null).isEmpty();
- parent = parent.eContainer();
- }
- }
- }
- }
- }
- }
-
- return result;
- }
-
-}
diff --git a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/messages.properties b/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/messages.properties
deleted file mode 100644
index c230b60594c..00000000000
--- a/plugins/core/org.eclipse.papyrus.navigation/src/org/eclipse/papyrus/navigation/utils/messages.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-MultiDiagramDialog_0=Diagrams
-MultiDiagramDialog_1=Select a diagram :
-IS_BACK_POSSIBLE=isBackCommandPossible
-IS_NEXT_POSSIBLE=isNextCommandPossible
-IS_UP_POSSIBLE=isUpCommandPossible
-IS_TOP_POSSIBLE=isTopCommandPossible

Back to the top