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 /plugins/infra/org.eclipse.papyrus.infra.hyperlink
parent49b1b475258ffce1a342c3a2aef909874a74f9f0 (diff)
downloadorg.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.tar.gz
org.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.tar.xz
org.eclipse.papyrus-cbb4b3e7cebe52619767c2ff19434dbbdb739a26.zip
Diffstat (limited to 'plugins/infra/org.eclipse.papyrus.infra.hyperlink')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/plugin.xml1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/schema/org.eclipse.papyrus.infra.hyperlink.editor.registration.exsd102
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/CreateHyperLinkPageCommand.java78
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/DeleteHyperLinkPageCommand.java75
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/helper/EditorHyperLinkHelper.java40
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java21
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkConstants.java24
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkEditorHelpersRegistrationUtil.java84
8 files changed, 200 insertions, 225 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/plugin.xml
index dfadcf345a2..5678a7604b1 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/plugin.xml
@@ -2,7 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension-point id="org.eclipse.papyrus.infra.hyperlink.registration" name="%extension-point.name" schema="schema/org.eclipse.papyrus.infra.hyperlink.registration.exsd"/>
- <extension-point id="org.eclipse.papyrus.infra.hyperlink.editor.registration" name="org.eclipse.papyrus.infra.hyperlink.editor.registration" schema="schema/org.eclipse.papyrus.infra.hyperlink.editor.registration.exsd"/>
<extension-point id="org.eclipse.papyrus.infra.hyperlink.tab.registration" name="org.eclipse.papyrus.infra.hyperlink.tab.registration" schema="schema/org.eclipse.papyrus.infra.hyperlink.tab.registration.exsd"/>
<extension
point="org.eclipse.papyrus.infra.hyperlink.registration">
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/schema/org.eclipse.papyrus.infra.hyperlink.editor.registration.exsd b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/schema/org.eclipse.papyrus.infra.hyperlink.editor.registration.exsd
deleted file mode 100644
index 64cca6320f7..00000000000
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/schema/org.eclipse.papyrus.infra.hyperlink.editor.registration.exsd
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.infra.hyperlink" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.papyrus.infra.hyperlink" id="org.eclipse.papyrus.infra.hyperlink.editor.registration" name="org.eclipse.papyrus.infra.hyperlink.editor.registration"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence minOccurs="1" maxOccurs="unbounded">
- <element ref="editorhyperlink"/>
- </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="editorhyperlink">
- <complexType>
- <attribute name="helper" type="string" use="required">
- <annotation>
- <documentation>
- This helper allows to add your own editor in the Editor Tabs
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkEditorHelper:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- Papyrus 0.9.0
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/CreateHyperLinkPageCommand.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/CreateHyperLinkPageCommand.java
new file mode 100644
index 00000000000..5f82dd241d1
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/CreateHyperLinkPageCommand.java
@@ -0,0 +1,78 @@
+/*****************************************************************************
+ * 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.hyperlink.commands;
+
+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.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 CreateHyperLinkPageCommand extends CreateEAnnotationCommand {
+
+ /** The hyperlink kind. */
+ public String tooltiptext;
+
+ /** The localization. */
+ public String name;
+
+ /**
+ * The pageIdentifier to open
+ */
+ private EObject pageIdentifier;
+
+ 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
+ * @param pageIdentifier
+ * @param isDefaultNavigation
+ */
+ public CreateHyperLinkPageCommand(TransactionalEditingDomain domain, EModelElement object, String tooltiptext, String name, EObject pageIdentifier, boolean isDefaultNavigation) {
+ super(domain, object, HyperLinkConstants.PAPYRUS_HYPERLINK_PAGE);
+ this.tooltiptext = tooltiptext;
+ this.name = name;
+ this.pageIdentifier = pageIdentifier;
+ this.isDefaultNavigation = isDefaultNavigation;
+ }
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected void doExecute() {
+ EAnnotation eAnnotation = createEAnnotation();
+ eAnnotation.getReferences().add(pageIdentifier);
+ eAnnotation.getDetails().put(HyperLinkConstants.HYPERLINK_TOOLTYPE_TEXT, this.tooltiptext);
+ eAnnotation.getDetails().put(HyperLinkConstants.HYPERLINK_PAGE_NAME, this.name);
+ eAnnotation.getDetails().put(HyperLinkConstants.HYPERLINK_IS_DEFAULT_NAVIGATION, Boolean.toString(this.isDefaultNavigation));
+ attachEannotation(eAnnotation, getObject());
+ }
+
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/DeleteHyperLinkPageCommand.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/DeleteHyperLinkPageCommand.java
new file mode 100644
index 00000000000..b02487448e2
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/commands/DeleteHyperLinkPageCommand.java
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ * 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
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Refactoring & simplification
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.hyperlink.commands;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkConstants;
+
+
+/**
+ * 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 DeleteHyperLinkPageCommand extends RecordingCommand {
+
+ /** The hyperlink target. */
+ protected EObject page;
+
+ protected EModelElement sourceElement;
+
+ /**
+ * Instantiates a new delete hyper link command used to suppress a link in
+ * the view
+ *
+ * @param domain
+ * the domain
+ * @param object
+ * the object
+ * @param page
+ * the target of the link
+ */
+ public DeleteHyperLinkPageCommand(TransactionalEditingDomain domain, EModelElement object, EObject page) {
+ super(domain);
+ this.page = page;
+ this.sourceElement = object;
+ }
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected void doExecute() {
+ Iterator<EAnnotation> iter = sourceElement.getEAnnotations().iterator();
+
+ //Remove interesting eannotations
+ while(iter.hasNext()) {
+ EAnnotation currentAnnotation = iter.next();
+ for(String annotationName : HyperLinkConstants.validHyperLinkPageSources) {
+ if(annotationName.equals(currentAnnotation.getSource())) {
+ if(currentAnnotation.getReferences().contains(page)) {
+ iter.remove();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/helper/EditorHyperLinkHelper.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/helper/EditorHyperLinkHelper.java
index 6354010cc2c..6c3ca283831 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/helper/EditorHyperLinkHelper.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/helper/EditorHyperLinkHelper.java
@@ -14,7 +14,6 @@
package org.eclipse.papyrus.infra.hyperlink.helper;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -27,11 +26,12 @@ import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.hyperlink.Activator;
+import org.eclipse.papyrus.infra.hyperlink.commands.CreateHyperLinkPageCommand;
import org.eclipse.papyrus.infra.hyperlink.messages.Messages;
import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkObject;
import org.eclipse.papyrus.infra.hyperlink.ui.EditorHyperLinkEditorShell;
-import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkEditorHelpersRegistrationUtil;
+import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkConstants;
/**
*
@@ -112,13 +112,10 @@ public class EditorHyperLinkHelper extends AbstractHyperLinkHelper {
* @return
*/
@Override
- public RecordingCommand getAddHyperLinkCommand(TransactionalEditingDomain domain, EModelElement object, HyperLinkObject HyperLinkObject) {
- Collection<AbstractHyperLinkEditorHelper> helpers = HyperLinkEditorHelpersRegistrationUtil.INSTANCE.getAllRegisteredHyperLinkEditorHelper();
- for(AbstractHyperLinkEditorHelper current : helpers) {
- RecordingCommand cmd = current.getAddHyperLinkCommand(domain, object, HyperLinkObject);
- if(cmd != null) {
- return cmd;
- }
+ public RecordingCommand getAddHyperLinkCommand(TransactionalEditingDomain domain, EModelElement object, HyperLinkObject hyperLinkObject) {
+ if(hyperLinkObject instanceof HyperLinkEditor) {
+ HyperLinkEditor hyperLinkEditor = (HyperLinkEditor)hyperLinkObject;
+ return new CreateHyperLinkPageCommand(domain, object, hyperLinkEditor.getTooltipText(), HyperLinkConstants.PAPYRUS_HYPERLINK_PAGE, (EObject)hyperLinkEditor.getObject(), hyperLinkObject.getIsDefault());
}
return null;
}
@@ -132,14 +129,9 @@ public class EditorHyperLinkHelper extends AbstractHyperLinkHelper {
*
*/
public HyperLinkEditor getHyperLinkObjectFor(final Object editor) {// create an interface for this method?
- Collection<AbstractHyperLinkEditorHelper> helpers = HyperLinkEditorHelpersRegistrationUtil.INSTANCE.getAllRegisteredHyperLinkEditorHelper();
- for(AbstractHyperLinkEditorHelper current : helpers) {
- HyperLinkEditor object = current.getHyperLinkObjectFor(editor);
- if(object != null) {
- return object;
- }
- }
- return null;
+ HyperLinkEditor hyperLinkEditor = new HyperLinkEditor();
+ hyperLinkEditor.setObject(editor);
+ return hyperLinkEditor;
}
/**
@@ -150,13 +142,17 @@ public class EditorHyperLinkHelper extends AbstractHyperLinkHelper {
* the HyperLinkEditor corresponding to this eAnnotation
*/
public HyperLinkEditor getHyperLinkObjectFor(final EAnnotation eAnnotation) {
- Collection<AbstractHyperLinkEditorHelper> helpers = HyperLinkEditorHelpersRegistrationUtil.INSTANCE.getAllRegisteredHyperLinkEditorHelper();
- for(AbstractHyperLinkEditorHelper current : helpers) {
- HyperLinkEditor object = current.getHyperLinkObjectForEAnnotation(eAnnotation);
- if(object != null) {
- return object;
+ for(String source : HyperLinkConstants.validHyperLinkPageSources) {
+ if(source.equals(eAnnotation.getSource())) {
+ HyperLinkEditor editor = new HyperLinkEditor();
+ editor.setObject(eAnnotation.getReferences().get(0));
+ editor.setIsDefault(Boolean.parseBoolean(eAnnotation.getDetails().get(HyperLinkConstants.HYPERLINK_IS_DEFAULT_NAVIGATION)));
+ editor.setTooltipText(eAnnotation.getDetails().get(HyperLinkConstants.HYPERLINK_TOOLTYPE_TEXT));
+ return editor;
}
}
+
return null;
}
+
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
index a5087026772..bcb37b62929 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/ui/EditorLookForEditorShell.java
@@ -13,7 +13,6 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.hyperlink.ui;
-import java.util.Collection;
import java.util.Iterator;
import org.eclipse.emf.common.notify.AdapterFactory;
@@ -39,10 +38,7 @@ import org.eclipse.papyrus.infra.emf.providers.strategy.SemanticEMFContentProvid
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
import org.eclipse.papyrus.infra.hyperlink.Activator;
-import org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkEditorHelper;
-import org.eclipse.papyrus.infra.hyperlink.object.HyperLinkEditor;
import org.eclipse.papyrus.infra.hyperlink.util.EditorListContentProvider;
-import org.eclipse.papyrus.infra.hyperlink.util.HyperLinkEditorHelpersRegistrationUtil;
import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -369,14 +365,17 @@ public class EditorLookForEditorShell extends AbstractLookForEditorShell {
}
protected boolean isAValidEditor(final Object object) {
- Collection<AbstractHyperLinkEditorHelper> helpers = HyperLinkEditorHelpersRegistrationUtil.INSTANCE.getAllRegisteredHyperLinkEditorHelper();
- for(AbstractHyperLinkEditorHelper current : helpers) {
- HyperLinkEditor editor = current.getHyperLinkObjectFor(object);
- if(editor != null) {
- return true;
- }
+ if(!(object instanceof EObject)) {
+ return false;
+ }
+
+ EObject eObject = (EObject)object;
+
+ try {
+ return ServiceUtilsForEObject.getInstance().getIPageMngr(eObject).allPages().contains(object);
+ } catch (ServiceException ex) {
+ return false;
}
- return false;
}
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkConstants.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkConstants.java
index 595ce6a923a..fa0e42aaebc 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkConstants.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkConstants.java
@@ -18,21 +18,23 @@ public final class HyperLinkConstants {
/**
*
* Constructor.
- *
+ *
*/
- private HyperLinkConstants(){
+ private HyperLinkConstants() {
//nothing to do
}
-
+
/**
* this is a key of eAnnnotation that contains hypertext link or referenced document
**/
public static final String PAPYRUS_HYPERLINK_PREFIX = "PapyrusHyperLink_"; //$NON-NLS-1$
-
+
+ public static final String PAPYRUS_HYPERLINK_PAGE = PAPYRUS_HYPERLINK_PREFIX + "Page"; //$NON-NLS-1$
+
public static final String HYPERLINK_DOCUMENT = PAPYRUS_HYPERLINK_PREFIX + "Document"; //$NON-NLS-1$
public static final String HYPERLINK_WEB = PAPYRUS_HYPERLINK_PREFIX + "_web"; //$NON-NLS-1$
-
+
public static final String HYPERLINK_TOOLTYPE_TEXT = "tooltip_text"; //$NON-NLS-1$
public static final String HYPERLINK_IS_DEFAULT_NAVIGATION = "is_default_navigation"; //$NON-NLS-1$
@@ -40,4 +42,16 @@ public final class HyperLinkConstants {
public static final String HYPERLINK_DOCUMENT_LOCALIZATION = "localization"; //$NON-NLS-1$
public static final String HYPERLINK_WEB_LINK = "link"; //$NON-NLS-1$
+
+ public static final String HYPERLINK_PAGE_NAME = "pageName"; //$NON-NLS-1$
+
+ /**
+ * LEGACY CONSTANTS
+ */
+
+ public static final String LEGACY_HYPERLINK_DIAGRAM = PAPYRUS_HYPERLINK_PREFIX + "Diagram";
+
+ public static final String LEGACY_HYPERLINK_TABLE = PAPYRUS_HYPERLINK_PREFIX + "Table";
+
+ public final static String[] validHyperLinkPageSources = new String[]{ HyperLinkConstants.PAPYRUS_HYPERLINK_PAGE, HyperLinkConstants.LEGACY_HYPERLINK_DIAGRAM, HyperLinkConstants.LEGACY_HYPERLINK_TABLE };
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkEditorHelpersRegistrationUtil.java b/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkEditorHelpersRegistrationUtil.java
deleted file mode 100644
index bc562941d54..00000000000
--- a/plugins/infra/org.eclipse.papyrus.infra.hyperlink/src/org/eclipse/papyrus/infra/hyperlink/util/HyperLinkEditorHelpersRegistrationUtil.java
+++ /dev/null
@@ -1,84 +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.hyperlink.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.infra.hyperlink.Activator;
-import org.eclipse.papyrus.infra.hyperlink.helper.AbstractHyperLinkEditorHelper;
-import org.eclipse.papyrus.infra.hyperlink.messages.Messages;
-
-/**
- *
- * This class is used to get all registered AbstractHyperLinkEditorHelper
- *
- */
-public class HyperLinkEditorHelpersRegistrationUtil {
-
- /**
- * The id of the extenstion point
- */
- private static final String HYPERLINK_EDITOR_HELPER_REGISTRATION_ID = "org.eclipse.papyrus.infra.hyperlink.editor.registration"; //$NON-NLS-1$
-
- /**
- * The registered helpers
- */
- private Collection<AbstractHyperLinkEditorHelper> helpers;
-
- /**
- * The instance of HyperLinkEditorHelpersRegistrationUtil
- */
- public static final HyperLinkEditorHelpersRegistrationUtil INSTANCE = new HyperLinkEditorHelpersRegistrationUtil();
-
- /**
- *
- * Constructor.
- *
- */
- private HyperLinkEditorHelpersRegistrationUtil() {
- //nothing to do
- }
-
- /**
- *
- * @return
- * the list of the registered AbstractHyperLinkEditorHelper
- */
- public Collection<AbstractHyperLinkEditorHelper> getAllRegisteredHyperLinkEditorHelper() {
- if(helpers == null) {
- helpers = new ArrayList<AbstractHyperLinkEditorHelper>();
- IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(HYPERLINK_EDITOR_HELPER_REGISTRATION_ID);
-
- for(IConfigurationElement e : config) {
- try {
- final Object h = e.createExecutableExtension("helper"); //$NON-NLS-1$
- if(h instanceof AbstractHyperLinkEditorHelper) {
- helpers.add((AbstractHyperLinkEditorHelper)h);
- } else {
- Activator.log.info(NLS.bind(Messages.HyperLinkEditorHelpersRegistrationUtil_NotAnInstanceOf, new Object[]{ h, AbstractHyperLinkEditorHelper.class }));
- }
- } catch (CoreException ex) {
- Activator.log.error(Messages.HyperLinkEditorHelpersRegistrationUtil_ICantCreateTheClassForAnHelper, ex);
- }
- }
- }
- return helpers;
- }
-
-}

Back to the top