Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-12-06 12:28:02 +0000
committercletavernie2012-12-06 12:28:02 +0000
commitcbb4b3e7cebe52619767c2ff19434dbbdb739a26 (patch)
tree6abaedbffc05893dba786a9a18869fe2c1b7cb58 /incoming
parent49b1b475258ffce1a342c3a2aef909874a74f9f0 (diff)
downloadorg.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.tar.gz
org.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.tar.xz
org.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.zip
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/META-INF/MANIFEST.MF3
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/plugin.xml12
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/dnd/HyperlinkDropStrategy.java125
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/editpolicies/NavigationEditPolicy.java10
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/AdvancedHLManager.java17
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/CreateHyperLinkDiagramCommand.java72
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/DeleteHyperLinkDiagramCommand.java73
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagram.java85
-rw-r--r--incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagramEditorHelper.java73
9 files changed, 147 insertions, 323 deletions
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/META-INF/MANIFEST.MF b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/META-INF/MANIFEST.MF
index 04c89d6e6dd..a0d2114dac7 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/META-INF/MANIFEST.MF
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/META-INF/MANIFEST.MF
@@ -18,7 +18,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.emf;bundle-version="0.10.0",
org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0"
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.gmfdiag.dnd;bundle-version="0.10.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.papyrus.infra.gmfdiag.hyperlink,
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/plugin.xml b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/plugin.xml
index 61023da4047..58a5a833629 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/plugin.xml
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/plugin.xml
@@ -2,12 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension
- point="org.eclipse.papyrus.infra.hyperlink.editor.registration">
- <editorhyperlink
- helper="org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui.HyperLinkDiagramEditorHelper">
- </editorhyperlink>
- </extension>
- <extension
point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
<editpolicyProvider
class="org.eclipse.papyrus.infra.gmfdiag.hyperlink.providers.HyperlinkEditPolicyProvider">
@@ -16,5 +10,11 @@
</Priority>
</editpolicyProvider>
</extension>
+ <extension
+ point="org.eclipse.papyrus.infra.gmfdiag.dnd.dropStrategy">
+ <strategy
+ strategy="org.eclipse.papyrus.infra.gmfdiag.hyperlink.dnd.HyperlinkDropStrategy">
+ </strategy>
+ </extension>
</plugin>
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/dnd/HyperlinkDropStrategy.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/dnd/HyperlinkDropStrategy.java
new file mode 100644
index 00000000000..75107e4f872
--- /dev/null
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/dnd/HyperlinkDropStrategy.java
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * Copyright (c) 2012 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.hyperlink.dnd;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.commands.Activator;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageMngr;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.infra.gmfdiag.common.helper.SemanticElementHelper;
+import org.eclipse.papyrus.infra.gmfdiag.dnd.strategy.TransactionalDropStrategy;
+import org.eclipse.papyrus.infra.hyperlink.commands.CreateHyperLinkPageCommand;
+import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A Strategy to drop shortcuts to nested editors on GMF Diagram elements
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class HyperlinkDropStrategy extends TransactionalDropStrategy {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabel() {
+ return "Create hyperlinks";
+ }
+
+ public String getDescription() {
+ return "Creates an hyperlink to Papyrus nested editor (e.g. Diagram, Table, ...) on a Diagram element";
+ }
+
+ public Image getImage() {
+ return null;
+ }
+
+ public String getID() {
+ return "org.eclipse.papyrus.infra.gmfdiag.dnd.CreateHyperlink";
+ }
+
+ @Deprecated
+ public int getPriority() {
+ return 0;
+ }
+
+ @Override
+ public Command doGetCommand(Request request, final EditPart targetEditPart) {
+ if(request instanceof DropObjectsRequest) {
+
+ View view = getTargetView(targetEditPart);
+ if(view == null) {
+ return null;
+ }
+
+ final View mainView = SemanticElementHelper.findPrimaryView(view);
+ if(mainView instanceof Diagram) {
+ //We cannot create hyperlinks from the root edit part
+ return null;
+ }
+
+ final DropObjectsRequest dropRequest = (DropObjectsRequest)request;
+
+ final ServicesRegistry registry;
+ try {
+ registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(mainView);
+ IPageMngr pageManager = ServiceUtils.getInstance().getIPageMngr(registry);
+
+ for(Object droppedObject : dropRequest.getObjects()) {
+ if(!(droppedObject instanceof EObject && pageManager.allPages().contains(droppedObject))) {
+ return null;
+ }
+ }
+ } catch (ServiceException ex) {
+ Activator.log.error(ex);
+ return null;
+ }
+
+ return new Command() {
+
+ @Override
+ public void execute() {
+
+ try {
+ ILabelProvider labelProvider = registry.getService(LabelProviderService.class).getLabelProvider();
+ TransactionalEditingDomain domain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
+
+ for(Object droppedObject : dropRequest.getObjects()) {
+ String text = labelProvider.getText(droppedObject);
+ CreateHyperLinkPageCommand command = new CreateHyperLinkPageCommand(domain, mainView, text, text, (EModelElement)droppedObject, true);
+ command.execute();
+ }
+ } catch (ServiceException ex) {
+ Activator.log.error(ex);
+ }
+
+
+ }
+ };
+ }
+
+ return null;
+ }
+}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/editpolicies/NavigationEditPolicy.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/editpolicies/NavigationEditPolicy.java
index c0414394ff4..c6fd16e7d88 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/editpolicies/NavigationEditPolicy.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/editpolicies/NavigationEditPolicy.java
@@ -36,13 +36,13 @@ import org.eclipse.papyrus.infra.core.utils.EditorUtils;
import org.eclipse.papyrus.infra.gmfdiag.common.DiagramsUtil;
import org.eclipse.papyrus.infra.gmfdiag.hyperlink.Activator;
import org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui.AdvancedHLManager;
-import org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui.HyperLinkDiagram;
import org.eclipse.papyrus.infra.gmfdiag.navigation.ExistingNavigableElement;
import org.eclipse.papyrus.infra.gmfdiag.navigation.NavigableElement;
import org.eclipse.papyrus.infra.gmfdiag.navigation.NavigationHelper;
import org.eclipse.papyrus.infra.gmfdiag.navigation.preference.INavigationPreferenceConstant;
import org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkHelper;
import org.eclipse.papyrus.infra.hyperlink.helper.HyperLinkHelperFactory;
+import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject;
import org.eclipse.papyrus.infra.hyperlink.ui.EditorNavigationDialog;
import org.eclipse.papyrus.infra.hyperlink.ui.HyperLinkManagerShell;
@@ -150,9 +150,9 @@ public class NavigationEditPolicy extends OpenEditPolicy {
Iterator<Diagram> iterDiagram = list.iterator();
while(iterDiagram.hasNext()) {
Diagram diagram = iterDiagram.next();
- HyperLinkDiagram hyperLinkDiagram = new HyperLinkDiagram();
- hyperLinkDiagram.setDiagram(diagram);
- hyperLinkDiagram.setTooltipText(diagram.getName() + " (found by heuristic)");
+ HyperLinkEditor hyperLinkEditor = new HyperLinkEditor();
+ hyperLinkEditor.setObject(diagram);
+ hyperLinkEditor.setTooltipText(diagram.getName() + " (found by heuristic)");
// look for if a hyperlink already exists
HyperLinkObject foundHyperlink = null;
for(int i = 0; i < defaultHyperLinkObject.size() && foundHyperlink == null; i++) {
@@ -163,7 +163,7 @@ public class NavigationEditPolicy extends OpenEditPolicy {
// the diagram was not into the list of existing default
// hyperlink
if(foundHyperlink == null) {
- defaultHyperLinkObject.add(hyperLinkDiagram);
+ defaultHyperLinkObject.add(hyperLinkEditor);
}
}
}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/AdvancedHLManager.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/AdvancedHLManager.java
index 55d2cf87cb4..f0f75a128d8 100644
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/AdvancedHLManager.java
+++ b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/AdvancedHLManager.java
@@ -27,6 +27,7 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
import org.eclipse.papyrus.infra.hyperlink.helper.HyperLinkHelperFactory;
+import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
import org.eclipse.papyrus.infra.hyperlink.ui.AbstractHyperLinkTab;
import org.eclipse.papyrus.infra.hyperlink.ui.HyperLinkManagerShell;
@@ -64,7 +65,7 @@ public class AdvancedHLManager extends HyperLinkManagerShell {
* a gmf command
* @return the list of hyperlinks diagram
*/
- protected ArrayList<HyperLinkDiagram> getCreatedHyperlinkDiagramsWithHeuristic(ICommand creationcommand) {
+ protected ArrayList<HyperLinkEditor> getCreatedHyperlinkDiagramsWithHeuristic(ICommand creationcommand) {
ArrayList<Diagram> diagrams = new ArrayList<Diagram>();
if(creationcommand instanceof CompositeCommand) {
CompositeCommand compositeCommand = (CompositeCommand)creationcommand;
@@ -73,13 +74,13 @@ public class AdvancedHLManager extends HyperLinkManagerShell {
diagrams.addAll((Collection<Diagram>)value);
}
}
- ArrayList<HyperLinkDiagram> hyperLinkDiagrams = new ArrayList<HyperLinkDiagram>();
+ ArrayList<HyperLinkEditor> hyperLinkDiagrams = new ArrayList<HyperLinkEditor>();
for(int i = 0; i < diagrams.size(); i++) {
- HyperLinkDiagram hyperLinkDiagram = new HyperLinkDiagram();
- hyperLinkDiagram.setDiagram(diagrams.get(i));
- hyperLinkDiagram.setIsDefault(true);
- hyperLinkDiagram.setTooltipText(diagrams.get(i).getName());
- hyperLinkDiagrams.add(hyperLinkDiagram);
+ HyperLinkEditor hyperLinkEditor = new HyperLinkEditor();
+ hyperLinkEditor.setObject(diagrams.get(i));
+ hyperLinkEditor.setIsDefault(true);
+ hyperLinkEditor.setTooltipText(diagrams.get(i).getName());
+ hyperLinkDiagrams.add(hyperLinkEditor);
}
return hyperLinkDiagrams;
}
@@ -89,7 +90,7 @@ public class AdvancedHLManager extends HyperLinkManagerShell {
super.doAction();
// defaultTab = getDefaultHyperLinkTab();
final LocalDefaultLinkDiagramTab heuristicTab = getHeuristicTab();
- ArrayList<HyperLinkDiagram> defaultdiagramsWithHeuristic = new ArrayList<HyperLinkDiagram>();
+ ArrayList<HyperLinkEditor> defaultdiagramsWithHeuristic = new ArrayList<HyperLinkEditor>();
//if the default diagrams is opened, get created default diagrams
if(heuristicTab.getDefaultHyperlinkComposite().isVisible()) {
heuristicTab.okPressed();
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/CreateHyperLinkDiagramCommand.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/CreateHyperLinkDiagramCommand.java
deleted file mode 100644
index 4c0e7e7f798..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/CreateHyperLinkDiagramCommand.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 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.infra.gmfdiag.hyperlink.ui;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
-import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkConstants;
-
-/**
- * The Class CreateHyperLinkCommand. this has in charge to add a new entry list
- * of hyperlinks
- *
- */
-public class CreateHyperLinkDiagramCommand extends CreateEAnnotationCommand {
-
- /** The hyperlink kind. */
- public String tooltiptext;
-
- /** The localization. */
- public String name;
-
- private EModelElement diagram;
-
- protected boolean isDefaultNavigation;
-
- /**
- * Instantiates a new creates the hyper link command.
- *
- * @param domain
- * the domain
- * @param object
- * the object for example the view
- * @param tooltiptext
- * the hyperlink kind see {@link UMLVisualInformationPapyrusConstant}
- * @param name
- * the localization
- */
- public CreateHyperLinkDiagramCommand(TransactionalEditingDomain domain, EModelElement object, String tooltiptext, String name, EModelElement diagram, boolean isDefaultNavigation) {
- super(domain, object, HyperLinkDiagramConstants.HYPERLINK_DIAGRAM);
- this.tooltiptext = tooltiptext;
- this.name = name;
- this.diagram = diagram;
- this.isDefaultNavigation = isDefaultNavigation;
- }
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected void doExecute() {
- EAnnotation eAnnotation = createEAnnotation();
- eAnnotation.getReferences().add(diagram);
- eAnnotation.getDetails().put(HyperLinkConstants.HYPERLINK_TOOLTYPE_TEXT, this.tooltiptext);
- eAnnotation.getDetails().put(HyperLinkDiagramConstants.HYPERLINK_DIAGRAM_NAME, this.name);
- eAnnotation.getDetails().put(HyperLinkConstants.HYPERLINK_IS_DEFAULT_NAVIGATION, "" + this.isDefaultNavigation); //$NON-NLS-1$
- attachEannotation(eAnnotation, getObject());
- }
-
-}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/DeleteHyperLinkDiagramCommand.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/DeleteHyperLinkDiagramCommand.java
deleted file mode 100644
index 53b155dabe4..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/DeleteHyperLinkDiagramCommand.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 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.infra.gmfdiag.hyperlink.ui;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
-
-
-/**
- * The Class DeleteHyperLinkCommand. it can be used also to remove an hyperlink
- * web. It will remove the first eannotation that corresponds to the link or the
- * localization of the hyperlink
- */
-public class DeleteHyperLinkDiagramCommand extends CreateEAnnotationCommand {
-
- /** The localization. */
- public EModelElement diagram;
-
- /**
- * Instantiates a new delete hyper link command used to suppress a link in
- * the view
- *
- * @param domain
- * the domain
- * @param object
- * the object
- * @param diagram
- * the localization of the link
- */
- public DeleteHyperLinkDiagramCommand(TransactionalEditingDomain domain, EModelElement object, EModelElement diagram) {
- super(domain, object, HyperLinkDiagramConstants.HYPERLINK_DIAGRAM);
- this.diagram = diagram;
- }
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected void doExecute() {
- ArrayList<EAnnotation> eAnnotationsToRemove = new ArrayList<EAnnotation>();
- Iterator<EAnnotation> iter = getObject().getEAnnotations().iterator();
- // look for interesting eannotations
- while(iter.hasNext()) {
- EAnnotation currentAnnotation = iter.next();
- if(currentAnnotation.getSource().equals(HyperLinkDiagramConstants.HYPERLINK_DIAGRAM)) {
- if(currentAnnotation.getReferences().contains(diagram)) {
- eAnnotationsToRemove.add(currentAnnotation);
- }
- }
- }
- // remove all eannotations
- for(int i = 0; i < eAnnotationsToRemove.size(); i++) {
- getObject().getEAnnotations().remove(eAnnotationsToRemove.get(i));
- }
-
- }
-}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagram.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagram.java
deleted file mode 100644
index bf9e7d3f30b..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagram.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2009 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.infra.gmfdiag.hyperlink.ui;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
-
-/**
- * The Class HyperLinkDiagram a container of diagram
- */
-public class HyperLinkDiagram extends HyperLinkEditor {//extends HyperLinkObject{
-
- /**
- * Gets the diagram.
- *
- * @return the diagram
- */
- public Diagram getDiagram() {
- return (Diagram)super.getObject();
- }
-
- /**
- * Sets the diagram.
- *
- * @param object
- * the new diagram
- */
- public void setDiagram(Diagram object) {
- super.setObject(object);
- }
- //
- // /**
- // *
- // * @see org.eclipse.papyrus.uml.diagram.common.ui.hyperlinkshell.HyperlinkObject#executeSelectPressed()
- // *
- // */
- // @Override
- // public void executeSelectPressed() {
- // IMultiDiagramEditor papyrusEditor=EditorUtils.getMultiDiagramEditor();
- // IPageMngr pageMngr=null;
- // try {
- // OpenDiagramCommand openCommand = new OpenDiagramCommand(ServiceUtils.getInstance().getTransactionalEditingDomain(papyrusEditor.getServicesRegistry()), getDiagram());
- // if(openCommand.canExecute()) {
- // openCommand.execute(null, null);
- // }
- // } catch (Exception e) {
- // e.printStackTrace();
- // }
- // }
- //
- // /**
- // *
- // */
- // @Override
- // public void executeEditMousePressed(List<HyperLinkObject> list, Package amodel) {
- // IPageIconsRegistry editorRegistry=null;
- // IMultiDiagramEditor papyrusEditor=EditorUtils.getMultiDiagramEditor();
- // try {
- // editorRegistry= papyrusEditor.getServicesRegistry().getService(IPageIconsRegistry.class);
- // } catch (ServiceException e) {
- // // TODO Auto-generated catch block
- // e.printStackTrace();
- // }
- // EditorHyperlinkDiagramShell editor = new EditorHyperlinkDiagramShell(editorRegistry, amodel);
- // editor.setHyperLinkDiagram(this);
- // editor.open();
- // if(editor.getHyperLinkDiagram() != null) {
- // int index = list.indexOf(this);
- // list.remove(this);
- // list.add(index,editor.getHyperLinkDiagram());
- //
- // }
- // }
-}
diff --git a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagramEditorHelper.java b/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagramEditorHelper.java
deleted file mode 100644
index a71829d1aab..00000000000
--- a/incoming/org.eclipse.papyrus.infra.gmfdiag.hyperlink/src/org/eclipse/papyrus/infra/gmfdiag/hyperlink/ui/HyperLinkDiagramEditorHelper.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 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:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
-import org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkEditorHelper;
-import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
-import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject;
-import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkConstants;
-
-
-public class HyperLinkDiagramEditorHelper extends AbstractHyperLinkEditorHelper {
-
- @Override
- public HyperLinkEditor getHyperLinkObjectFor(Object object) {
- if(object instanceof Diagram) {
- return new HyperLinkDiagram();
- }
- return null;
- }
-
-
- @Override
- public CreateEAnnotationCommand getAddHyperLinkCommand(TransactionalEditingDomain domain, EModelElement object, HyperLinkObject hyperlinkObject) {
- if(hyperlinkObject instanceof HyperLinkDiagram) {
- HyperLinkDiagram hyperLinkDiagram = (HyperLinkDiagram)hyperlinkObject;
- return new CreateHyperLinkDiagramCommand(domain, object, hyperLinkDiagram.getTooltipText(), ((Diagram)hyperLinkDiagram.getObject()).getName(), (EModelElement)hyperLinkDiagram.getObject(), hyperLinkDiagram.getIsDefault());
- } else {
- return null;
- }
- }
-
-
- @Override
- public HyperLinkEditor getHyperLinkObjectForEAnnotation(EAnnotation eAnnotation) {
- if(eAnnotation.getSource().equals(HyperLinkDiagramConstants.HYPERLINK_DIAGRAM)) {
- HyperLinkDiagram hyperLinkDiagram = new HyperLinkDiagram();
- EList<EObject> list = eAnnotation.getReferences();
- if(list.size() > 0) {
- if(eAnnotation.getReferences().get(0).eResource() != null) {
- hyperLinkDiagram.setDiagram((Diagram)eAnnotation.getReferences().get(0));
- hyperLinkDiagram.setTooltipText(eAnnotation.getDetails().get(HyperLinkConstants.HYPERLINK_TOOLTYPE_TEXT));
- if(eAnnotation.getDetails().get(HyperLinkConstants.HYPERLINK_IS_DEFAULT_NAVIGATION) != null) {
- String stringboolean = eAnnotation.getDetails().get(HyperLinkConstants.HYPERLINK_IS_DEFAULT_NAVIGATION);
- boolean isDefaultNaviagation = Boolean.parseBoolean(stringboolean);
- hyperLinkDiagram.setIsDefault(isDefaultNaviagation);
- } else {
- hyperLinkDiagram.setIsDefault(false);
- }
- return hyperLinkDiagram;
- }
- }
- }
- return null;
- }
-}

Back to the top