diff --git a/common/plugins/org.polarsys.capella.common.ef/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.ef/META-INF/MANIFEST.MF index 6e28ef3945..5387b5db39 100644 --- a/common/plugins/org.polarsys.capella.common.ef/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.ef/META-INF/MANIFEST.MF @@ -13,5 +13,4 @@ Export-Package: org.polarsys.capella.common.ef, org.polarsys.capella.common.ef.domain, org.polarsys.capella.common.ef.internal.command, org.polarsys.capella.common.ef.internal.domain -Bundle-Activator: org.polarsys.capella.common.ef.CapellaEFPlugin Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.ef/src/org/polarsys/capella/common/ef/CapellaEFPlugin.java b/common/plugins/org.polarsys.capella.common.ef/src/org/polarsys/capella/common/ef/CapellaEFPlugin.java deleted file mode 100644 index dda72339c8..0000000000 --- a/common/plugins/org.polarsys.capella.common.ef/src/org/polarsys/capella/common/ef/CapellaEFPlugin.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ - -package org.polarsys.capella.common.ef; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - * Controls org.polarsys.capella.common.ef plug-in life cycle. - */ -public class CapellaEFPlugin extends AbstractActivator { - /** - * Plug-in id. - */ - static final String PLUGIN_ID = "org.polarsys.capella.common.ef"; //$NON-NLS-1$ - - /** - * Singleton instance. - */ - private static CapellaEFPlugin __instance; - - /** - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __instance = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - __instance = null; - super.stop(context); - } - - /** - * Return the singleton instance. - * @return null if the plug-in is not started. - */ - public static CapellaEFPlugin getDefault() { - return __instance; - } -} diff --git a/common/plugins/org.polarsys.capella.common.flexibility.properties/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.flexibility.properties/META-INF/MANIFEST.MF index c6985c5064..fcb2294295 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.properties/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.flexibility.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.flexibility.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.flexibility.properties.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore diff --git a/common/plugins/org.polarsys.capella.common.flexibility.properties/src/org/polarsys/capella/common/flexibility/properties/Activator.java b/common/plugins/org.polarsys.capella.common.flexibility.properties/src/org/polarsys/capella/common/flexibility/properties/Activator.java deleted file mode 100644 index 227c1b9ea5..0000000000 --- a/common/plugins/org.polarsys.capella.common.flexibility.properties/src/org/polarsys/capella/common/flexibility/properties/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.flexibility.properties; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.flexibility.properties"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - 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; - } -} diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.flexibility.wizards/META-INF/MANIFEST.MF index e485080685..96fb1d03f4 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.flexibility.wizards/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.flexibility.wizards;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.flexibility.wizards.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.ui.views.properties.tabbed, @@ -20,11 +19,12 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.model.helpers, org.polarsys.capella.common.flexibility.properties;visibility:=reexport, org.polarsys.capella.core.model.handler, - javax.inject + javax.inject, + org.eclipse.ui.workbench, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.common.flexibility.wizards, - org.polarsys.capella.common.flexibility.wizards.constants, +Export-Package: org.polarsys.capella.common.flexibility.wizards.constants, org.polarsys.capella.common.flexibility.wizards.group.renderer, org.polarsys.capella.common.flexibility.wizards.loader, org.polarsys.capella.common.flexibility.wizards.policy, diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/Activator.java b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/Activator.java deleted file mode 100644 index 307b7724de..0000000000 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.flexibility.wizards; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.flexibility.wizards"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/BrowseRenderer.java b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/BrowseRenderer.java index 81fc85c6df..7051c85493 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/BrowseRenderer.java +++ b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/BrowseRenderer.java @@ -27,10 +27,11 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.schema.IProperty; import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext; import org.polarsys.capella.common.flexibility.properties.schema.IRestraintProperty; -import org.polarsys.capella.common.flexibility.wizards.Activator; import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext; import org.polarsys.capella.common.ui.toolkit.dialogs.SelectElementsDialog; import org.polarsys.capella.common.ui.toolkit.dialogs.TransferTreeListDialog; @@ -77,11 +78,12 @@ protected int getNbColumn() { protected void initializeControls(final Composite parent, final IRendererContext context) { super.initializeControls(parent, context); - ToolBar toolbar = new ToolBar(parent, SWT.HORIZONTAL); + ToolBar toolbar = new ToolBar(parent, SWT.HORIZONTAL); + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ if (isBrowseButton()) { browse = new ToolItem(toolbar, SWT.PUSH); browse.setToolTipText(getBrowseText()); - browse.setImage(Activator.getDefault().getImage("full/etool16/browse.gif")); + browse.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/browse.gif").createImage()); browse.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent event) { @@ -97,7 +99,7 @@ public void widgetDefaultSelected(SelectionEvent e) { if (isDeleteButton()) { delete = new ToolItem(toolbar, SWT.PUSH); delete.setToolTipText("Delete all elements"); - delete.setImage(Activator.getDefault().getImage("full/etool16/delete_edit.gif")); + delete.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/delete_edit.gif").createImage()); delete.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent event) { diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/CopyTextRenderer.java b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/CopyTextRenderer.java index 0b3495f6fd..65ac85078c 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/CopyTextRenderer.java +++ b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/renderer/CopyTextRenderer.java @@ -13,18 +13,18 @@ package org.polarsys.capella.common.flexibility.wizards.renderer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -import org.polarsys.capella.common.flexibility.wizards.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.Clipboard; +import org.eclipse.swt.dnd.TextTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext; /** @@ -45,10 +45,11 @@ protected boolean isImage() { @Override protected void initializeControls(final Composite parent, IRendererContext context) { - if (isCopyButton()) { + if (isCopyButton()) { + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ copyButton = new Label(rootTextControl, SWT.NONE); - copyButton.setToolTipText("Copy to clipboard"); - copyButton.setImage(Activator.getDefault().getImage("full/etool16/copy.gif")); + copyButton.setToolTipText("Copy to clipboard"); //$NON-NLS-1$ + copyButton.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/copy.gif").createImage()); //$NON-NLS-1$ copyButton.addMouseListener(new MouseListener() { @Override diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/PropertyWizardPage.java b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/PropertyWizardPage.java index 6a3b9f2174..9fc0ba0607 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/PropertyWizardPage.java +++ b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/PropertyWizardPage.java @@ -22,12 +22,12 @@ import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.widgets.Composite; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.PropertyChangeListener; import org.polarsys.capella.common.flexibility.properties.PropertyChangedEvent; import org.polarsys.capella.common.flexibility.properties.schema.IProperties; import org.polarsys.capella.common.flexibility.properties.schema.IProperty; import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext; -import org.polarsys.capella.common.flexibility.wizards.Activator; import org.polarsys.capella.common.flexibility.wizards.schema.IRenderer; import org.polarsys.capella.common.flexibility.wizards.schema.IRendererContext; @@ -162,7 +162,7 @@ protected void findMostSevere() { status = null; if (context != null) { - MultiStatus multiStatus = new CompoundMultiStatus(Activator.PLUGIN_ID); + MultiStatus multiStatus = new CompoundMultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); IProperties properties = context.getProperties(); if (properties != null) { for (IProperty item : properties.getAllItems()) { diff --git a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/util/StatusLabelHelper.java b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/util/StatusLabelHelper.java index 6e1630fd2a..f3ee86e4c9 100644 --- a/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/util/StatusLabelHelper.java +++ b/common/plugins/org.polarsys.capella.common.flexibility.wizards/src/org/polarsys/capella/common/flexibility/wizards/ui/util/StatusLabelHelper.java @@ -14,27 +14,31 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.widgets.Label; -import org.polarsys.capella.common.flexibility.wizards.Activator; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; public class StatusLabelHelper { + + StatusLabelHelper() {} /** * This method allows to set an image to the given SWT label according to the status */ public static void updateImage(IStatus status, Label label) { if (!label.isDisposed() && status != null) { + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ if (status.isOK()) { - label.setImage(Activator.getDefault().getImage("full/etool16/empty.gif")); + label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/empty.gif").createImage()); } else if (status.matches(IStatus.INFO)) { - label.setImage(Activator.getDefault().getImage("full/etool16/info_tsk.gif")); + label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/info_tsk.gif").createImage()); } else if (status.matches(IStatus.WARNING)) { - label.setImage(Activator.getDefault().getImage("full/etool16/warn_tsk.gif")); + label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/warn_tsk.gif").createImage()); } else if (status.matches(IStatus.ERROR)) { - label.setImage(Activator.getDefault().getImage("full/etool16/error_tsk.gif")); + label.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(StatusLabelHelper.class).getSymbolicName(), ICONS_PATH + "full/etool16/error_tsk.gif").createImage()); } } } diff --git a/common/plugins/org.polarsys.capella.common.helpers/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.helpers/META-INF/MANIFEST.MF index bdecb9d779..e0b83cdd4e 100644 --- a/common/plugins/org.polarsys.capella.common.helpers/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.helpers/META-INF/MANIFEST.MF @@ -15,5 +15,4 @@ Export-Package: org.polarsys.capella.common.helpers, org.polarsys.capella.common.helpers.validation.xml Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.common.helpers.HelperPlugin Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/HelperPlugin.java b/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/HelperPlugin.java deleted file mode 100644 index 0462a2ed0c..0000000000 --- a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/HelperPlugin.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.helpers; - -import org.eclipse.core.runtime.Plugin; - -public class HelperPlugin extends Plugin { - - // The HelperPlugin plugin unique instance. - private static HelperPlugin __instance; - - /** - * Constructs the Helper Plugin instance. - */ - public HelperPlugin() { - __instance = this; - } - - /** - * Gets the unique Helper Plugin activator instance. - * @return The Helper Plugin. - */ - public static HelperPlugin getDefault() { - return __instance; - } - - /** - * Get the plug-in ID according to MANISFEST.MF definition. - * - * @return a String containing the plug-in ID. - */ - public String getPluginId() { - return getBundle().getSymbolicName(); - } - -} diff --git a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/selection/LinkSelectionProvider.java b/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/selection/LinkSelectionProvider.java index d42eae23b3..9e4a580180 100644 --- a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/selection/LinkSelectionProvider.java +++ b/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/selection/LinkSelectionProvider.java @@ -13,14 +13,13 @@ package org.polarsys.capella.common.helpers.selection; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.emf.ecore.EClass; - -import org.polarsys.capella.common.helpers.EcoreUtil2; -import org.polarsys.capella.common.helpers.HelperPlugin; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.emf.ecore.EClass; +import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; /** @@ -54,7 +53,7 @@ public List getAllContributions() { if (null == _linkSelectionContributions) { _linkSelectionContributions = new ArrayList(); IConfigurationElement[] LinkSelectionContributions = - ExtensionPointHelper.getConfigurationElements(HelperPlugin.getDefault().getPluginId(), LINK_SELECT_EXTENSION_POINT_SHORT_ID); + ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), LINK_SELECT_EXTENSION_POINT_SHORT_ID); // Loop over found contributions. for (IConfigurationElement contribution : LinkSelectionContributions) { // Instantiate the contribution. diff --git a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/validation/xml/XMLValidationHelper.java b/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/validation/xml/XMLValidationHelper.java index 157b24ab9c..ff51d7007b 100644 --- a/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/validation/xml/XMLValidationHelper.java +++ b/common/plugins/org.polarsys.capella.common.helpers/src/org/polarsys/capella/common/helpers/validation/xml/XMLValidationHelper.java @@ -17,19 +17,18 @@ import java.util.ArrayList; import java.util.List; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; -import org.polarsys.capella.common.helpers.HelperPlugin; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - /** * A helper class to 'validate' xml documents. * @@ -50,12 +49,9 @@ public class XMLValidationHelper { public XMLValidationHelper() { try { parser = SAXParserFactory.newInstance().newSAXParser(); - } catch (ParserConfigurationException exception) { - HelperPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, - HelperPlugin.getDefault().getPluginId(), exception.getMessage(), exception)); - } catch (SAXException exception) { - HelperPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, - HelperPlugin.getDefault().getPluginId(), exception.getMessage(), exception)); + } catch (ParserConfigurationException | SAXException exception) { + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(exception.getMessage(), exception); } finally { if (parser == null){ throw new RuntimeException("Cannot get a SAXParser instance"); //$NON-NLS-1$ @@ -74,13 +70,13 @@ public List checkWellFormed(String text) { try { parser.parse(new InputSource(new StringReader(text)), handler); } catch (IOException exception) { - HelperPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, - HelperPlugin.getDefault().getPluginId(), exception.getMessage(), exception)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(exception.getMessage(), exception); } catch (SAXException exception) { if (!(exception instanceof SAXParseException)){ // SAXParseExceptions are stored already in the handler, so skip them here. - HelperPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, - HelperPlugin.getDefault().getPluginId(), exception.getMessage(), exception)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(exception.getMessage(), exception); } } return handler.getExceptions(); diff --git a/common/plugins/org.polarsys.capella.common.id.handler/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.id.handler/META-INF/MANIFEST.MF index 78c6ccc1e0..e16d431838 100644 --- a/common/plugins/org.polarsys.capella.common.id.handler/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.id.handler/META-INF/MANIFEST.MF @@ -10,5 +10,4 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.common.data.core.gen Export-Package: org.polarsys.capella.common.id.handler Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.common.id.handler.SharedIdHandlerPlugin Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.id.handler/src/org/polarsys/capella/common/id/handler/SharedIdHandlerPlugin.java b/common/plugins/org.polarsys.capella.common.id.handler/src/org/polarsys/capella/common/id/handler/SharedIdHandlerPlugin.java deleted file mode 100644 index 3c29a8af67..0000000000 --- a/common/plugins/org.polarsys.capella.common.id.handler/src/org/polarsys/capella/common/id/handler/SharedIdHandlerPlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.id.handler; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class SharedIdHandlerPlugin extends AbstractActivator { - // The shared instance - private static SharedIdHandlerPlugin plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static SharedIdHandlerPlugin getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.common.libraries/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.libraries/META-INF/MANIFEST.MF index 598ee5167e..55e63486f9 100644 --- a/common/plugins/org.polarsys.capella.common.libraries/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.libraries/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.libraries;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.libraries.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, diff --git a/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/Activator.java b/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/Activator.java deleted file mode 100644 index ef61b41803..0000000000 --- a/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/Activator.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.libraries; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.libraries"; //$NON-NLS-1$ - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - } -} diff --git a/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/policy/ResourceAccessPolicyListener.java b/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/policy/ResourceAccessPolicyListener.java index b5326b113b..cf9bd45de6 100644 --- a/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/policy/ResourceAccessPolicyListener.java +++ b/common/plugins/org.polarsys.capella.common.libraries/src/org/polarsys/capella/common/libraries/policy/ResourceAccessPolicyListener.java @@ -26,8 +26,8 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.viewpoint.DRefreshable; import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.libraries.AccessPolicy; -import org.polarsys.capella.common.libraries.Activator; import org.polarsys.capella.common.libraries.ILibraryManager; import org.polarsys.capella.common.libraries.IModel; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; @@ -56,7 +56,7 @@ public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws Rol if (!modifiedModels.contains(model) && sourceModel.getAccess(model) == AccessPolicy.READ_ONLY) { Logger.getLogger(IReportManagerDefaultComponents.MODEL) .error(Messages.ResourceAccessPolicyListener_RollbackReadOnly); - throw new RollbackException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, + throw new RollbackException(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.ResourceAccessPolicyListener_RollbackReadOnly)); } modifiedModels.add(model); diff --git a/common/plugins/org.polarsys.capella.common.linkedtext.ui/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.linkedtext.ui/META-INF/MANIFEST.MF index aef15b2344..bdec3b30bb 100644 --- a/common/plugins/org.polarsys.capella.common.linkedtext.ui/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.linkedtext.ui/META-INF/MANIFEST.MF @@ -4,7 +4,6 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.polarsys.capella.common.linkedtext.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.linkedtext.ui.LinkedTextUIActivator Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.ui, diff --git a/common/plugins/org.polarsys.capella.common.linkedtext.ui/src/org/polarsys/capella/common/linkedtext/ui/LinkedTextUIActivator.java b/common/plugins/org.polarsys.capella.common.linkedtext.ui/src/org/polarsys/capella/common/linkedtext/ui/LinkedTextUIActivator.java deleted file mode 100644 index d2ac9203ad..0000000000 --- a/common/plugins/org.polarsys.capella.common.linkedtext.ui/src/org/polarsys/capella/common/linkedtext/ui/LinkedTextUIActivator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.linkedtext.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class LinkedTextUIActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.linkedtext.ui"; //$NON-NLS-1$ - - // The shared instance - private static LinkedTextUIActivator plugin; - - /** - * The constructor - */ - public LinkedTextUIActivator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static LinkedTextUIActivator getDefault() { - return plugin; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.menu.dynamic/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.menu.dynamic/META-INF/MANIFEST.MF index c1073f1e01..f0de85bce2 100644 --- a/common/plugins/org.polarsys.capella.common.menu.dynamic/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.menu.dynamic/META-INF/MANIFEST.MF @@ -11,5 +11,4 @@ Export-Package: org.polarsys.capella.common.menu.dynamic, org.polarsys.capella.common.menu.dynamic.util Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.common.menu.dynamic.DynamicMenuActivator Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/DynamicMenuActivator.java b/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/DynamicMenuActivator.java deleted file mode 100644 index 20e3cf7ecd..0000000000 --- a/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/DynamicMenuActivator.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.menu.dynamic; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - */ -public class DynamicMenuActivator extends Plugin { - /** - * The shared instance - */ - private static DynamicMenuActivator plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static DynamicMenuActivator getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/contributions/ActionContributionProvider.java b/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/contributions/ActionContributionProvider.java index 71c8825bf9..aed00fceed 100644 --- a/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/contributions/ActionContributionProvider.java +++ b/common/plugins/org.polarsys.capella.common.menu.dynamic/src/org/polarsys/capella/common/menu/dynamic/contributions/ActionContributionProvider.java @@ -21,18 +21,14 @@ import java.util.Map.Entry; import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.emf.ecore.EClass; - +import org.eclipse.emf.ecore.EClass; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; /** * */ public class ActionContributionProvider { - /** - * Plug-in id constant. - */ - public static final String CONTEXTUAL_MENU_PLUGIN_ID = "org.polarsys.capella.common.menu.dynamic"; //$NON-NLS-1$ /** * Contribution menu item extension-point id. */ @@ -63,7 +59,7 @@ private ActionContributionProvider() { // Instantiate the map that holds all contributions. _menuContributions = new HashMap>(0); // Load contributions. - IConfigurationElement[] contributors = ExtensionPointHelper.getConfigurationElements(CONTEXTUAL_MENU_PLUGIN_ID, MENU_ITEM_CONTRIBUTION_EXTENSION_ID); + IConfigurationElement[] contributors = ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), MENU_ITEM_CONTRIBUTION_EXTENSION_ID); for (IConfigurationElement contributorElement : contributors) { // Instantiate current contribution. IMDEMenuItemContribution contribution = diff --git a/common/plugins/org.polarsys.capella.common.model/src/org/polarsys/capella/common/model/copypaste/SharedInitializeCopyCommand.java b/common/plugins/org.polarsys.capella.common.model/src/org/polarsys/capella/common/model/copypaste/SharedInitializeCopyCommand.java index 0958700c17..7ddb1225d9 100644 --- a/common/plugins/org.polarsys.capella.common.model/src/org/polarsys/capella/common/model/copypaste/SharedInitializeCopyCommand.java +++ b/common/plugins/org.polarsys.capella.common.model/src/org/polarsys/capella/common/model/copypaste/SharedInitializeCopyCommand.java @@ -73,7 +73,7 @@ public int hashCode() { } - private static final String PLUGIN_ID = "org.polarsys.capella.common.model.DroppedReferencesOnCopy"; + private static final String DROPPEDREFERENCES_EXTENSION_ID = "org.polarsys.capella.common.model.DroppedReferencesOnCopy"; private static Map pendingReferences = new HashMap(); private static List droppedReferences = null; @@ -173,7 +173,7 @@ private boolean isDroppedReference(EReference reference) { private void loadDroppedReferences() { IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry(); - IConfigurationElement[] elementsForPlugin = extensionRegistry.getConfigurationElementsFor(PLUGIN_ID); + IConfigurationElement[] elementsForPlugin = extensionRegistry.getConfigurationElementsFor(DROPPEDREFERENCES_EXTENSION_ID); droppedReferences = new ArrayList(elementsForPlugin.length); for (IConfigurationElement configurationElement : elementsForPlugin) { String refName = configurationElement.getAttribute(REFERENCE_NAME_ATTRIBUTE); diff --git a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/META-INF/MANIFEST.MF index 258d643425..b4cfcde5df 100644 --- a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.platform.eclipse.tools.report.console;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.platform.eclipse.tools.report.console.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/src/org/polarsys/capella/common/platform/eclipse/tools/report/console/Activator.java b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/src/org/polarsys/capella/common/platform/eclipse/tools/report/console/Activator.java deleted file mode 100644 index 4825475a1c..0000000000 --- a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.console/src/org/polarsys/capella/common/platform/eclipse/tools/report/console/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.platform.eclipse.tools.report.console; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The shared instance - private static Activator plugin; - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.platform.eclipse.tools.report.console"; //$NON-NLS-1$ - - /** - * The constructor - */ - public Activator() { - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } -} diff --git a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/META-INF/MANIFEST.MF index f66e62bdbf..ef6ecfbc65 100644 --- a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/META-INF/MANIFEST.MF @@ -3,13 +3,11 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.platform.eclipse.tools.report.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.platform.eclipse.tools.report.ui.ReportManagerUI Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.common.tools.report.ui, org.eclipse.ui, org.eclipse.core.runtime Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.common.platform.eclipse.tools.report.ui, - org.polarsys.capella.common.platform.eclipse.tools.report.ui.pref +Export-Package: org.polarsys.capella.common.platform.eclipse.tools.report.ui.pref Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/src/org/polarsys/capella/common/platform/eclipse/tools/report/ui/ReportManagerUI.java b/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/src/org/polarsys/capella/common/platform/eclipse/tools/report/ui/ReportManagerUI.java deleted file mode 100644 index 3bb5555cd5..0000000000 --- a/common/plugins/org.polarsys.capella.common.platform.eclipse.tools.report.ui/src/org/polarsys/capella/common/platform/eclipse/tools/report/ui/ReportManagerUI.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.platform.eclipse.tools.report.ui; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class ReportManagerUI extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.platform.eclipse.tools.report.ui"; //$NON-NLS-1$ - - // The shared instance - private static ReportManagerUI plugin; - - /** - * The constructor - */ - public ReportManagerUI() { - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static ReportManagerUI getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.customization/src/org/polarsys/capella/common/platform/sirius/customisation/SiriusCustomizationPlugin.java b/common/plugins/org.polarsys.capella.common.platform.sirius.customization/src/org/polarsys/capella/common/platform/sirius/customisation/SiriusCustomizationPlugin.java index f9095931cf..440115a57c 100644 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.customization/src/org/polarsys/capella/common/platform/sirius/customisation/SiriusCustomizationPlugin.java +++ b/common/plugins/org.polarsys.capella.common.platform.sirius.customization/src/org/polarsys/capella/common/platform/sirius/customisation/SiriusCustomizationPlugin.java @@ -33,6 +33,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.platform.sirius.customisation.uicallback.SiriusUiCallBack; /** @@ -42,7 +43,7 @@ public class SiriusCustomizationPlugin extends AbstractUIPlugin { /** The plug-in ID. */ - public static final String PLUGIN_ID = "org.polarsys.capella.common.platform.sirius.customisation"; //$NON-NLS-1$ + public static final String PLUGIN_ID = FrameworkUtil.getBundle(SiriusCustomizationPlugin.class).getSymbolicName(); // The shared instance private static SiriusCustomizationPlugin plugin; diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/META-INF/MANIFEST.MF index c1f92845b7..ace46fb259 100644 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/META-INF/MANIFEST.MF @@ -10,8 +10,9 @@ Require-Bundle: org.eclipse.sirius;visibility:=reexport, org.eclipse.sirius.common;visibility:=reexport, org.eclipse.sirius.ecore.extender;visibility:=reexport, org.polarsys.capella.common.ef;visibility:=reexport, - org.eclipse.core.expressions + org.eclipse.core.expressions, + org.eclipse.osgi, + org.polarsys.capella.common;bundle-version="6.0.0" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.common.platform.sirius.ted.PlatformSiriusTedActivator Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/DataNotifier.java b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/DataNotifier.java index 002a113363..e636c1dc5a 100644 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/DataNotifier.java +++ b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/DataNotifier.java @@ -23,8 +23,7 @@ import java.util.Map; import java.util.Set; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; @@ -32,6 +31,8 @@ import org.eclipse.emf.ecore.util.EContentAdapter; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; /** * Provides EMF model notification with an unique adapter.
@@ -132,9 +133,9 @@ public void addAdapter(EObject element, Adapter adapter) { public void notifyChanged(Notification notification) { try { super.notifyChanged(notification); - } catch (Exception exception) { - PlatformSiriusTedActivator.getDefault().getLog().log( - new Status(IStatus.ERROR, PlatformSiriusTedActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + } catch (Exception exception) { + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(exception.getMessage(), exception); // TODO: must handle this case, ie. provide a CDO version adapted to CDO of DataNotifier. // DataNotifier is instantiated by our SemanticResourceSet. there is already an extension point that allows to override the capella cross referencer. // Must do the same thing here. diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/PlatformSiriusTedActivator.java b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/PlatformSiriusTedActivator.java deleted file mode 100644 index b372612c1b..0000000000 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/PlatformSiriusTedActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ - -package org.polarsys.capella.common.platform.sirius.ted; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - * Controls platform.sirius.ted plug-in life cycle. - */ -public class PlatformSiriusTedActivator extends AbstractActivator { - /** - * Singleton instance. - */ - private static PlatformSiriusTedActivator __instance; - - @Deprecated - //Use org.polarsys.capella.core.af.integration.AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID instead - public static final String CAPELLA_VIEWPOINT_ID = "org.polarsys.capella.core.viewpoint"; - - /** - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __instance = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - __instance = null; - super.stop(context); - } - - /** - * Return the singleton instance. - * @return null if the plug-in is not started. - */ - public static PlatformSiriusTedActivator getDefault() { - return __instance; - } -} diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SemanticEditingDomainFactory.java b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SemanticEditingDomainFactory.java index 77578e9bd2..bcb3a66c0b 100644 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SemanticEditingDomainFactory.java +++ b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SemanticEditingDomainFactory.java @@ -24,6 +24,7 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.command.AbstractCommand.NonDirtying; import org.eclipse.emf.common.command.Command; @@ -48,6 +49,8 @@ import org.eclipse.emf.workspace.ResourceUndoContext; import org.eclipse.emf.workspace.WorkspaceEditingDomainFactory; import org.eclipse.sirius.common.tools.api.util.SiriusCrossReferenceAdapter; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.domain.IEditingDomainListener; import org.polarsys.capella.common.ef.internal.command.WorkspaceCommandStackImpl; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; @@ -281,8 +284,9 @@ protected void doExecute(Command command, Map options) throws InterruptedExcepti // Hopefully, the rollback is complete before this exception is thrown. // Log this exception as a warning. String message = "Error while executing a command:"; //$NON-NLS-1$ - PlatformSiriusTedActivator.getDefault().getLog().log(new Status(IStatus.WARNING, PlatformSiriusTedActivator.getDefault().getPluginId(), message, exception)); - throw new RollbackException(new Status(IStatus.CANCEL, PlatformSiriusTedActivator.getDefault().getPluginId(), message, exception)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(message, exception); + throw new RollbackException(new Status(IStatus.CANCEL, bundle.getSymbolicName(), message, exception)); } } } diff --git a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SiriusSessionFactory.java b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SiriusSessionFactory.java index 305deefd6a..c0213da5eb 100644 --- a/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SiriusSessionFactory.java +++ b/common/plugins/org.polarsys.capella.common.platform.sirius.ted/src/org/polarsys/capella/common/platform/sirius/ted/SiriusSessionFactory.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.business.internal.session.SessionFactoryImpl; import org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; /** @@ -122,9 +123,9 @@ public Collection getDerivedSemanticResources(TransactionalEditingDoma protected List getAllDerivedSemanticResourceProviders() { if (null == _derivedSemanticResourceProviders) { _derivedSemanticResourceProviders = new ArrayList(); - List BQProvider = Arrays.asList(ExtensionPointHelper.getConfigurationElements( - PlatformSiriusTedActivator.getDefault().getPluginId(), DERIVED_SEMANTIC_RESOURCE_PROVIDER_EXTENSION_ID)); - for (IConfigurationElement configurationElement : BQProvider) { + List providers = Arrays + .asList(ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), DERIVED_SEMANTIC_RESOURCE_PROVIDER_EXTENSION_ID)); + for (IConfigurationElement configurationElement : providers) { IDerivedSemanticResourceProvider contrib = (IDerivedSemanticResourceProvider) ExtensionPointHelper .createInstance(configurationElement, ExtensionPointHelper.ATT_CLASS); if (contrib != null) { @@ -146,7 +147,7 @@ public IMetadataProvider getProvider() { if (loaded == Boolean.FALSE) { for (IConfigurationElement configurationElement : ExtensionPointHelper - .getConfigurationElements(PlatformSiriusTedActivator.getDefault().getPluginId(), "metadataProvider")) { + .getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "metadataProvider")) { IMetadataProvider contrib = (IMetadataProvider) ExtensionPointHelper.createInstance(configurationElement, ExtensionPointHelper.ATT_CLASS); if (contrib != null) { diff --git a/common/plugins/org.polarsys.capella.common.queries/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.queries/META-INF/MANIFEST.MF index 9503f9cc84..bf625e651c 100644 --- a/common/plugins/org.polarsys.capella.common.queries/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.queries/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.queries;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.queries.Activator Bundle-Vendor: %providerName Require-Bundle: org.apache.commons.lang, org.eclipse.core.runtime, diff --git a/common/plugins/org.polarsys.capella.common.queries/src/org/polarsys/capella/common/queries/Activator.java b/common/plugins/org.polarsys.capella.common.queries/src/org/polarsys/capella/common/queries/Activator.java deleted file mode 100644 index 8dd5de1314..0000000000 --- a/common/plugins/org.polarsys.capella.common.queries/src/org/polarsys/capella/common/queries/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.queries; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.queries.interpretor.QueryInterpretor; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.queries"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - 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; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.re.ui/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.re.ui/META-INF/MANIFEST.MF index d706ccafb1..7f7b0cb80e 100644 --- a/common/plugins/org.polarsys.capella.common.re.ui/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.re.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.re.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.re.ui.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -24,8 +23,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.sirius.diagram Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.common.re.ui, - org.polarsys.capella.common.re.ui.decorators, +Export-Package: org.polarsys.capella.common.re.ui.decorators, org.polarsys.capella.common.re.ui.group.renderers, org.polarsys.capella.common.re.ui.handlers, org.polarsys.capella.common.re.ui.handlers.merge, diff --git a/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/Activator.java b/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/Activator.java deleted file mode 100644 index 07c44b23a2..0000000000 --- a/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/Activator.java +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.re.ui; - -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.re.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - @Override - protected void initializeImageRegistry(ImageRegistry reg) { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/renderers/ReplicaRenderer.java b/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/renderers/ReplicaRenderer.java index c66835e52e..6d4b5aa9b9 100644 --- a/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/renderers/ReplicaRenderer.java +++ b/common/plugins/org.polarsys.capella.common.re.ui/src/org/polarsys/capella/common/re/ui/renderers/ReplicaRenderer.java @@ -30,6 +30,7 @@ import org.eclipse.swt.graphics.Font; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.PropertyChangeListener; import org.polarsys.capella.common.flexibility.properties.PropertyChangedEvent; import org.polarsys.capella.common.flexibility.properties.schema.IProperty; @@ -39,7 +40,6 @@ import org.polarsys.capella.common.re.constants.IReConstants; import org.polarsys.capella.common.re.handlers.attributes.AttributesHandlerHelper; import org.polarsys.capella.common.re.handlers.scope.DependenciesHandlerHelper; -import org.polarsys.capella.common.re.ui.Activator; import org.polarsys.capella.common.re.ui.decorators.InstanciationLabelDecorator; import org.polarsys.capella.common.ui.toolkit.viewers.data.AbstractData; import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext; @@ -185,13 +185,14 @@ protected IStatus isImportant(Object element, IRendererContext context) { return Status.OK_STATUS; } + String bundleName = FrameworkUtil.getBundle(this.getClass()).getSymbolicName(); if (!scopeElements.contains(element)) { - return new Status(IStatus.INFO, Activator.PLUGIN_ID, ""); + return new Status(IStatus.INFO, bundleName, ""); } IContext ctx = (IContext) context.getPropertyContext().getSource(); if (AttributesHandlerHelper.getInstance(ctx).isSuffixable(element, ctx)) { - return new Status(IStatus.WARNING, Activator.PLUGIN_ID, "+SUFFIX"); + return new Status(IStatus.WARNING, bundleName, "+SUFFIX"); } return Status.OK_STATUS; @@ -223,7 +224,7 @@ public IStatus getDependenciesStatus(Collection elements, Collection resultingColl } } } catch (CoreException e) { - MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, e.getLocalizedMessage(), e)); + MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getLocalizedMessage(), e)); } } diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/MarkerViewPlugin.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/MarkerViewPlugin.java index 6dbeece077..c48ef097bb 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/MarkerViewPlugin.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/MarkerViewPlugin.java @@ -20,6 +20,7 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.services.AbstractUIActivator; /** @@ -31,9 +32,6 @@ public class MarkerViewPlugin extends AbstractUIActivator { // Resource bundle. private ResourceBundle resourceBundle; - /** the plugin ID */ - public static final String PLUGIN_ID = "org.polarsys.capella.common.tools.report.appenders.reportlogview"; //$NON-NLS-1$ - /** * The constructor. */ @@ -41,7 +39,7 @@ public MarkerViewPlugin() { super(); plugin = this; try { - resourceBundle = ResourceBundle.getBundle(PLUGIN_ID); + resourceBundle = ResourceBundle.getBundle(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); } catch (MissingResourceException x) { resourceBundle = null; } diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/ReportManagerLogViewAppender.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/ReportManagerLogViewAppender.java index 523a2d0bdd..290a8a8f12 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/ReportManagerLogViewAppender.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/ReportManagerLogViewAppender.java @@ -34,6 +34,7 @@ import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.ui.views.markers.MarkerViewUtil; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.tools.report.EmbeddedMessage; @@ -165,7 +166,7 @@ public void modify(IMarker marker) { } } } catch (CoreException e) { - MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, e.getLocalizedMessage(), e)); + MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getLocalizedMessage(), e)); } } }); @@ -182,7 +183,7 @@ public void modify(IMarker marker) { marker.setAttribute(IMarker.SEVERITY, level); // violates IMarker API marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH); } catch (CoreException e) { - MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, e.getLocalizedMessage(), e)); + MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getLocalizedMessage(), e)); } if (additions != null) { additions.modify(marker); diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/extpoint/ReportLogViewExtPointUtil.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/extpoint/ReportLogViewExtPointUtil.java index 6b5775a316..466a4d4cdf 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/extpoint/ReportLogViewExtPointUtil.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/extpoint/ReportLogViewExtPointUtil.java @@ -13,12 +13,11 @@ package org.polarsys.capella.common.tools.report.appenders.reportlogview.extpoint; -import org.eclipse.core.runtime.IConfigurationElement; - +import org.eclipse.core.runtime.IConfigurationElement; +import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; +import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.tools.report.appenders.reportlogview.IReportLogViewMarkerIdsProvider; -import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewPlugin; -import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; -import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; /** * Utility class for the filterOnReportView extension point. @@ -37,7 +36,7 @@ public static String[] getMarkersID(String viewID) { // Get all the contribution to the marker filtering on report log. IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements( - MarkerViewPlugin.PLUGIN_ID, + FrameworkUtil.getBundle(ReportLogViewExtPointUtil.class).getSymbolicName(), IReportLogViewExtPointConstants.EXT_POINT_ID ); diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteConstraintMarkersHandler.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteConstraintMarkersHandler.java index 477c4bfd35..cdfcee33d4 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteConstraintMarkersHandler.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteConstraintMarkersHandler.java @@ -29,8 +29,8 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; - +import org.eclipse.ui.handlers.HandlerUtil; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.IMarkerSource; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerView; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewHelper; @@ -64,7 +64,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException { try { m.delete(); } catch (CoreException e) { - MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, e.getMessage(), e)); + MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage(), e)); } } } diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteHandler.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteHandler.java index c78b0357da..8a0555f7cf 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteHandler.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/DeleteHandler.java @@ -23,8 +23,8 @@ import org.eclipse.core.runtime.Status; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.StructuredSelection; - +import org.eclipse.jface.viewers.StructuredSelection; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerView; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewPlugin; @@ -68,7 +68,7 @@ private void delete(MarkerView view, Object element){ try { m.delete(); } catch (CoreException exception) { - MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, exception.getMessage(), exception)); + MarkerViewPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } } diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/QuickfixHandler.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/QuickfixHandler.java index fd5d495fa5..3fcc4f0f23 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/QuickfixHandler.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.reportlogview/src/org/polarsys/capella/common/tools/report/appenders/reportlogview/handler/QuickfixHandler.java @@ -38,6 +38,7 @@ import org.eclipse.ui.ide.IDE; import org.eclipse.ui.statushandlers.StatusManager; import org.eclipse.ui.views.markers.WorkbenchMarkerResolution; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewPlugin; import org.polarsys.capella.common.tools.report.appenders.reportlogview.Messages; @@ -210,10 +211,10 @@ public void run(IProgressMonitor monitor) { PlatformUI.getWorkbench().getProgressService().runInUI(context, resolutionsRunnable, null); } catch (InvocationTargetException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } catch (InterruptedException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } }); diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/META-INF/MANIFEST.MF index 380aa994a8..24f8c3f6bc 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.tools.report.appenders.usage.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.tools.report.appenders.usage.ui.UsageAppenderUIPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.polarsys.capella.common.tools.report.appenders.usage diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/src/org/polarsys/capella/common/tools/report/appenders/usage/ui/UsageAppenderUIPlugin.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/src/org/polarsys/capella/common/tools/report/appenders/usage/ui/UsageAppenderUIPlugin.java deleted file mode 100644 index 5eee61f7bc..0000000000 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage.ui/src/org/polarsys/capella/common/tools/report/appenders/usage/ui/UsageAppenderUIPlugin.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.tools.report.appenders.usage.ui; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class UsageAppenderUIPlugin extends Plugin { - - public static final String PLUGIN_ID = "org.polarsys.capella.common.tools.report.appenders.usage.ui"; //$NON-NLS-1$ - - // The shared instance - private static UsageAppenderUIPlugin plugin; - - /** - * The constructor - */ - public UsageAppenderUIPlugin() { - // nothing - } - - /** - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static UsageAppenderUIPlugin getDefault() { - return plugin; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageAppenderPlugin.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageAppenderPlugin.java index b7e2cddc4b..b89baf456f 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageAppenderPlugin.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageAppenderPlugin.java @@ -21,8 +21,6 @@ */ public class UsageAppenderPlugin extends Plugin { - public static final String PLUGIN_ID = "org.polarsys.capella.common.tools.report.appenders.usage"; //$NON-NLS-1$ - // The shared instance private static UsageAppenderPlugin plugin; diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageMonitoringLogger.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageMonitoringLogger.java index 239ce9a222..fb4ad5c957 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageMonitoringLogger.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/UsageMonitoringLogger.java @@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; import org.polarsys.capella.common.tools.report.appenders.usage.preferences.IUsagePreferences; import org.polarsys.capella.common.tools.report.appenders.usage.util.UsageLogger; @@ -62,7 +63,7 @@ private void setUsagePath() { if (varValue == null) { // Log warning about undefined environment variable or system property UsageAppenderPlugin.getDefault().getLog() - .log(new Status(IStatus.WARNING, UsageAppenderPlugin.PLUGIN_ID, "Undefined environment variable: " + .log(new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Undefined environment variable: " + variableName + " found in -DUsagePath configuration. The log file will be put in the workspace.")); unresolvableVar = true; break; diff --git a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/preferences/PreferencesInitializer.java b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/preferences/PreferencesInitializer.java index c4be32dd7b..d1289aa47a 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/preferences/PreferencesInitializer.java +++ b/common/plugins/org.polarsys.capella.common.tools.report.appenders.usage/src/org/polarsys/capella/common/tools/report/appenders/usage/preferences/PreferencesInitializer.java @@ -13,7 +13,7 @@ package org.polarsys.capella.common.tools.report.appenders.usage.preferences; import org.eclipse.core.resources.ProjectScope; -import org.polarsys.capella.common.tools.report.appenders.usage.UsageAppenderPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; /** @@ -24,7 +24,7 @@ public class PreferencesInitializer extends AbstractPreferencesInitializer { * */ public PreferencesInitializer() { - super(UsageAppenderPlugin.PLUGIN_ID); + super(FrameworkUtil.getBundle(PreferencesInitializer.class).getSymbolicName()); } /** diff --git a/common/plugins/org.polarsys.capella.common.tools.report/src/org/polarsys/capella/common/tools/report/ReportManagerActivator.java b/common/plugins/org.polarsys.capella.common.tools.report/src/org/polarsys/capella/common/tools/report/ReportManagerActivator.java index 03852a425e..3e8afbec42 100644 --- a/common/plugins/org.polarsys.capella.common.tools.report/src/org/polarsys/capella/common/tools/report/ReportManagerActivator.java +++ b/common/plugins/org.polarsys.capella.common.tools.report/src/org/polarsys/capella/common/tools/report/ReportManagerActivator.java @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Plugin; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.tools.report.appenders.IFlushableAppenders; @@ -35,7 +36,7 @@ public class ReportManagerActivator extends Plugin { // The shared instance private static ReportManagerActivator plugin; - private static final String REPORT_PLUGIN_ID = "org.polarsys.capella.common.tools.report"; //$NON-NLS-1$ + private static final String REPORT_PLUGIN_ID = FrameworkUtil.getBundle(ReportManagerActivator.class).getSymbolicName(); private List appenders; private List flushableAppenders; diff --git a/common/plugins/org.polarsys.capella.common.transition/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.transition/META-INF/MANIFEST.MF index 383a409fda..57ca4696cd 100644 --- a/common/plugins/org.polarsys.capella.common.transition/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.transition/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.transition;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.common.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.expressions, diff --git a/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/Activator.java b/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/Activator.java deleted file mode 100644 index c1964266e5..0000000000 --- a/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.transition.common; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.transition"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - 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; - } - -} diff --git a/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/domain/DomainHelper.java b/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/domain/DomainHelper.java index 86a933971a..cde74bdad6 100644 --- a/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/domain/DomainHelper.java +++ b/common/plugins/org.polarsys.capella.common.transition/src/org/polarsys/capella/core/transition/common/domain/DomainHelper.java @@ -20,11 +20,11 @@ import java.util.LinkedHashSet; import java.util.Set; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EPackage; -import org.polarsys.capella.core.transition.common.Activator; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.transition.common.ExtensionHelper; import org.polarsys.capella.core.transition.common.constants.ISchemaConstants; import org.polarsys.capella.core.transition.common.context.TransitionContext; @@ -74,8 +74,8 @@ public Class getDomainMetaclass(String name) { // Nothing more } } - Activator.getDefault().getLog() - .log(new Status(IStatus.ERROR, TransposerEMFPlugin.PLUGIN_ID, "No Domain Class called : " + name, e)); //$NON-NLS-1$ + Bundle bundle = FrameworkUtil.getBundle(TransposerEMFPlugin.class); + Platform.getLog(bundle).error("No Domain Class called : " + name, e); //$NON-NLS-1$ } return null; diff --git a/common/plugins/org.polarsys.capella.common.ui.massactions.core/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.ui.massactions.core/META-INF/MANIFEST.MF index 156f5fb601..495be5d095 100644 --- a/common/plugins/org.polarsys.capella.common.ui.massactions.core/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.ui.massactions.core/META-INF/MANIFEST.MF @@ -8,7 +8,8 @@ Require-Bundle: org.polarsys.capella.core.ui.properties;visibility:=reexport, org.polarsys.capella.common.ui.toolkit.browser, org.polarsys.kitalpha.massactions.edit;visibility:=reexport, org.polarsys.kitalpha.massactions.visualize;visibility:=reexport, - org.polarsys.capella.core.ui.semantic.browser + org.polarsys.capella.core.ui.semantic.browser, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: org.polarsys.capella.common.ui.massactions.core.activator, diff --git a/common/plugins/org.polarsys.capella.common.ui.massactions.core/src/org/polarsys/capella/common/ui/massactions/core/activator/MECoreCapellaActivator.java b/common/plugins/org.polarsys.capella.common.ui.massactions.core/src/org/polarsys/capella/common/ui/massactions/core/activator/MECoreCapellaActivator.java index fc00ec65ad..c719e9f3cb 100644 --- a/common/plugins/org.polarsys.capella.common.ui.massactions.core/src/org/polarsys/capella/common/ui/massactions/core/activator/MECoreCapellaActivator.java +++ b/common/plugins/org.polarsys.capella.common.ui.massactions.core/src/org/polarsys/capella/common/ui/massactions/core/activator/MECoreCapellaActivator.java @@ -15,6 +15,7 @@ import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; /** * The activator class controls the plug-in life cycle @@ -24,9 +25,6 @@ */ public class MECoreCapellaActivator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.ui.massactions.core"; //$NON-NLS-1$ - public static final String IMAGE_BROWSE = "IMAGE_BROWSE"; // The shared instance @@ -67,7 +65,7 @@ public static MECoreCapellaActivator getDefault() { protected void initializeImageRegistry(ImageRegistry reg) { super.initializeImageRegistry(reg); - reg.put(IMAGE_BROWSE, imageDescriptorFromPlugin(PLUGIN_ID, "icons/browse.gif")); + reg.put(IMAGE_BROWSE, imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/browse.gif")); } } diff --git a/common/plugins/org.polarsys.capella.common.ui.massactions/src/org/polarsys/capella/common/ui/massactions/activator/MACapellaActivator.java b/common/plugins/org.polarsys.capella.common.ui.massactions/src/org/polarsys/capella/common/ui/massactions/activator/MACapellaActivator.java index 7119bf99e0..8d059f30da 100644 --- a/common/plugins/org.polarsys.capella.common.ui.massactions/src/org/polarsys/capella/common/ui/massactions/activator/MACapellaActivator.java +++ b/common/plugins/org.polarsys.capella.common.ui.massactions/src/org/polarsys/capella/common/ui/massactions/activator/MACapellaActivator.java @@ -31,9 +31,6 @@ */ public class MACapellaActivator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.ui.massactions"; //$NON-NLS-1$ - public static final String ME_VIEW_ID = "org.polarsys.capella.common.ui.massactions.editing.view"; public static final String MV_VIEW_ID = "org.polarsys.capella.common.ui.massactions.visualizing.view"; diff --git a/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/META-INF/MANIFEST.MF index 29e6ac4d63..161f9d5f99 100644 --- a/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/META-INF/MANIFEST.MF @@ -11,5 +11,4 @@ Export-Package: org.polarsys.capella.common.ui.menu.dynamic, org.polarsys.capella.common.ui.menu.dynamic.utils Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.common.ui.menu.dynamic.DynamicMenuActivator Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/src/org/polarsys/capella/common/ui/menu/dynamic/DynamicMenuActivator.java b/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/src/org/polarsys/capella/common/ui/menu/dynamic/DynamicMenuActivator.java deleted file mode 100644 index af107d67a8..0000000000 --- a/common/plugins/org.polarsys.capella.common.ui.menu.dynamic/src/org/polarsys/capella/common/ui/menu/dynamic/DynamicMenuActivator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.ui.menu.dynamic; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - */ -public class DynamicMenuActivator extends AbstractUIActivator { - /** - * The shared instance - */ - private static DynamicMenuActivator plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static DynamicMenuActivator getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/META-INF/MANIFEST.MF index 8af19d7c3e..c443e1bf8e 100644 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.ui.toolkit.browser;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.transaction, @@ -12,9 +11,10 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.common.ui.services, org.polarsys.capella.common.ui.toolkit, org.polarsys.kitalpha.emde.ui, - org.apache.commons.lang -Export-Package: org.polarsys.capella.common.ui.toolkit.browser, - org.polarsys.capella.common.ui.toolkit.browser.action, + org.apache.commons.lang, + org.eclipse.osgi, + org.polarsys.capella.common +Export-Package: org.polarsys.capella.common.ui.toolkit.browser.action, org.polarsys.capella.common.ui.toolkit.browser.category, org.polarsys.capella.common.ui.toolkit.browser.content.provider, org.polarsys.capella.common.ui.toolkit.browser.content.provider.factory, diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/BrowserActivator.java b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/BrowserActivator.java deleted file mode 100644 index 69079e74ab..0000000000 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/BrowserActivator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.ui.toolkit.browser; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class BrowserActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.common.ui.toolkit.browser"; //$NON-NLS-1$ - - // The shared instance - private static BrowserActivator plugin; - - /** - * The constructor - */ - public BrowserActivator() { - // do nothing - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static BrowserActivator getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/category/CategoryRegistry.java b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/category/CategoryRegistry.java index f826cd3367..9ed79e33f6 100644 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/category/CategoryRegistry.java +++ b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/category/CategoryRegistry.java @@ -24,8 +24,8 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.misc.ExtensionClassDescriptor; -import org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator; import org.polarsys.capella.common.ui.toolkit.browser.content.provider.IBrowserContentProvider; /** @@ -204,7 +204,7 @@ private void initRegistry() { availableForTypeClassDescriptors = new HashSet<>(); IConfigurationElement[] categories = org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper - .getConfigurationElements(BrowserActivator.PLUGIN_ID, CONTENT_PROVIDER_CATEGORY); + .getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CONTENT_PROVIDER_CATEGORY); for (IConfigurationElement categoryConfigurationElement : categories) { // Create simple instance of category diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/factory/AbstractContentProviderFactory.java b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/factory/AbstractContentProviderFactory.java index 43700429db..4204d1a665 100644 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/factory/AbstractContentProviderFactory.java +++ b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/factory/AbstractContentProviderFactory.java @@ -13,10 +13,10 @@ package org.polarsys.capella.common.ui.toolkit.browser.content.provider.factory; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.ui.toolkit.browser.model.ISemanticBrowserModel; /** @@ -42,7 +42,8 @@ public abstract class AbstractContentProviderFactory { */ public static AbstractContentProviderFactory getInstance() { if (null == _instance) { - IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(BrowserActivator.PLUGIN_ID, CONTENT_PROVIDER_FACTORY); + IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(AbstractContentProviderFactory.class).getSymbolicName(), + CONTENT_PROVIDER_FACTORY); for (IConfigurationElement configurationElement : configurationElements) { AbstractContentProviderFactory contentProvider = (AbstractContentProviderFactory) ExtensionPointHelper.createInstance(configurationElement, ExtensionPointHelper.ATT_CLASS); diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/impl/AbstractContentProvider.java b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/impl/AbstractContentProvider.java index c10b53e80f..4edd2c84b6 100644 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/impl/AbstractContentProvider.java +++ b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/content/provider/impl/AbstractContentProvider.java @@ -17,8 +17,7 @@ import java.util.HashSet; import java.util.Set; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; @@ -27,8 +26,9 @@ import org.eclipse.emf.transaction.ResourceSetChangeEvent; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.jface.viewers.Viewer; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.services.helper.ViewerHelper; -import org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator; import org.polarsys.capella.common.ui.toolkit.browser.category.CategoryRegistry; import org.polarsys.capella.common.ui.toolkit.browser.category.ICategory; import org.polarsys.capella.common.ui.toolkit.browser.content.provider.IBrowserContentProvider; @@ -165,9 +165,9 @@ public Object[] getChildren(Object parentElement) { result = getChildren(new EObjectWrapper((EObject) parentElement)); } } catch (Exception exception) { - BrowserActivator.getDefault().getLog().log(new Status(IStatus.ERROR, BrowserActivator.PLUGIN_ID, - "Error while getting children for " + parentElement, exception)); //$NON-NLS-1$ - result = new Object[0]; + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Error while getting children for " + parentElement, exception); //$NON-NLS-1$ + result = new Object[0]; } return result; } diff --git a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/label/provider/factory/AbstractLabelProviderFactory.java b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/label/provider/factory/AbstractLabelProviderFactory.java index d097fc8b33..2b57b552f4 100644 --- a/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/label/provider/factory/AbstractLabelProviderFactory.java +++ b/common/plugins/org.polarsys.capella.common.ui.toolkit.browser/src/org/polarsys/capella/common/ui/toolkit/browser/label/provider/factory/AbstractLabelProviderFactory.java @@ -14,8 +14,8 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.jface.viewers.ILabelProvider; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator; /** */ @@ -41,7 +41,7 @@ public abstract class AbstractLabelProviderFactory { */ public static AbstractLabelProviderFactory getInstance() { if (null == _instance) { - IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(BrowserActivator.PLUGIN_ID, LABEL_PROVIDER_FACTORY); + IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(AbstractLabelProviderFactory.class).getSymbolicName(), LABEL_PROVIDER_FACTORY); for (IConfigurationElement configurationElement : configurationElements) { AbstractLabelProviderFactory labelProvider = (AbstractLabelProviderFactory) ExtensionPointHelper.createInstance(configurationElement, ExtensionPointHelper.ATT_CLASS); diff --git a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/MdeCommonUiActivator.java b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/MdeCommonUiActivator.java index 58c0ce5646..fb4a32fbb5 100644 --- a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/MdeCommonUiActivator.java +++ b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/MdeCommonUiActivator.java @@ -19,8 +19,6 @@ */ public class MdeCommonUiActivator extends AbstractUIActivator { - public static final String PLUGIN_ID = "org.polarsys.capella.common.ui"; - /** * Singleton instance. */ diff --git a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/StatusManagerExceptionHandler.java b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/StatusManagerExceptionHandler.java index d7e5afae95..5e524df226 100644 --- a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/StatusManagerExceptionHandler.java +++ b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/StatusManagerExceptionHandler.java @@ -20,6 +20,7 @@ import org.eclipse.emf.transaction.RollbackException; import org.eclipse.emf.transaction.TransactionalCommandStack; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; /** * A transaction exception handler that forwards exceptions @@ -56,7 +57,7 @@ public void handleException(Exception e) { * Creates the fallback status to use if extractStatus could not find a a status for the exception. */ protected IStatus createStatus(Exception e) { - return new Status(IStatus.ERROR, MdeCommonUiActivator.PLUGIN_ID, e.getLocalizedMessage(), e); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getLocalizedMessage(), e); } /** @@ -79,7 +80,7 @@ protected IStatus extractStatus(Exception e) { } else if (e instanceof CoreException){ CoreException ce = (CoreException) e; IStatus exceptionStatus = ce.getStatus(); - return new Status(exceptionStatus.getSeverity(), MdeCommonUiActivator.PLUGIN_ID, ce.getLocalizedMessage(), ce); + return new Status(exceptionStatus.getSeverity(), FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ce.getLocalizedMessage(), ce); } return null; } diff --git a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/providers/MDEAdapterFactoryLabelProvider.java b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/providers/MDEAdapterFactoryLabelProvider.java index 58c97fbd1e..ad6f62f694 100644 --- a/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/providers/MDEAdapterFactoryLabelProvider.java +++ b/common/plugins/org.polarsys.capella.common.ui/src/org/polarsys/capella/common/ui/providers/MDEAdapterFactoryLabelProvider.java @@ -17,8 +17,8 @@ import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; import org.eclipse.sirius.common.tools.api.query.IllegalStateExceptionQuery; import org.eclipse.swt.graphics.Image; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.common.ui.MdeCommonUiActivator; import org.polarsys.capella.core.model.handler.provider.CapellaAdapterFactoryProvider; public class MDEAdapterFactoryLabelProvider extends AdapterFactoryLabelProvider { @@ -87,7 +87,7 @@ protected ILabelProviderDelegation getDelegatedLabelProvider() { if (!__alreadyLookup && (null == __delegatedLabelProvider)) { // Load ITabbedPropertiesLabelProviderDelegation contributor if any. IConfigurationElement[] configurationElements = - ExtensionPointHelper.getConfigurationElements(MdeCommonUiActivator.getDefault().getPluginId(), "labelProviderDelegation"); //$NON-NLS-1$ + ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "labelProviderDelegation"); //$NON-NLS-1$ // Loop over contributed ITabbedPropertiesLabelProviderDelegation contributor, must be only one. if (configurationElements.length > 0) { __delegatedLabelProvider = diff --git a/common/plugins/org.polarsys.capella.common/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.common/META-INF/MANIFEST.MF index 4f02a23119..ec52167860 100644 --- a/common/plugins/org.polarsys.capella.common/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.common/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.MdeCommonActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime;visibility:=reexport, org.polarsys.capella.common.mdsofa.common;visibility:=reexport, @@ -13,12 +12,11 @@ Require-Bundle: org.eclipse.core.runtime;visibility:=reexport, com.google.guava, org.eclipse.emf.ecore.xmi, org.eclipse.jface, - org.eclipse.emf.edit.ui + org.eclipse.emf.edit.ui, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.common, - org.polarsys.capella.common.activator, - org.polarsys.capella.common.application, +Export-Package: org.polarsys.capella.common.application, org.polarsys.capella.common.helpers, org.polarsys.capella.common.helpers.argumentparser, org.polarsys.capella.common.helpers.export, diff --git a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/MdeCommonActivator.java b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/MdeCommonActivator.java deleted file mode 100644 index 3e78b3e9d2..0000000000 --- a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/MdeCommonActivator.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.activator.AbstractCommonActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class MdeCommonActivator extends AbstractCommonActivator { - // The shared instance - private static MdeCommonActivator plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static MdeCommonActivator getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/activator/AbstractCommonActivator.java b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/activator/AbstractCommonActivator.java deleted file mode 100644 index 64c45d6740..0000000000 --- a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/activator/AbstractCommonActivator.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ - -package org.polarsys.capella.common.activator; - -import org.eclipse.core.runtime.Status; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - */ -public abstract class AbstractCommonActivator extends AbstractActivator { - /** - * Log a message in the Eclipse log file. - * @param severity one of IStatus.OK, IStatus.ERROR, IStatus.INFO, IStatus.WARNING, or - * IStatus.CANCEL - * @param message a human-readable message, localized to the current locale - * @param exception a low-level exception, or null if not applicable - */ - public void log(int severity, String message, Throwable exception) { - getLog().log(new Status(severity, getPluginId(), message, exception)); - } -} diff --git a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/FileHelper2.java b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/FileHelper2.java index dd07e77584..5868dcb167 100644 --- a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/FileHelper2.java +++ b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/FileHelper2.java @@ -19,9 +19,10 @@ import java.nio.ByteBuffer; import java.nio.channels.FileChannel; -import org.eclipse.core.runtime.IStatus; - -import org.polarsys.capella.common.MdeCommonActivator; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; /** @@ -82,9 +83,10 @@ public static File writeContentInTemporaryFile(String fileName, String fileExten */ public static void writeFile(File file, byte[] content) { // Preconditions. - if ((null == file) || (null == content)) { - MdeCommonActivator.getDefault().log(IStatus.ERROR, "Error while writing file", new IllegalArgumentException()); //$NON-NLS-1$ - return; + if ((null == file) || (null == content)) { + Bundle bundle = FrameworkUtil.getBundle(FileHelper2.class); + Platform.getLog(bundle).error("Error while writing file", new IllegalArgumentException()); //$NON-NLS-1$ + return; } FileChannel channel = null; // Try and open the resulting file. @@ -92,15 +94,17 @@ public static void writeFile(File file, byte[] content) { channel = fileOutputStream.getChannel(); // Write contents. channel.write(ByteBuffer.wrap(content)); - } catch (Exception exception) { - MdeCommonActivator.getDefault().log(IStatus.ERROR, "Error while writing file", exception); //$NON-NLS-1$ + } catch (Exception exception) { + Bundle bundle = FrameworkUtil.getBundle(FileHelper2.class); + Platform.getLog(bundle).error("Error while writing file", exception); //$NON-NLS-1$ } finally { if ((null != channel) && channel.isOpen()) { try { // Close the channel. channel.close(); - } catch (IOException exception) { - MdeCommonActivator.getDefault().log(IStatus.ERROR, "Error while closing file channel", exception); //$NON-NLS-1$ + } catch (IOException exception) { + Bundle bundle = FrameworkUtil.getBundle(FileHelper2.class); + Platform.getLog(bundle).error("Error while closing file channel", exception); //$NON-NLS-1$ } } } diff --git a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/export/DataExporter.java b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/export/DataExporter.java index 43537c74d7..6d209888f8 100644 --- a/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/export/DataExporter.java +++ b/common/plugins/org.polarsys.capella.common/src/org/polarsys/capella/common/helpers/export/DataExporter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. + * Copyright (c) 2006, 2022 THALES GLOBAL SERVICES. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,15 +13,15 @@ package org.polarsys.capella.common.helpers.export; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; -import org.eclipse.core.runtime.Status; -import org.polarsys.capella.common.MdeCommonActivator; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.ICommonConstants2; import org.polarsys.capella.common.helpers.export.utils.CSVWriterMessages; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; @@ -84,22 +84,18 @@ public boolean exportToFile(String fileName, Object data) { try { stream = new FileOutputStream(file); exporter.export(stream, data); - } catch (FileNotFoundException exception) { - MdeCommonActivator.getDefault().getLog() - .log(new Status(Status.ERROR, MdeCommonActivator.getDefault().getPluginId(), "Error", exception)); - result = false; } catch (IOException exception) { - MdeCommonActivator.getDefault().getLog() - .log(new Status(Status.ERROR, MdeCommonActivator.getDefault().getPluginId(), "Error", exception)); - result = false; + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Error", exception); + result = false; } finally { try { if (stream != null) { stream.close(); } } catch (IOException exception) { - MdeCommonActivator.getDefault().getLog() - .log(new Status(Status.ERROR, MdeCommonActivator.getDefault().getPluginId(), "Error", exception)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Error", exception); } } } else { diff --git a/common/plugins/org.polarsys.capella.shared.id.handler/META-INF/MANIFEST.MF b/common/plugins/org.polarsys.capella.shared.id.handler/META-INF/MANIFEST.MF index ab9754bc9e..c89f90be45 100644 --- a/common/plugins/org.polarsys.capella.shared.id.handler/META-INF/MANIFEST.MF +++ b/common/plugins/org.polarsys.capella.shared.id.handler/META-INF/MANIFEST.MF @@ -8,8 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi, - org.polarsys.capella.common.mdsofa.common;visibility:=reexport + org.polarsys.capella.common.mdsofa.common;visibility:=reexport, + org.eclipse.osgi Export-Package: org.polarsys.capella.shared.id.handler Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.shared.id.handler.IdHandlerPlugin Bundle-Localization: plugin diff --git a/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdHandlerPlugin.java b/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdHandlerPlugin.java deleted file mode 100644 index d8e30ce97d..0000000000 --- a/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdHandlerPlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.shared.id.handler; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class IdHandlerPlugin extends AbstractActivator { - // The shared instance - private static IdHandlerPlugin plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static IdHandlerPlugin getDefault() { - return plugin; - } -} diff --git a/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdManager.java b/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdManager.java index 6d2913c6fd..d112b38034 100644 --- a/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdManager.java +++ b/common/plugins/org.polarsys.capella.shared.id.handler/src/org/polarsys/capella/shared/id/handler/IdManager.java @@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.emf.ecore.EObject; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; /** @@ -78,7 +78,7 @@ public String getId(EObject object) { private List getContributedIdHandlers() { if (null == __contributedIdHandlers) { __contributedIdHandlers = new ArrayList(); - IConfigurationElement[] element = ExtensionPointHelper.getConfigurationElements(IdHandlerPlugin.getDefault().getPluginId(), "IdHandler"); //$NON-NLS-1$ + IConfigurationElement[] element = ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "IdHandler"); //$NON-NLS-1$ for (IConfigurationElement ce : element) { IIdHandler extension = (IIdHandler) ExtensionPointHelper.createInstance(ce, "handler"); //$NON-NLS-1$ if (extension != null) { diff --git a/core/plugins/org.polarsys.capella.common.ui.resources/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.common.ui.resources/META-INF/MANIFEST.MF index 71804733e2..29eaa47757 100644 --- a/core/plugins/org.polarsys.capella.common.ui.resources/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.common.ui.resources/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.common.ui.resources;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.common.ui.resources.ResourcePlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime;visibility:=reexport, org.eclipse.ui;visibility:=reexport, @@ -13,7 +12,6 @@ Require-Bundle: org.eclipse.core.runtime;visibility:=reexport, org.polarsys.capella.core.model.preferences;visibility:=reexport, org.polarsys.capella.core.preferences Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.common.ui.resources, - org.polarsys.capella.common.ui.resources.prefs +Export-Package: org.polarsys.capella.common.ui.resources.prefs Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.common.ui.resources/src/org/polarsys/capella/common/ui/resources/ResourcePlugin.java b/core/plugins/org.polarsys.capella.common.ui.resources/src/org/polarsys/capella/common/ui/resources/ResourcePlugin.java deleted file mode 100644 index efec80615e..0000000000 --- a/core/plugins/org.polarsys.capella.common.ui.resources/src/org/polarsys/capella/common/ui/resources/ResourcePlugin.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.ui.resources; - -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle. the Capella elements icons could be retrieved with calling the {@link ImageRegistry#get(String)} with the - * required Capella element literal. - * @see CapellaPackage - */ -public class ResourcePlugin extends AbstractUIPlugin { - /** The plug-in identifier */ - public static final String PLUGIN_ID = "org.polarsys.capella.common.ui.resources"; //$NON-NLS-1$ - - // The shared instance - private static ResourcePlugin plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - ResourcePlugin.plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - ResourcePlugin.plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static ResourcePlugin getDefault() { - if (null == plugin) { - plugin = new ResourcePlugin(); - } - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.af.integration/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.af.integration/META-INF/MANIFEST.MF index ec91723e03..c638127021 100644 --- a/core/plugins/org.polarsys.capella.core.af.integration/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.af.integration/META-INF/MANIFEST.MF @@ -5,11 +5,11 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.polarsys.capella.core.af.integration;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.af.integration.AFIntegrationPlugin Require-Bundle: org.polarsys.capella.core.model.handler, org.polarsys.kitalpha.ad.metadata;visibility:=reexport, org.polarsys.kitalpha.ad.viewpoint;visibility:=reexport, - org.eclipse.gmf.runtime.emf.core + org.eclipse.gmf.runtime.emf.core, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.polarsys.capella.core.af.integration, org.polarsys.capella.core.af.integration.listener, diff --git a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/AFIntegrationPlugin.java b/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/AFIntegrationPlugin.java deleted file mode 100644 index 728a570dcc..0000000000 --- a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/AFIntegrationPlugin.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.af.integration; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * Plugin activator - */ -@SuppressWarnings({"findbugs:ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD","squid:S2696"}) -public class AFIntegrationPlugin extends Plugin { - - // The shared instance - private static AFIntegrationPlugin plugin; - - // The identifier of the Capella "virtual" viewpoint - public static final String CAPELLA_VIEWPOINT_ID = "org.polarsys.capella.core.viewpoint"; - - /** - * The constructor - */ - public AFIntegrationPlugin() { - } - - /** - * {@inheritDoc} - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static AFIntegrationPlugin getDefault() { - return plugin; - } - - public static String getSymbolicName() { - return plugin.getBundle().getSymbolicName(); - } -} diff --git a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaContribution.java b/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaContribution.java index 935bb940c8..6f33236d70 100644 --- a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaContribution.java +++ b/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaContribution.java @@ -32,9 +32,9 @@ public class CapellaContribution extends Contribution { @Override public void update(ResourceSet context) { if (hasCapellaSemanticResource(context)) { - referenceViewpoint(context, AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID); + referenceViewpoint(context, CapellaMetadataProvider.CAPELLA_VIEWPOINT_ID); } else { - unreferenceViewpoint(context, AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID); + unreferenceViewpoint(context, CapellaMetadataProvider.CAPELLA_VIEWPOINT_ID); } } diff --git a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaMetadataProvider.java b/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaMetadataProvider.java index 9899714dae..6c9b3c01da 100644 --- a/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaMetadataProvider.java +++ b/core/plugins/org.polarsys.capella.core.af.integration/src/org/polarsys/capella/core/af/integration/CapellaMetadataProvider.java @@ -29,6 +29,7 @@ import org.eclipse.gmf.runtime.emf.core.resources.GMFResource; import org.eclipse.osgi.util.NLS; import org.eclipse.sirius.business.api.session.Session; +import org.osgi.framework.FrameworkUtil; import org.osgi.framework.Version; import org.polarsys.capella.common.bundle.FeatureHelper; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; @@ -46,6 +47,9 @@ */ public class CapellaMetadataProvider implements IMetadataProvider { + // The identifier of the Capella "virtual" viewpoint + public static final String CAPELLA_VIEWPOINT_ID = "org.polarsys.capella.core.viewpoint"; + /** * Return the platform current version, based on the Capella Viewpoint. If performance are here, we shall use it as * the main way to retrieve capella version @@ -54,7 +58,7 @@ public static Version getCurrentVersion() { // We try to load the capella viewpoint first. try { Version version = ViewpointManager - .readVersion(ViewpointManager.getViewpoint(AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID)); + .readVersion(ViewpointManager.getViewpoint(CAPELLA_VIEWPOINT_ID)); return version; } catch (Exception e) { @@ -118,7 +122,7 @@ public IStatus checkMetadata(IFile file) { // If there is no afm file, we raise an error if (!afm.exists()) { - return new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind(Messages.NoMetadataException_Message, EcoreUtil2.getURI(file).toPlatformString(true))); } @@ -131,7 +135,7 @@ public IStatus checkMetadata(IFile file) { return checkMetadata(uri, set); } catch (Exception e) { - return new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), e.getMessage()); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage()); } finally { for (Resource r : set.getResources()) { @@ -150,14 +154,14 @@ public IStatus checkMetadata(URI sessionResourceURI, ResourceSet set) { // If there is no afm file but the current check is about a capella project, we must raise an exception because // the afm file is missing. if (CapellaResourceHelper.isCapellaProject(sessionResourceURI)) { - return new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind(Messages.NoMetadataException_Message, MetadataHelper.getViewpointMetadata(set).getExpectedMetadataStorageURI().toPlatformString(true))); } } else { // If there is an afm file, first we check if the capella viewpoint is present in the platform org.polarsys.kitalpha.resourcereuse.model.Resource vp = ViewpointManager - .getViewpoint(AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID); + .getViewpoint(CAPELLA_VIEWPOINT_ID); if (vp != null) { // then, if the afm file has this capella viewpoint Version fileVersion = MetadataHelper.getViewpointMetadata(set).getVersion(vp); @@ -190,14 +194,14 @@ private IStatus isMigrationRequired(Version fileVersion, Version currentVersion) // if not the same major/minor we requires a migration if (!(fileVersion.getMajor() == currentVersion.getMajor() && fileVersion.getMinor() == currentVersion.getMinor())) { - return new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.WrongCapellaVersionException_Message); } // if model from 1.4.0 towards 1.3.x, we requires a migration if (fileVersion.getMajor() == 1 && fileVersion.getMinor() == 3 && fileVersion.getMicro() == 0) { if (currentVersion.getMajor() == 1 && currentVersion.getMinor() == 3 && currentVersion.getMicro() > 0) { - return new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind(Messages.WrongCapellaVersionException_DetailedMessage, fileVersion)); } } diff --git a/core/plugins/org.polarsys.capella.core.application/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.application/META-INF/MANIFEST.MF index d3c0eff16a..54ef87194b 100644 --- a/core/plugins/org.polarsys.capella.core.application/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.application/META-INF/MANIFEST.MF @@ -3,12 +3,10 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.application;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.application.Activator Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.common.mdsofa.common Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.application, - org.polarsys.capella.core.application.appstart +Export-Package: org.polarsys.capella.core.application.appstart Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.application/src/org/polarsys/capella/core/application/Activator.java b/core/plugins/org.polarsys.capella.core.application/src/org/polarsys/capella/core/application/Activator.java deleted file mode 100644 index 3fd1f36748..0000000000 --- a/core/plugins/org.polarsys.capella.core.application/src/org/polarsys/capella/core/application/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.application; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.application"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.commandline.core/src/org/polarsys/capella/core/commandline/core/DefaultCommandLine.java b/core/plugins/org.polarsys.capella.core.commandline.core/src/org/polarsys/capella/core/commandline/core/DefaultCommandLine.java index 9f9851baae..a5e17c94d3 100644 --- a/core/plugins/org.polarsys.capella.core.commandline.core/src/org/polarsys/capella/core/commandline/core/DefaultCommandLine.java +++ b/core/plugins/org.polarsys.capella.core.commandline.core/src/org/polarsys/capella/core/commandline/core/DefaultCommandLine.java @@ -49,6 +49,7 @@ import org.eclipse.equinox.app.IApplicationContext; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.commandline.doc.CommandLineDoc; import org.polarsys.capella.common.tools.report.config.registry.ReportManagerRegistry; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; @@ -233,7 +234,7 @@ protected void printHelp(List hiddenArguments) { } protected void printArgumentsFromTable(String tableId, boolean printTitle, List hiddenArguments) { - Bundle bundle = FrameworkUtil.getBundle(org.polarsys.capella.commandline.doc.Activator.class); + Bundle bundle = FrameworkUtil.getBundle(CommandLineDoc.class); URL fileURL = bundle.getEntry("html/19. Command Line Support/19.1. Core Mechanism and Applications.html"); try { URL resolvedUrl = FileLocator.toFileURL(fileURL); diff --git a/core/plugins/org.polarsys.capella.core.compare/src/org/polarsys/capella/core/compare/CapellaComparePlugin.java b/core/plugins/org.polarsys.capella.core.compare/src/org/polarsys/capella/core/compare/CapellaComparePlugin.java index 69cb3a7ca1..92bbdcd494 100644 --- a/core/plugins/org.polarsys.capella.core.compare/src/org/polarsys/capella/core/compare/CapellaComparePlugin.java +++ b/core/plugins/org.polarsys.capella.core.compare/src/org/polarsys/capella/core/compare/CapellaComparePlugin.java @@ -38,9 +38,6 @@ @SuppressWarnings("restriction") public class CapellaComparePlugin extends AbstractUIPlugin { - /** The plug-in ID */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.compare"; //$NON-NLS-1$ - /** The shared instance */ private static CapellaComparePlugin plugin; diff --git a/core/plugins/org.polarsys.capella.core.data.business.queries/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.business.queries/META-INF/MANIFEST.MF index 010f207929..e86283e7a5 100644 --- a/core/plugins/org.polarsys.capella.core.data.business.queries/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.business.queries/META-INF/MANIFEST.MF @@ -13,7 +13,8 @@ Require-Bundle: org.polarsys.capella.core.model.helpers;visibility:=reexport, org.polarsys.capella.common, org.polarsys.capella.common.libraries, org.polarsys.capella.core.libraries, - org.polarsys.capella.common.libraries.gen + org.polarsys.capella.common.libraries.gen, + org.eclipse.osgi Bundle-ActivationPolicy: lazy Export-Package: org.polarsys.capella.core.business.abstractqueries, org.polarsys.capella.core.business.abstractqueries.helpers, @@ -43,5 +44,4 @@ Export-Package: org.polarsys.capella.core.business.abstractqueries, org.polarsys.capella.core.business.queries.queries.oa, org.polarsys.capella.core.business.queries.queries.pa Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.core.business.queries.BusinessQueriesPlugin Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/BusinessQueriesPlugin.java b/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/BusinessQueriesPlugin.java deleted file mode 100644 index c0d0038672..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/BusinessQueriesPlugin.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.business.queries; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * This is the activator of the business queries plug-in - */ -public class BusinessQueriesPlugin extends Plugin { - - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.business.queries"; //$NON-NLS-1$ - - /** - * Single instance of the class - */ - private static BusinessQueriesPlugin __instance; - - /** - * Returns the single instance of the class - * @return a BusinessQueriesPlugin instance - */ - public static BusinessQueriesPlugin getDefault() { - return __instance; - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __instance = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - __instance = null; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/capellacore/BusinessQueriesProvider.java b/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/capellacore/BusinessQueriesProvider.java index 8a2575e082..1f0a742637 100644 --- a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/capellacore/BusinessQueriesProvider.java +++ b/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/capellacore/BusinessQueriesProvider.java @@ -23,26 +23,21 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.ILog; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.osgi.util.NLS; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.core.business.queries.BusinessQueriesPlugin; import org.polarsys.capella.core.business.queries.IBusinessQuery; - public class BusinessQueriesProvider { private static BusinessQueriesProvider _instance = null; public static final String BUSINESS_QUERIES_EXTENSION_ID = "MDEBusinessQueries"; //$NON-NLS-1$ - /** - * @deprecated Use {@link BusinessQueriesPlugin#PLUGIN_ID} instead - */ - @Deprecated - public static final String BUSINESS_QUERIES_PLUGIN_ID = BusinessQueriesPlugin.PLUGIN_ID; - private List _businessQueriesCache = null; private Map, IBusinessQuery> businessQueriesMap; @@ -56,7 +51,7 @@ public List getAllContributions() { if (null == _businessQueriesCache) { _businessQueriesCache = new ArrayList(); List BQProvider = - Arrays.asList(ExtensionPointHelper.getConfigurationElements(BusinessQueriesPlugin.PLUGIN_ID, BUSINESS_QUERIES_EXTENSION_ID)); + Arrays.asList(ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), BUSINESS_QUERIES_EXTENSION_ID)); for (IConfigurationElement configurationElement : BQProvider) { IBusinessQuery contrib = (IBusinessQuery) ExtensionPointHelper.createInstance(configurationElement, ExtensionPointHelper.ATT_CLASS); if (contrib != null) { @@ -90,8 +85,9 @@ public Map, IBusinessQuery> getAllContri businessQueriesMap.put(key, query); } else { // keep the existing key and log error. - ILog log = BusinessQueriesPlugin.getDefault().getLog(); - log.log(new Status(IStatus.WARNING, BusinessQueriesPlugin.PLUGIN_ID, + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + ILog log = Platform.getLog(bundle); + log.log(new Status(IStatus.WARNING, bundle.getSymbolicName(), NLS.bind(Messages.BusinessQueriesProvider_duplicateQueryContributionKey, new Object[] { key.getKey(), key.getValue(), query.getClass().getName(), dup.getClass().getName() }))); } diff --git a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/queries/pa/GetAvailable_PhysicalComponent_DeployedComponents.java b/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/queries/pa/GetAvailable_PhysicalComponent_DeployedComponents.java index c581771b77..5589585f4a 100644 --- a/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/queries/pa/GetAvailable_PhysicalComponent_DeployedComponents.java +++ b/core/plugins/org.polarsys.capella.core.data.business.queries/src/org/polarsys/capella/core/business/queries/queries/pa/GetAvailable_PhysicalComponent_DeployedComponents.java @@ -25,7 +25,7 @@ import org.polarsys.capella.core.data.pa.PhysicalComponentNature; import org.polarsys.capella.core.data.pa.deployment.TypeDeploymentLink; import org.polarsys.capella.core.model.helpers.SystemEngineeringExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; public class GetAvailable_PhysicalComponent_DeployedComponents extends AbstractQuery { @@ -57,7 +57,7 @@ public List getAvailableElements(CapellaElement element) { } public boolean isMultipleDeploymentAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMultipleDeploymentAllowed(); + return PreferencesHelper.isMultipleDeploymentAllowed(); } /** diff --git a/core/plugins/org.polarsys.capella.core.data.common.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.common.properties/META-INF/MANIFEST.MF index 062544ef2c..1649dea101 100644 --- a/core/plugins/org.polarsys.capella.core.data.common.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.common.properties/META-INF/MANIFEST.MF @@ -3,12 +3,13 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.common.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.common.properties.CommonPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport, org.polarsys.capella.common.linkedtext.ui, org.polarsys.capella.core.linkedtext.ui, - org.polarsys.capella.common.ui + org.polarsys.capella.common.ui, + org.eclipse.osgi, + org.eclipse.ui.workbench Bundle-ActivationPolicy: lazy Export-Package: org.polarsys.capella.core.data.common.properties, org.polarsys.capella.core.data.common.properties.controllers, diff --git a/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/CommonPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/CommonPropertiesPlugin.java deleted file mode 100644 index 3fa2506716..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/CommonPropertiesPlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.common.properties; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class CommonPropertiesPlugin extends AbstractUIActivator { - // The shared instance - private static CommonPropertiesPlugin plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static CommonPropertiesPlugin getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/fields/StateTransitionTriggerField.java b/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/fields/StateTransitionTriggerField.java index cab9b55f58..ce402edbd8 100644 --- a/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/fields/StateTransitionTriggerField.java +++ b/core/plugins/org.polarsys.capella.core.data.common.properties/src/org/polarsys/capella/core/data/common/properties/fields/StateTransitionTriggerField.java @@ -23,7 +23,9 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.ui.providers.MDEAdapterFactoryLabelProvider; @@ -36,7 +38,6 @@ import org.polarsys.capella.core.data.capellacommon.StateTransition; import org.polarsys.capella.core.data.capellacommon.TimeEvent; import org.polarsys.capella.core.data.capellacore.Constraint; -import org.polarsys.capella.core.data.common.properties.CommonPropertiesPlugin; import org.polarsys.capella.core.data.common.properties.IImageKeys; import org.polarsys.capella.core.linkedtext.ui.CapellaEmbeddedLinkedTextEditorInput; import org.polarsys.capella.core.model.helpers.BlockArchitectureExt; @@ -111,20 +112,22 @@ protected static String getCustomText(Object object, int columnIndex) { @Override @SuppressWarnings("synthetic-access") protected void createCustomActions(Composite parent) { - - _timeEventBtn = createTableButton(parent, CommonPropertiesPlugin.getDefault().getImage(IImageKeys.TIME_EVENT_IMG_16), new Runnable() { - @Override - public void run() { - handleStateEventButtonClick(CapellacommonPackage.Literals.TIME_EVENT); - } + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ + _timeEventBtn = createTableButton(parent, AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + IImageKeys.TIME_EVENT_IMG_16).createImage(), + new Runnable() { + @Override + public void run() { + handleStateEventButtonClick(CapellacommonPackage.Literals.TIME_EVENT); + } }); _timeEventBtn.setToolTipText("Create a Time Event"); - _changeEventBtn = createTableButton(parent, CommonPropertiesPlugin.getDefault().getImage(IImageKeys.CHANGE_EVENT_IMG_16), new Runnable() { - @Override - public void run() { - handleStateEventButtonClick(CapellacommonPackage.Literals.CHANGE_EVENT); - } + _changeEventBtn = createTableButton(parent, AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + IImageKeys.CHANGE_EVENT_IMG_16).createImage(), + new Runnable() { + @Override + public void run() { + handleStateEventButtonClick(CapellacommonPackage.Literals.CHANGE_EVENT); + } }); _changeEventBtn.setToolTipText("Create a Change Event"); diff --git a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Hierarchy.java b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Hierarchy.java index c5e57762d6..aa45d07d12 100644 --- a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Hierarchy.java +++ b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Hierarchy.java @@ -27,7 +27,7 @@ import org.polarsys.capella.core.data.capellacommon.Pseudostate; import org.polarsys.capella.core.data.capellacommon.Region; import org.polarsys.capella.core.data.capellacommon.State; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import com.google.common.base.Predicate; import com.google.common.collect.Collections2; @@ -37,7 +37,7 @@ public MDCHK_State_Mode_Hierarchy() { } public boolean isMixedHierarchyAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed(); + return PreferencesHelper.isMixedModeStateAllowed(); } @Override diff --git a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Reuse.java b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Reuse.java index 10e8d532eb..c2e921ec6e 100644 --- a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Reuse.java +++ b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Reuse.java @@ -21,7 +21,7 @@ import org.polarsys.capella.core.data.capellacommon.Mode; import org.polarsys.capella.core.data.capellacommon.Pseudostate; import org.polarsys.capella.core.data.capellacommon.State; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.sirius.analysis.StateMachineServices; public class MDCHK_State_Mode_Reuse extends AbstractModelConstraint { @@ -31,7 +31,7 @@ public MDCHK_State_Mode_Reuse() { } public boolean isMixedHierarchyAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed(); + return PreferencesHelper.isMixedModeStateAllowed(); } @Override diff --git a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Siblings.java b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Siblings.java index ba0de5b1a9..ceccb3c912 100644 --- a/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Siblings.java +++ b/core/plugins/org.polarsys.capella.core.data.common.validation/src/org/polarsys/capella/core/data/common/validation/statetransition/MDCHK_State_Mode_Siblings.java @@ -24,7 +24,7 @@ import org.polarsys.capella.core.data.capellacommon.Mode; import org.polarsys.capella.core.data.capellacommon.Region; import org.polarsys.capella.core.data.capellacommon.StateMachine; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /* * DWF_SM_16: Mode and State can not be mixed in the same State Machine @@ -32,7 +32,7 @@ public class MDCHK_State_Mode_Siblings extends AbstractModelConstraint { public boolean isMixedHierarchyAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed(); + return PreferencesHelper.isMixedModeStateAllowed(); } @Override diff --git a/core/plugins/org.polarsys.capella.core.data.core.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.core.properties/META-INF/MANIFEST.MF index 4fc127942a..92a2e18cc2 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.core.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.core.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.core.properties.CorePropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.ui.properties;visibility:=reexport, org.polarsys.capella.core.linkedtext.ui, diff --git a/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/CorePropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/CorePropertiesPlugin.java deleted file mode 100644 index fdd1eac84b..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/CorePropertiesPlugin.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.core.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CorePropertiesPlugin extends AbstractUIPlugin { - // The shared instance - private static CorePropertiesPlugin plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static CorePropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/sections/GeneralizableElementSection.java b/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/sections/GeneralizableElementSection.java index 0f8479e183..ff27f4a1bf 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/sections/GeneralizableElementSection.java +++ b/core/plugins/org.polarsys.capella.core.data.core.properties/src/org/polarsys/capella/core/data/core/properties/sections/GeneralizableElementSection.java @@ -24,7 +24,7 @@ import org.polarsys.capella.core.data.core.properties.Messages; import org.polarsys.capella.core.data.core.properties.controllers.GeneralizableElementController; import org.polarsys.capella.core.data.core.properties.fields.GeneralizableElementBooleanPropertiesCheckbox; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.ui.properties.fields.AbstractSemanticField; import org.polarsys.capella.core.ui.properties.fields.CompositionMultipleSemanticField; import org.polarsys.capella.core.ui.toolkit.helpers.SelectionDialogHelper; @@ -79,7 +79,7 @@ public void createContents(Composite parent, TabbedPropertySheetPage aTabbedProp */ @Override protected List openTransferDialog(Button button, List currentElements, List availableElements, String title, String message) { - if (CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed()) { + if (PreferencesHelper.isMultipleInheritanceAllowed()) { return super.openTransferDialog(button, currentElements, availableElements, title, message); } EObject firstResult = SelectionDialogHelper.simplePropertySelectionDialogWizard(availableElements, button.getShell()); diff --git a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/META-INF/MANIFEST.MF index 4ff4cc5de0..4e2d66353c 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.core.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.core.ui.quickfix.CoreQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.resources, org.eclipse.core.runtime, @@ -19,10 +18,10 @@ Require-Bundle: org.eclipse.core.resources, org.polarsys.capella.core.libraries.ui, org.polarsys.capella.core.data.common.validation, org.polarsys.capella.core.sirius.analysis, - org.polarsys.capella.core.ui.resources + org.polarsys.capella.core.ui.resources, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.core.ui.quickfix, - org.polarsys.capella.core.data.core.ui.quickfix.messages, +Export-Package: org.polarsys.capella.core.data.core.ui.quickfix.messages, org.polarsys.capella.core.data.core.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/CoreQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/CoreQuickFixActivator.java deleted file mode 100644 index 6808866962..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/CoreQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.core.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class CoreQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static CoreQuickFixActivator plugin; - - /** - * The constructor - */ - public CoreQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static CoreQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/messages/CoreQuickFixMessages.java b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/messages/CoreQuickFixMessages.java index cd6cf34e79..64fa83e010 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/messages/CoreQuickFixMessages.java +++ b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/messages/CoreQuickFixMessages.java @@ -13,13 +13,13 @@ package org.polarsys.capella.core.data.core.ui.quickfix.messages; import org.eclipse.osgi.util.NLS; -import org.polarsys.capella.core.data.core.ui.quickfix.CoreQuickFixActivator; +import org.osgi.framework.FrameworkUtil; /** * I18n support for this plugin */ public class CoreQuickFixMessages extends NLS { - private static final String BUNDLE_NAME = CoreQuickFixActivator.getDefault().getPluginId() + ".messages.messages"; //$NON-NLS-1$ + private static final String BUNDLE_NAME = FrameworkUtil.getBundle(CoreQuickFixMessages.class).getSymbolicName() + ".messages.messages"; //$NON-NLS-1$ public static String cycle_details_dialog_title; public static String cycle_details_dialog_message; diff --git a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/resolver/ConstraintLocationRule_Resolver.java b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/resolver/ConstraintLocationRule_Resolver.java index 53cb8d5691..f7f6199fea 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/resolver/ConstraintLocationRule_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.core.ui.quickfix/src/org/polarsys/capella/core/data/core/ui/quickfix/resolver/ConstraintLocationRule_Resolver.java @@ -19,6 +19,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; @@ -27,7 +28,6 @@ import org.polarsys.capella.core.data.cs.Part; import org.polarsys.capella.core.data.pa.deployment.PartDeploymentLink; import org.polarsys.capella.core.sirius.analysis.CsServices; -import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class ConstraintLocationRule_Resolver extends AbstractCapellaMarkerResolution { @@ -35,7 +35,7 @@ public class ConstraintLocationRule_Resolver extends AbstractCapellaMarkerResolu public ConstraintLocationRule_Resolver (String label) { this.setLabel(label); - super.setContributorId(CapellaUIResourcesPlugin.PLUGIN_ID); + super.setContributorId(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); super.setImgKey(PROCESS_ICON); } diff --git a/core/plugins/org.polarsys.capella.core.data.core.validation/src/org/polarsys/capella/core/data/capellamodeller/validation/MDCHK_Class_Generalization_2.java b/core/plugins/org.polarsys.capella.core.data.core.validation/src/org/polarsys/capella/core/data/capellamodeller/validation/MDCHK_Class_Generalization_2.java index d0ea341f6f..2feaa40ddf 100644 --- a/core/plugins/org.polarsys.capella.core.data.core.validation/src/org/polarsys/capella/core/data/capellamodeller/validation/MDCHK_Class_Generalization_2.java +++ b/core/plugins/org.polarsys.capella.core.data.core.validation/src/org/polarsys/capella/core/data/capellamodeller/validation/MDCHK_Class_Generalization_2.java @@ -17,9 +17,8 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.EMFEventType; import org.eclipse.emf.validation.IValidationContext; - import org.polarsys.capella.core.data.capellacore.GeneralizableElement; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.validation.rule.AbstractValidationRule; /** @@ -37,7 +36,7 @@ public IStatus validate(IValidationContext ctx) { if (eObj instanceof GeneralizableElement) { GeneralizableElement clz = (GeneralizableElement) eObj; EList superClasses = clz.getSuper(); - if (!CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed()) { + if (!PreferencesHelper.isMultipleInheritanceAllowed()) { if (superClasses.size() > 1) { return createFailureStatus(ctx, new Object[] { clz.getName(),clz.eClass().getName() }); } diff --git a/core/plugins/org.polarsys.capella.core.data.cs.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.cs.properties/META-INF/MANIFEST.MF index 3ab124498c..d531b13f7b 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.cs.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.cs.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.cs.properties.CsPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.information.communication.properties;visibility:=reexport, org.polarsys.capella.core.data.fa.properties;visibility:=reexport, diff --git a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/CsPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/CsPropertiesPlugin.java deleted file mode 100644 index e921c4b899..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/CsPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.cs.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CsPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.cs.properties"; //$NON-NLS-1$ - - // The shared instance - private static CsPropertiesPlugin plugin; - - /** - * The constructor - */ - public CsPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CsPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalLinkAllocatedComponentExchangesController.java b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalLinkAllocatedComponentExchangesController.java index b219a30add..2f3c9f3895 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalLinkAllocatedComponentExchangesController.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalLinkAllocatedComponentExchangesController.java @@ -18,7 +18,8 @@ import org.polarsys.capella.core.data.fa.ComponentExchange; import org.polarsys.capella.core.data.fa.properties.controllers.AllocatedComponentExchangesController; import org.polarsys.capella.core.model.helpers.PhysicalLinkExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.helpers.delete.DeleteHelper; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** */ @@ -31,7 +32,7 @@ public class PhysicalLinkAllocatedComponentExchangesController extends Allocated protected void doAddOperationInWriteOpenValues(EObject semanticElement, EStructuralFeature semanticFeature, EObject object) { super.doAddOperationInWriteOpenValues(semanticElement, semanticFeature, object); - if (CapellaModelPreferencesPlugin.getDefault().isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed() + if (PreferencesHelper.isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed() && (semanticElement instanceof PhysicalLink) && (object instanceof ComponentExchange)) { PhysicalLinkExt.synchronizeAllocations((PhysicalLink) semanticElement, (ComponentExchange) object); } diff --git a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalPathAllocatedComponentExchangesController.java b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalPathAllocatedComponentExchangesController.java index f7ac8055d2..55461ecb3b 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalPathAllocatedComponentExchangesController.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/controllers/PhysicalPathAllocatedComponentExchangesController.java @@ -18,7 +18,8 @@ import org.polarsys.capella.core.data.fa.ComponentExchange; import org.polarsys.capella.core.data.fa.properties.controllers.AllocatedComponentExchangesController; import org.polarsys.capella.core.model.helpers.PhysicalPathExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.helpers.delete.DeleteHelper; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** */ @@ -31,7 +32,7 @@ public class PhysicalPathAllocatedComponentExchangesController extends Allocated protected void doAddOperationInWriteOpenValues(EObject semanticElement, EStructuralFeature semanticFeature, EObject object) { super.doAddOperationInWriteOpenValues(semanticElement, semanticFeature, object); - if (CapellaModelPreferencesPlugin.getDefault().isSynchronizationOfPhysicalPortToComponentPortOnPhysicalPathAllowed() + if (PreferencesHelper.isSynchronizationOfPhysicalPortToComponentPortOnPhysicalPathAllowed() && (semanticElement instanceof PhysicalPath) && (object instanceof ComponentExchange)) { PhysicalPathExt.synchronizeAllocations((PhysicalPath) semanticElement, (ComponentExchange) object); } diff --git a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/sections/ComponentSection.java b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/sections/ComponentSection.java index d5ed0f13b4..a8b51c38cf 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/sections/ComponentSection.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.properties/src/org/polarsys/capella/core/data/cs/properties/sections/ComponentSection.java @@ -32,7 +32,7 @@ import org.polarsys.capella.core.data.oa.OperationalAnalysis; import org.polarsys.capella.core.model.helpers.BlockArchitectureExt; import org.polarsys.capella.core.model.helpers.ComponentExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.ui.properties.fields.AbstractSemanticField; import org.polarsys.capella.core.ui.properties.fields.MultipleSemanticField; @@ -131,7 +131,7 @@ public void loadData(EObject capellaElement) { // if capellaElement is a component but not an actor, disable super if (null != superTypes) { superTypes.setEnabled( - component.isActor() || CapellaModelPreferencesPlugin.getDefault().isComponentNonActorInheritanceAllowed()); + component.isActor() || PreferencesHelper.isComponentNonActorInheritanceAllowed()); } // if the capellaElement is a component but not an actor, the IsAbstract checkbox must be disabled diff --git a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/META-INF/MANIFEST.MF index 214e5a37f4..e0fe0382c2 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.cs.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.cs.ui.quickfix.CsQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.resources, org.eclipse.core.runtime, @@ -19,12 +18,12 @@ Require-Bundle: org.eclipse.core.resources, org.polarsys.capella.core.ui.properties, org.polarsys.capella.core.data.core.properties, org.polarsys.capella.core.tiger, - org.polarsys.capella.core.platform.sirius.ui.actions + org.polarsys.capella.core.platform.sirius.ui.actions, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.cs.ui.quickfix, - org.polarsys.capella.core.data.cs.ui.quickfix.generator, +Export-Package: org.polarsys.capella.core.data.cs.ui.quickfix.generator, org.polarsys.capella.core.data.cs.ui.quickfix.messages, org.polarsys.capella.core.data.cs.ui.quickfix.resolver, org.polarsys.capella.core.data.cs.ui.quickfix.resolver.command diff --git a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/CsQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/CsQuickFixActivator.java deleted file mode 100644 index e2ef4d138d..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/CsQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.cs.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class CsQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static CsQuickFixActivator plugin; - - /** - * The constructor - */ - public CsQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static CsQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/messages/CsQuickFixMessages.java b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/messages/CsQuickFixMessages.java index b13c4bb8cc..5d117f3f07 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/messages/CsQuickFixMessages.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/messages/CsQuickFixMessages.java @@ -13,14 +13,13 @@ package org.polarsys.capella.core.data.cs.ui.quickfix.messages; import org.eclipse.osgi.util.NLS; - -import org.polarsys.capella.core.data.cs.ui.quickfix.CsQuickFixActivator; +import org.osgi.framework.FrameworkUtil; /** * I18n support for this plugin */ public class CsQuickFixMessages extends NLS { - private static final String BUNDLE_NAME = CsQuickFixActivator.getDefault().getPluginId() + ".messages.messages"; //$NON-NLS-1$ + private static final String BUNDLE_NAME = FrameworkUtil.getBundle(CsQuickFixMessages.class).getSymbolicName() + ".messages.messages"; //$NON-NLS-1$ static { // initialize resource bundle diff --git a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/DWF_DC_19_Resolver.java b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/DWF_DC_19_Resolver.java index 0f73e6bebc..be2ae9a9ac 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/DWF_DC_19_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/DWF_DC_19_Resolver.java @@ -21,11 +21,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.cs.PhysicalLink; import org.polarsys.capella.core.model.helpers.PhysicalLinkExt; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -70,8 +70,7 @@ public void run() { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator - .getDefault().getPluginId(), + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/SwitchHumanActorLabels_Resolver.java b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/SwitchHumanActorLabels_Resolver.java index 71ad61d894..a778ed9325 100644 --- a/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/SwitchHumanActorLabels_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.cs.ui.quickfix/src/org/polarsys/capella/core/data/cs/ui/quickfix/resolver/SwitchHumanActorLabels_Resolver.java @@ -17,13 +17,16 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.ef.command.ICommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.cs.Component; -import org.polarsys.capella.core.data.cs.ui.quickfix.CsQuickFixActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -49,7 +52,8 @@ public void run() { try { marker.delete(); } catch (CoreException e) { - CsQuickFixActivator.getDefault().log(IStatus.ERROR, "Error while deleting marker", e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).log(new Status(IStatus.ERROR, this.getClass(), "Error while deleting marker", e)); } } }; @@ -57,6 +61,6 @@ public void run() { } } - protected abstract void switchLabel(Component component); + protected abstract void switchLabel(Component component); } diff --git a/core/plugins/org.polarsys.capella.core.data.ctx.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.ctx.properties/META-INF/MANIFEST.MF index ca6cf96ea5..846aeeecf8 100644 --- a/core/plugins/org.polarsys.capella.core.data.ctx.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.ctx.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.ctx.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.ctx.properties.CtxPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.fa.properties;visibility:=reexport, org.polarsys.capella.core.data.interaction.properties;visibility:=reexport, diff --git a/core/plugins/org.polarsys.capella.core.data.ctx.properties/src/org/polarsys/capella/core/data/ctx/properties/CtxPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.ctx.properties/src/org/polarsys/capella/core/data/ctx/properties/CtxPropertiesPlugin.java deleted file mode 100644 index 98e7a4746a..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.ctx.properties/src/org/polarsys/capella/core/data/ctx/properties/CtxPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.ctx.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CtxPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.ctx.properties"; //$NON-NLS-1$ - - // The shared instance - private static CtxPropertiesPlugin plugin; - - /** - * The constructor - */ - public CtxPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CtxPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/META-INF/MANIFEST.MF index 802d392cf2..841afeb533 100644 --- a/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.ctx.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.ctx.ui.quickfix.CtxQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.validation.ui.ide, org.polarsys.capella.core.model.helpers, @@ -20,5 +19,4 @@ Require-Bundle: org.polarsys.capella.core.validation.ui.ide, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.ctx.ui.quickfix, - org.polarsys.capella.core.data.ctx.ui.quickfix.resolver +Export-Package: org.polarsys.capella.core.data.ctx.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/src/org/polarsys/capella/core/data/ctx/ui/quickfix/CtxQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/src/org/polarsys/capella/core/data/ctx/ui/quickfix/CtxQuickFixActivator.java deleted file mode 100644 index a6f1ccc3ec..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.ctx.ui.quickfix/src/org/polarsys/capella/core/data/ctx/ui/quickfix/CtxQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.ctx.ui.quickfix; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class CtxQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static CtxQuickFixActivator plugin; - - /** - * The constructor - */ - public CtxQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CtxQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.epbs.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.epbs.properties/META-INF/MANIFEST.MF index df0e566f90..fc2b1dea07 100644 --- a/core/plugins/org.polarsys.capella.core.data.epbs.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.epbs.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.epbs.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.epbs.properties.EPBSPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.cs.properties;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/core/plugins/org.polarsys.capella.core.data.epbs.properties/src/org/polarsys/capella/core/data/epbs/properties/EPBSPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.epbs.properties/src/org/polarsys/capella/core/data/epbs/properties/EPBSPropertiesPlugin.java deleted file mode 100644 index 8aa08c8a69..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.epbs.properties/src/org/polarsys/capella/core/data/epbs/properties/EPBSPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.epbs.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class EPBSPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.epbs.properties"; //$NON-NLS-1$ - - // The shared instance - private static EPBSPropertiesPlugin plugin; - - /** - * The constructor - */ - public EPBSPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static EPBSPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/META-INF/MANIFEST.MF index c73e2c0aa2..cb1f9b264a 100644 --- a/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.epbs.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.epbs.ui.quickfix.EpbsQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.validation.ui.ide, org.polarsys.capella.core.model.helpers, @@ -19,5 +18,4 @@ Require-Bundle: org.polarsys.capella.core.validation.ui.ide, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.epbs.ui.quickfix, - org.polarsys.capella.core.data.epbs.ui.quickfix.resolver +Export-Package: org.polarsys.capella.core.data.epbs.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/src/org/polarsys/capella/core/data/epbs/ui/quickfix/EpbsQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/src/org/polarsys/capella/core/data/epbs/ui/quickfix/EpbsQuickFixActivator.java deleted file mode 100644 index 046b64a77e..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.epbs.ui.quickfix/src/org/polarsys/capella/core/data/epbs/ui/quickfix/EpbsQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.epbs.ui.quickfix; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class EpbsQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static EpbsQuickFixActivator plugin; - - /** - * The constructor - */ - public EpbsQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static EpbsQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.fa.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.fa.properties/META-INF/MANIFEST.MF index be5cd97037..c76dc3867e 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.fa.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.fa.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.fa.properties.FaPropertiesPlugin Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/FaPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/FaPropertiesPlugin.java deleted file mode 100644 index 94a896cc01..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/FaPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.fa.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class FaPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.fa.properties"; //$NON-NLS-1$ - - // The shared instance - private static FaPropertiesPlugin plugin; - - /** - * The constructor - */ - public FaPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static FaPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/controllers/ComponentExchange_AllocatedFunctionalExchangesController.java b/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/controllers/ComponentExchange_AllocatedFunctionalExchangesController.java index 1158bc8810..08890614bb 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/controllers/ComponentExchange_AllocatedFunctionalExchangesController.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.properties/src/org/polarsys/capella/core/data/fa/properties/controllers/ComponentExchange_AllocatedFunctionalExchangesController.java @@ -27,7 +27,8 @@ import org.polarsys.capella.core.data.fa.FaPackage; import org.polarsys.capella.core.data.fa.FunctionalExchange; import org.polarsys.capella.core.model.helpers.ComponentExchangeExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.helpers.delete.DeleteHelper; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.ui.properties.controllers.AbstractMultipleSemanticFieldController; /** @@ -72,7 +73,7 @@ protected void doAddOperationInWriteOpenValues(EObject semanticElement, EStructu link.setTargetElement((TraceableElement) object); ((List) semanticElement.eGet(semanticFeature)).add(link); - if (CapellaModelPreferencesPlugin.getDefault().isSynchronizationOfComponentPortToFunctionPortAllowed() && (semanticElement instanceof ComponentExchange) + if (PreferencesHelper.isSynchronizationOfComponentPortToFunctionPortAllowed() && (semanticElement instanceof ComponentExchange) && (object instanceof FunctionalExchange)) { ComponentExchangeExt.synchronizePortAllocations((ComponentExchange) semanticElement, (FunctionalExchange) object); } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/META-INF/MANIFEST.MF index d73750c52f..fe63f110f6 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.fa.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.fa.ui.quickfix.FaQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.resources, org.eclipse.core.runtime, @@ -22,12 +21,12 @@ Require-Bundle: org.eclipse.core.resources, org.eclipse.amalgam.explorer.activity.ui, org.eclipse.pde.core, org.polarsys.capella.common.libraries.gen, - org.polarsys.capella.core.libraries + org.polarsys.capella.core.libraries, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Export-Package: org.polarsys.capella.core.data.fa.ui.quicfix.helpers, - org.polarsys.capella.core.data.fa.ui.quickfix, org.polarsys.capella.core.data.fa.ui.quickfix.generator, org.polarsys.capella.core.data.fa.ui.quickfix.resolver, org.polarsys.capella.core.data.fa.ui.quickfix.resolver.command diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/FaQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/FaQuickFixActivator.java deleted file mode 100644 index 056db99512..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/FaQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.fa.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class FaQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static FaQuickFixActivator plugin; - - /** - * The constructor - */ - public FaQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static FaQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/ActionResolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/ActionResolver.java index 18b159fd9b..188cc6ba77 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/ActionResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/ActionResolver.java @@ -26,9 +26,8 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.statushandlers.StatusManager; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.actions.AbstractTigAction; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -57,8 +56,7 @@ public void run(IMarker marker) { marker.delete(); } catch (CoreException e) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault() - .getPluginId(), e.getMessage(), e)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage(), e)); } } } @@ -88,8 +86,7 @@ public void run(IMarker[] markers, IProgressMonitor monitor) { marker.delete(); } catch (CoreException e) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator - .getDefault().getPluginId(), + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage(), e)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DCOM_21_RemoveUnusedExchangeItemsResolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DCOM_21_RemoveUnusedExchangeItemsResolver.java index 068cfd69b6..7a7a6f9429 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DCOM_21_RemoveUnusedExchangeItemsResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DCOM_21_RemoveUnusedExchangeItemsResolver.java @@ -19,15 +19,17 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.fa.FunctionInputPort; import org.polarsys.capella.core.data.fa.FunctionOutputPort; import org.polarsys.capella.core.data.fa.FunctionPort; -import org.polarsys.capella.core.data.fa.ui.quickfix.FaQuickFixActivator; import org.polarsys.capella.core.data.fa.validation.functionPort.DCOM_21_UnusedExchangeItems; import org.polarsys.capella.core.data.information.ExchangeItem; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; @@ -58,10 +60,11 @@ protected void doExecute() { }; domain.getCommandStack().execute(removeCommand); try { - marker.delete(); + marker.delete(); } catch (CoreException e) { - IStatus s = new Status(e.getStatus().getSeverity(), FaQuickFixActivator.getDefault().getPluginId(), e.getStatus().getMessage(), e); - FaQuickFixActivator.getDefault().getLog().log(s); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + IStatus s = new Status(e.getStatus().getSeverity(), bundle.getSymbolicName(), e.getStatus().getMessage(), e); + Platform.getLog(bundle).log(s); } } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_14_Resolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_14_Resolver.java index dcdafcf13a..0ad26f0b25 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_14_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_14_Resolver.java @@ -8,11 +8,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.fa.FunctionalChainInvolvementLink; import org.polarsys.capella.core.model.helpers.FunctionalChainExt; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class DWF_DF_14_Resolver extends AbstractCapellaMarkerResolution { @@ -45,7 +45,7 @@ public void run() { try { marker.delete(); } catch (CoreException exception) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + StatusManager.getManager().handle(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_16_Resolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_16_Resolver.java index 40fe65c2be..fd7aecda35 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_16_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_16_Resolver.java @@ -20,11 +20,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.fa.SequenceLink; import org.polarsys.capella.core.sirius.analysis.CapellaServices; import org.polarsys.capella.core.ui.properties.CapellaUIPropertiesPlugin; import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -36,7 +36,7 @@ public class DWF_DF_16_Resolver extends AbstractCapellaMarkerResolution { public DWF_DF_16_Resolver(String label) { this.overridenLabel = label; - super.setContributorId(CapellaUIResourcesPlugin.PLUGIN_ID); + super.setContributorId(FrameworkUtil.getBundle(CapellaUIResourcesPlugin.class).getSymbolicName()); super.setImgKey(PROCESS_ICON); } @@ -70,7 +70,7 @@ protected void deleteMarker(IMarker marker) { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_18_Resolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_18_Resolver.java index ad2cdb099f..b9196be271 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_18_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/DWF_DF_18_Resolver.java @@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.fa.FaPackage; @@ -31,7 +32,6 @@ import org.polarsys.capella.core.model.utils.NamingHelper; import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; import org.polarsys.capella.core.ui.toolkit.helpers.SelectionDialogHelper; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -43,7 +43,7 @@ public class DWF_DF_18_Resolver extends AbstractCapellaMarkerResolution { public DWF_DF_18_Resolver(String label) { this.overridenLabel = label; - super.setContributorId(CapellaUIResourcesPlugin.PLUGIN_ID); + super.setContributorId(FrameworkUtil.getBundle(CapellaUIResourcesPlugin.class).getSymbolicName()); super.setImgKey(PROCESS_ICON); } @@ -98,7 +98,7 @@ protected void deleteMarker(IMarker marker) { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/GenerateInterfacesResolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/GenerateInterfacesResolver.java index baf1fa422f..4edcde207d 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/GenerateInterfacesResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/GenerateInterfacesResolver.java @@ -19,15 +19,17 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.model.IConstraintStatus; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.validation.ConstraintStatusDiagnostic; import org.polarsys.capella.core.data.cs.Interface; import org.polarsys.capella.core.data.fa.ComponentExchange; import org.polarsys.capella.core.data.fa.FunctionalExchange; -import org.polarsys.capella.core.data.fa.ui.quickfix.FaQuickFixActivator; import org.polarsys.capella.core.data.fa.ui.quickfix.generator.GenerateInterfacesResolutionGenerator; import org.polarsys.capella.core.data.information.ExchangeItem; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; @@ -85,8 +87,8 @@ public final void run(IMarker marker) { try { marker.delete(); } catch (CoreException e1) { - FaQuickFixActivator.getDefault().getLog() - .log(new Status(IStatus.ERROR, FaQuickFixActivator.getDefault().getBundle().getSymbolicName(), + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e1.getStatus().getMessage(), e1.getStatus().getException())); } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/NonLeafFunctionComponentAllocationRelsover.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/NonLeafFunctionComponentAllocationRelsover.java index 973ff146c1..48a62c492c 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/NonLeafFunctionComponentAllocationRelsover.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/NonLeafFunctionComponentAllocationRelsover.java @@ -23,6 +23,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.AbstractTrace; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; @@ -31,7 +32,6 @@ import org.polarsys.capella.core.data.fa.ComponentFunctionalAllocation; import org.polarsys.capella.core.data.oa.ActivityAllocation; import org.polarsys.capella.core.platform.sirius.ui.commands.CapellaDeleteCommand; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -139,7 +139,7 @@ public void run() { try { marker.delete(); } catch (CoreException exception) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + StatusManager.getManager().handle(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/RemoveSequenceLinksAssociationsResolver.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/RemoveSequenceLinksAssociationsResolver.java index 8e07fa594f..b2a0520089 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/RemoveSequenceLinksAssociationsResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.quickfix/src/org/polarsys/capella/core/data/fa/ui/quickfix/resolver/RemoveSequenceLinksAssociationsResolver.java @@ -19,16 +19,19 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewHelper; -import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; -import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; import org.polarsys.capella.core.data.fa.FunctionalChainInvolvementLink; import org.polarsys.capella.core.data.fa.SequenceLink; +import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; +import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class RemoveSequenceLinksAssociationsResolver extends AbstractCapellaMarkerResolution { private final String PROCESS_ICON = "icons/full/obj16/capella_process.gif"; @@ -43,7 +46,7 @@ public RemoveSequenceLinksAssociationsResolver(String label, SequenceLink sequen this.overridenLabel = label; this.multiMarkerQuickFix = multiMarkerQuickFix; this.ruleId = ruleId; - super.setContributorId(CapellaUIResourcesPlugin.PLUGIN_ID); + super.setContributorId(FrameworkUtil.getBundle(CapellaUIResourcesPlugin.class).getSymbolicName()); super.setImgKey(PROCESS_ICON); } @@ -86,7 +89,8 @@ protected void deleteMarker(IMarker marker) { try { marker.delete(); } catch (CoreException e) { - PluginActivator.getDefault().log(IStatus.ERROR, e.getLocalizedMessage(), e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).log(new Status(IStatus.ERROR, this.getClass(), e.getLocalizedMessage(), e)); } } } diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/META-INF/MANIFEST.MF index 4f2cd9b3a3..c1b29b2649 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.fa.ui.wizards;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.fa.ui.wizards.FAUIWizardsPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -21,6 +20,5 @@ Require-Bundle: org.eclipse.ui, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.fa.ui.wizards, - org.polarsys.capella.core.data.fa.ui.wizards.actions, +Export-Package: org.polarsys.capella.core.data.fa.ui.wizards.actions, org.polarsys.capella.core.data.fa.ui.wizards.dialogs diff --git a/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/src/org/polarsys/capella/core/data/fa/ui/wizards/FAUIWizardsPlugin.java b/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/src/org/polarsys/capella/core/data/fa/ui/wizards/FAUIWizardsPlugin.java deleted file mode 100644 index 9b8ec48dd0..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.fa.ui.wizards/src/org/polarsys/capella/core/data/fa/ui/wizards/FAUIWizardsPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.fa.ui.wizards; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class FAUIWizardsPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.fa.ui.wizards"; //$NON-NLS-1$ - - // The shared instance - private static FAUIWizardsPlugin plugin; - - /** - * The constructor - */ - public FAUIWizardsPlugin() { - // do nothing - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static FAUIWizardsPlugin getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.data.fa.validation/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.fa.validation/META-INF/MANIFEST.MF index 96d31d8e58..83c9a6007c 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.validation/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.fa.validation/META-INF/MANIFEST.MF @@ -9,8 +9,7 @@ Require-Bundle: org.polarsys.capella.core.validation, org.apache.commons.lang, org.polarsys.capella.core.sirius.analysis, org.polarsys.capella.core.transition.system.topdown -Export-Package: org.polarsys.capella.core.data.fa.validation, - org.polarsys.capella.core.data.fa.validation.componentPort, +Export-Package: org.polarsys.capella.core.data.fa.validation.componentPort, org.polarsys.capella.core.data.fa.validation.connection, org.polarsys.capella.core.data.fa.validation.function, org.polarsys.capella.core.data.fa.validation.functionPort, @@ -18,5 +17,4 @@ Export-Package: org.polarsys.capella.core.data.fa.validation, org.polarsys.capella.core.data.fa.validation.functionalChainInvolvement, org.polarsys.capella.core.data.fa.validation.functionalExchange Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.core.data.fa.validation.FaValidationActivator Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.data.information.communication.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.information.communication.properties/META-INF/MANIFEST.MF index f5b61442d8..c886603481 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.communication.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.information.communication.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.information.communication.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.information.communication.properties.CommunicationPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/core/plugins/org.polarsys.capella.core.data.information.communication.properties/src/org/polarsys/capella/core/data/information/communication/properties/CommunicationPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.information.communication.properties/src/org/polarsys/capella/core/data/information/communication/properties/CommunicationPropertiesPlugin.java deleted file mode 100644 index d8b2e3b0a3..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.information.communication.properties/src/org/polarsys/capella/core/data/information/communication/properties/CommunicationPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.information.communication.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CommunicationPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.information.communication.properties"; //$NON-NLS-1$ - - // The shared instance - private static CommunicationPropertiesPlugin plugin; - - /** - * The constructor - */ - public CommunicationPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CommunicationPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/META-INF/MANIFEST.MF index a76144c9f4..e8ef069253 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.information.datatype.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.information.datatype.properties.DataTypePropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.information.properties;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/src/org/polarsys/capella/core/data/information/datatype/properties/DataTypePropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/src/org/polarsys/capella/core/data/information/datatype/properties/DataTypePropertiesPlugin.java deleted file mode 100644 index 036ed7f816..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.information.datatype.properties/src/org/polarsys/capella/core/data/information/datatype/properties/DataTypePropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.information.datatype.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class DataTypePropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.information.datatype.properties"; //$NON-NLS-1$ - - // The shared instance - private static DataTypePropertiesPlugin plugin; - - /** - * The constructor - */ - public DataTypePropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static DataTypePropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/META-INF/MANIFEST.MF index e9cd50083f..873ad7d444 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.information.datavalue.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.information.datavalue.properties.DataValuePropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.information.properties;visibility:=reexport, org.eclipse.core.databinding.property, diff --git a/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/src/org/polarsys/capella/core/data/information/datavalue/properties/DataValuePropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/src/org/polarsys/capella/core/data/information/datavalue/properties/DataValuePropertiesPlugin.java deleted file mode 100644 index 5b4463cc3a..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.information.datavalue.properties/src/org/polarsys/capella/core/data/information/datavalue/properties/DataValuePropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.information.datavalue.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class DataValuePropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.information.datavalue.properties"; //$NON-NLS-1$ - - // The shared instance - private static DataValuePropertiesPlugin plugin; - - /** - * The constructor - */ - public DataValuePropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static DataValuePropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.information.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.information.properties/META-INF/MANIFEST.MF index 4a4841da82..a2f78af0b4 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.information.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.information.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.information.properties.InformationPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.common.properties;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/core/plugins/org.polarsys.capella.core.data.information.properties/src/org/polarsys/capella/core/data/information/properties/InformationPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.information.properties/src/org/polarsys/capella/core/data/information/properties/InformationPropertiesPlugin.java deleted file mode 100644 index f639e170a4..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.information.properties/src/org/polarsys/capella/core/data/information/properties/InformationPropertiesPlugin.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.information.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class InformationPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.information.properties"; //$NON-NLS-1$ - - // The shared instance - private static InformationPropertiesPlugin plugin; - - /** - * The constructor - */ - public InformationPropertiesPlugin() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static InformationPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/META-INF/MANIFEST.MF index c542929d7d..ed1001ca82 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.information.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.information.ui.quickfix.InformationQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -20,6 +19,5 @@ Require-Bundle: org.eclipse.ui, Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.polarsys.capella.core.data.information.ui.quickfix, - org.polarsys.capella.core.data.information.ui.quickfix.messages, +Export-Package: org.polarsys.capella.core.data.information.ui.quickfix.messages, org.polarsys.capella.core.data.information.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/InformationQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/InformationQuickFixActivator.java deleted file mode 100644 index d51e6ab711..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/InformationQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.information.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class InformationQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static InformationQuickFixActivator plugin; - - /** - * The constructor - */ - public InformationQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static InformationQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/messages/InformationQuickFixMessages.java b/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/messages/InformationQuickFixMessages.java index 74349668ad..ac838b4221 100644 --- a/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/messages/InformationQuickFixMessages.java +++ b/core/plugins/org.polarsys.capella.core.data.information.ui.quickfix/src/org/polarsys/capella/core/data/information/ui/quickfix/messages/InformationQuickFixMessages.java @@ -13,13 +13,13 @@ package org.polarsys.capella.core.data.information.ui.quickfix.messages; import org.eclipse.osgi.util.NLS; -import org.polarsys.capella.core.data.information.ui.quickfix.InformationQuickFixActivator; +import org.osgi.framework.FrameworkUtil; /** * I18n support for this plugin */ public class InformationQuickFixMessages extends NLS { - private static final String BUNDLE_NAME = InformationQuickFixActivator.getDefault().getPluginId() + ".messages.messages"; //$NON-NLS-1$ + private static final String BUNDLE_NAME = FrameworkUtil.getBundle(InformationQuickFixMessages.class).getSymbolicName() + ".messages.messages"; //$NON-NLS-1$ public static String cycle_details_dialog_title; public static String cycle_details_dialog_message; diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.interaction.properties/META-INF/MANIFEST.MF index 8b987bb515..c949c5d971 100644 --- a/core/plugins/org.polarsys.capella.core.data.interaction.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.interaction.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.interaction.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.interaction.properties.InteractionPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.information.properties;visibility:=reexport, com.google.guava;bundle-version="11.0.2" diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.properties/src/org/polarsys/capella/core/data/interaction/properties/InteractionPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.interaction.properties/src/org/polarsys/capella/core/data/interaction/properties/InteractionPropertiesPlugin.java deleted file mode 100644 index cb56be191f..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.interaction.properties/src/org/polarsys/capella/core/data/interaction/properties/InteractionPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.interaction.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class InteractionPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.interaction.properties"; //$NON-NLS-1$ - - // The shared instance - private static InteractionPropertiesPlugin plugin; - - /** - * The constructor - */ - public InteractionPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static InteractionPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/META-INF/MANIFEST.MF index 5bb5863d23..e058d3c17d 100644 --- a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.interaction.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.interaction.ui.quickfix.InteractionQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.common.ui, org.polarsys.capella.core.model.handler, @@ -16,6 +15,5 @@ Require-Bundle: org.polarsys.capella.common.ui, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.interaction.ui.quickfix, - org.polarsys.capella.core.data.interaction.ui.quickfix.generator, +Export-Package: org.polarsys.capella.core.data.interaction.ui.quickfix.generator, org.polarsys.capella.core.data.interaction.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/InteractionQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/InteractionQuickFixActivator.java deleted file mode 100644 index f6577ca3ab..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/InteractionQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.interaction.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class InteractionQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static InteractionQuickFixActivator plugin; - - /** - * The constructor - */ - public InteractionQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static InteractionQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/AddInvolvedElementsResolver.java b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/AddInvolvedElementsResolver.java index 691720ee97..acb62370cb 100644 --- a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/AddInvolvedElementsResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/AddInvolvedElementsResolver.java @@ -20,7 +20,11 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; @@ -31,7 +35,6 @@ import org.polarsys.capella.core.data.interaction.AbstractCapability; import org.polarsys.capella.core.model.helpers.AbstractCapabilityExt; import org.polarsys.capella.core.ui.resources.CapellaUIResourcesPlugin; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class AddInvolvedElementsResolver extends AbstractCapellaMarkerResolution { @@ -44,7 +47,7 @@ public AddInvolvedElementsResolver(String label, boolean multiMarkerQuickFix, St this.overridenLabel = label; this.multiMarkerQuickFix = multiMarkerQuickFix; this.ruleId = ruleId; - super.setContributorId(CapellaUIResourcesPlugin.PLUGIN_ID); + super.setContributorId(FrameworkUtil.getBundle(CapellaUIResourcesPlugin.class).getSymbolicName()); super.setImgKey(PROCESS_ICON); } @@ -105,7 +108,8 @@ protected void deleteMarker(IMarker marker) { try { marker.delete(); } catch (CoreException e) { - PluginActivator.getDefault().log(IStatus.ERROR, e.getLocalizedMessage(), e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).log(new Status(IStatus.ERROR, this.getClass(), e.getLocalizedMessage(), e)); } } } diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_08_Resolver.java b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_08_Resolver.java index e2103aaa78..39cf900e8e 100644 --- a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_08_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_08_Resolver.java @@ -21,11 +21,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.interaction.Scenario; import org.polarsys.capella.core.model.helpers.ScenarioExt; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -79,8 +79,7 @@ public void commandRolledBack() { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator - .getDefault().getPluginId(), exception + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception .getMessage(), exception)); } diff --git a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_09_Resolver.java b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_09_Resolver.java index e487373431..fec820e8da 100644 --- a/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_09_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.data.interaction.ui.quickfix/src/org/polarsys/capella/core/data/interaction/ui/quickfix/resolver/DWF_DS_09_Resolver.java @@ -8,11 +8,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.interaction.SequenceMessage; import org.polarsys.capella.core.model.helpers.SequenceMessageExt; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class DWF_DS_09_Resolver extends AbstractCapellaMarkerResolution { @@ -45,7 +45,7 @@ public void run() { try { marker.delete(); } catch (CoreException exception) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + StatusManager.getManager().handle(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.data.la.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.la.properties/META-INF/MANIFEST.MF index 8f30157a2a..79bbe3795f 100644 --- a/core/plugins/org.polarsys.capella.core.data.la.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.la.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.la.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.la.properties.LaPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.fa.properties;visibility:=reexport, org.polarsys.capella.core.data.interaction.properties;visibility:=reexport, diff --git a/core/plugins/org.polarsys.capella.core.data.la.properties/src/org/polarsys/capella/core/data/la/properties/LaPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.la.properties/src/org/polarsys/capella/core/data/la/properties/LaPropertiesPlugin.java deleted file mode 100644 index 8c3aa26a12..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.la.properties/src/org/polarsys/capella/core/data/la/properties/LaPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.la.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class LaPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.la.properties"; //$NON-NLS-1$ - - // The shared instance - private static LaPropertiesPlugin plugin; - - /** - * The constructor - */ - public LaPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static LaPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/META-INF/MANIFEST.MF index 4e54d08ea3..d53c7a7c9a 100644 --- a/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.la.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.la.ui.quickfix.LaQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.validation.ui.ide, org.polarsys.capella.core.model.helpers, diff --git a/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/src/org/polarsys/capella/core/data/la/ui/quickfix/LaQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/src/org/polarsys/capella/core/data/la/ui/quickfix/LaQuickFixActivator.java deleted file mode 100644 index 5e5c0e3622..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.la.ui.quickfix/src/org/polarsys/capella/core/data/la/ui/quickfix/LaQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.la.ui.quickfix; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class LaQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static LaQuickFixActivator plugin; - - /** - * The constructor - */ - public LaQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static LaQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.migration/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.migration/META-INF/MANIFEST.MF index 1abf249054..0bc5d47f0c 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.migration/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.migration;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.migration.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.expressions, @@ -33,7 +32,8 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.platform.sirius.clipboard, org.eclipse.emf.ecore, org.polarsys.capella.core.sirius.ui, - org.eclipse.sirius.ext.emf.edit + org.eclipse.sirius.ext.emf.edit, + org.eclipse.osgi Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/Activator.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/Activator.java deleted file mode 100644 index 95bba7bfad..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/Activator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.migration; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.migration"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJob.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJob.java index 3506b372d7..deb3895dae 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJob.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJob.java @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.migration.context.MigrationContext; /** @@ -27,7 +28,7 @@ */ public class MigrationJob extends WorkspaceJob { - public static final QualifiedName RESULT_PROPERTY = new QualifiedName(Activator.PLUGIN_ID, "result"); //$NON-NLS-1$ + public static final QualifiedName RESULT_PROPERTY = new QualifiedName(FrameworkUtil.getBundle(MigrationJob.class).getSymbolicName(), "result"); //$NON-NLS-1$ private boolean checkVersion; private MigrationContext context; @@ -60,7 +61,7 @@ public IStatus runInWorkspace(IProgressMonitor monitor) { try { // refresh output file. runnable.getFile().getProject().refreshLocal(IResource.DEPTH_INFINITE, SubMonitor.convert(monitor, 5)); } catch (CoreException exception) { - result = new Status(IStatus.ERROR, Activator.PLUGIN_ID, exception.getMessage(), exception); + result = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception); } } diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJobScheduler.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJobScheduler.java index 16f4ed95a9..4cd985a237 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJobScheduler.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationJobScheduler.java @@ -30,6 +30,7 @@ import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.common.tools.report.util.LogExt; import org.polarsys.capella.core.data.migration.context.MigrationContext; @@ -152,7 +153,7 @@ public void done(IJobChangeEvent event) { protected void logStatus(MigrationContext context, IStatus status) { if (status.isOK()) { - status = new Status(IStatus.INFO, Activator.PLUGIN_ID, NLS.bind(Messages.MigrationAction_MigrationOK, context.getName())); + status = new Status(IStatus.INFO, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind(Messages.MigrationAction_MigrationOK, context.getName())); } StatusManager.getManager().handle(status, StatusManager.LOG); diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationRunnable.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationRunnable.java index 9784cfbceb..57778eec5a 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationRunnable.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/MigrationRunnable.java @@ -36,6 +36,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.impl.InternalTransactionalCommandStack; import org.eclipse.osgi.util.NLS; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; @@ -301,7 +302,7 @@ protected IStatus performLoadResources(final IFile modelFileToMigrate, final Exe */ @Override public void commandRolledBack() { - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 1, getName(), null); + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), 1, getName(), null); } @Override @@ -356,7 +357,7 @@ protected IStatus performPostMigrationExecute(final ExecutionManager executionMa */ @Override public void commandRolledBack() { - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 1, getName(), null); + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), 1, getName(), null); } @Override @@ -368,7 +369,7 @@ public void run() { postMigrationExecute(executionManager, resourceSet, context); context.getProgressMonitor().worked(1); } catch (Exception exception) { - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 1, getName() + ": " + exception.getMessage(), //$NON-NLS-1$ + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), 1, getName() + ": " + exception.getMessage(), //$NON-NLS-1$ exception); } finally { context.getProgressMonitor().done(); @@ -428,7 +429,7 @@ public void run() { } } catch (Exception exception) { - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 1, getName() + ": " + exception.getMessage(), //$NON-NLS-1$ + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), 1, getName() + ": " + exception.getMessage(), //$NON-NLS-1$ exception); } finally { diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/af/ViewpointMigrationContribution.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/af/ViewpointMigrationContribution.java index 5a7ce662dd..bee99c3af5 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/af/ViewpointMigrationContribution.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/af/ViewpointMigrationContribution.java @@ -27,12 +27,11 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.sirius.business.api.resource.ResourceDescriptor; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.osgi.framework.FrameworkUtil; import org.osgi.framework.Version; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.helpers.EcoreUtil2; -import org.polarsys.capella.core.af.integration.AFIntegrationPlugin; import org.polarsys.capella.core.af.integration.CapellaMetadataProvider; -import org.polarsys.capella.core.data.migration.Activator; import org.polarsys.capella.core.data.migration.capella.Messages; import org.polarsys.capella.core.data.migration.context.MigrationContext; import org.polarsys.capella.core.data.migration.contribution.AbstractMigrationContribution; @@ -100,7 +99,7 @@ private IStatus checkLegacy(IFile fileToMigrate, MigrationContext context, boole private IStatus checkAFM(IResource fileToMigrate, MigrationContext context, boolean checkVersion) { - MultiStatus status = new MultiStatus(AFIntegrationPlugin.getSymbolicName(), IStatus.OK, + MultiStatus status = new MultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.OK, "Some viewpoints are missing", null); try { @@ -109,7 +108,7 @@ private IStatus checkAFM(IResource fileToMigrate, MigrationContext context, bool Map viewpointUsages = CapellaMetadataProvider.getViewpointsUsage((IFile) fileToMigrate); // We load the AFM file and check if there is an incompatibility with Capella version - Version fileVersion = viewpointUsages.get(AFIntegrationPlugin.CAPELLA_VIEWPOINT_ID); + Version fileVersion = viewpointUsages.get(CapellaMetadataProvider.CAPELLA_VIEWPOINT_ID); context.setFileVersion((IFile) fileToMigrate, fileVersion); if (checkVersion) { @@ -123,7 +122,7 @@ private IStatus checkAFM(IResource fileToMigrate, MigrationContext context, bool // We check for additional missing viewpoints for (String id : viewpointUsages.keySet()) { if (ViewpointManager.getViewpoint(id) == null) { - status.add(new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), + status.add(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "The viewpoint '" + id + "' is missing")); } } @@ -132,7 +131,7 @@ private IStatus checkAFM(IResource fileToMigrate, MigrationContext context, bool } } catch (Exception e) { e.printStackTrace(); - status.add(new Status(IStatus.ERROR, AFIntegrationPlugin.getSymbolicName(), e.getMessage())); + status.add(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage())); return status; } @@ -148,13 +147,13 @@ private IStatus isMigrationPossible(Version fileVersion, Version currentVersion, if (Version.emptyVersion.equals(fileVersion)) { String formattedMessage = NLS.bind(Messages.MigrationAction_ErrorDialog_CorruptedMessage, new String[] { context.getResourceName() }); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, formattedMessage); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), formattedMessage); } if (!isMigrationPossible(fileVersion, currentVersion)) { String formattedMessage = NLS.bind(Messages.MigrationAction_ErrorDialog_TooOldMessage, new String[] { context.getResourceName(), currentVersion.toString() }); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, formattedMessage); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), formattedMessage); } return Status.OK_STATUS; diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/aird/SiriusMigrationContribution.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/aird/SiriusMigrationContribution.java index 984d4e9de1..f4a566f0c3 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/aird/SiriusMigrationContribution.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/aird/SiriusMigrationContribution.java @@ -25,8 +25,8 @@ import org.eclipse.emf.ecore.xmi.XMLHelper; import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.sirius.business.internal.migration.RepresentationsFileMigrationService; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; -import org.polarsys.capella.core.data.migration.Activator; import org.polarsys.capella.core.data.migration.context.MigrationContext; import org.polarsys.capella.core.data.migration.contribution.AbstractMigrationContribution; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; @@ -167,7 +167,7 @@ public IStatus handleError(XMIException e, Resource resource, MigrationContext c // lower the unresolvedReferenceException to a lower priority. it's the repair-aird that will fix these issues. if (e instanceof UnresolvedReferenceException) { - return new Status(IStatus.WARNING, Activator.PLUGIN_ID, e.getMessage()); + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage()); } return null; diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/DAnnotationDescriptorContribution.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/DAnnotationDescriptorContribution.java index 8d38990aa4..78594fa49f 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/DAnnotationDescriptorContribution.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/DAnnotationDescriptorContribution.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; import org.eclipse.sirius.viewpoint.description.DAnnotation; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.tools.report.config.registry.ReportManagerRegistry; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; @@ -33,7 +34,6 @@ import org.polarsys.capella.core.data.capellacore.CapellaElement; import org.polarsys.capella.core.data.capellacore.CapellacorePackage; import org.polarsys.capella.core.data.capellacore.EnumerationPropertyLiteral; -import org.polarsys.capella.core.data.migration.Activator; import org.polarsys.capella.core.data.migration.context.MigrationContext; import org.polarsys.capella.core.diagram.helpers.DAnnotationHelper; import org.polarsys.capella.core.diagram.helpers.IRepresentationAnnotationConstants; @@ -108,7 +108,7 @@ public void postMigrationExecute(ExecutionManager executionManager, ResourceSet } if (i > 0) { Logger logger = ReportManagerRegistry.getInstance().subscribe(IReportManagerDefaultComponents.DEFAULT); - IStatus status = new Status(IStatus.INFO, Activator.PLUGIN_ID, + IStatus status = new Status(IStatus.INFO, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind(org.polarsys.capella.core.data.migration.contribution.Messages.MigrationAction_AnnotationMigration, context.getName(), i)); LogExt.log(logger, status); @@ -183,7 +183,7 @@ private int migrate(DRepresentation diagram, DRepresentationDescriptor descripto } else { Logger logger = ReportManagerRegistry.getInstance().subscribe(IReportManagerDefaultComponents.DEFAULT); - IStatus status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, NLS.bind( + IStatus status = new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind( org.polarsys.capella.core.data.migration.contribution.Messages.MigrationAction_MissingStatusMigration, descriptor.getName(), statusValue)); LogExt.log(logger, status); @@ -211,7 +211,7 @@ private int migrate(DRepresentation diagram, DRepresentationDescriptor descripto } else { Logger logger = ReportManagerRegistry.getInstance().subscribe(IReportManagerDefaultComponents.DEFAULT); - IStatus status = new Status(IStatus.WARNING, Activator.PLUGIN_ID, NLS.bind( + IStatus status = new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind( org.polarsys.capella.core.data.migration.contribution.Messages.MigrationAction_MissingContextualElementMigration, descriptor.getName(), id)); LogExt.log(logger, status); diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/ImagePathInRichTextAttributeContribution.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/ImagePathInRichTextAttributeContribution.java index cf6f85c4c1..8de2812949 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/ImagePathInRichTextAttributeContribution.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/ImagePathInRichTextAttributeContribution.java @@ -35,6 +35,7 @@ import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.util.TreeIterator; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EObject; @@ -45,9 +46,10 @@ import org.eclipse.sirius.business.api.image.ImageManager; import org.eclipse.sirius.business.api.image.RichTextAttributeRegistry; import org.eclipse.sirius.ext.emf.edit.EditingDomainServices; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.helpers.EcoreUtil2; -import org.polarsys.capella.core.data.migration.Activator; import org.polarsys.capella.core.data.migration.context.MigrationContext; /** @@ -96,7 +98,8 @@ public void postMigrationExecute(ExecutionManager executionManager, ResourceSet } } } else { - Activator.getDefault().getLog().error(MessageFormat.format( + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(MessageFormat.format( Messages.MigrationAction_Image_ImpossibleToFindProject, resourceToMigrate.getURI().toPlatformString(true))); } } @@ -194,17 +197,17 @@ private Map createFiles(EObject notifier, EAttribute attribute, Str Map createdFiles = createFiles(imageFolder, filesToCreate, notifier, attribute); // Log what have been done + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (!createdFiles.isEmpty()) { String createdFilesPath = createdFiles.keySet().stream().map(File::getAbsolutePath) .collect(Collectors.joining(", ")); - Activator.getDefault().getLog().info(MessageFormat.format(Messages.MigrationAction_Image_AsolutePathImageMigrated, + Platform.getLog(bundle).info(MessageFormat.format(Messages.MigrationAction_Image_AsolutePathImageMigrated, new EditingDomainServices().getLabelProviderText(notifier), attribute.getName(), createdFilesPath)); } if (!nonCreatedFiles.isEmpty()) { String nonCreatedFilesPath = nonCreatedFiles.stream().map(File::getAbsolutePath) .collect(Collectors.joining(", ")); - Activator.getDefault().getLog() - .warn(MessageFormat.format(Messages.MigrationAction_Image_AsolutePathImageNotMigrated, + Platform.getLog(bundle).warn(MessageFormat.format(Messages.MigrationAction_Image_AsolutePathImageNotMigrated, new EditingDomainServices().getLabelProviderText(notifier), attribute.getName(), nonCreatedFilesPath)); } return createdFiles; @@ -242,8 +245,8 @@ private Map createFiles(IFolder imageFolder, Map files } catch (CoreException e) { String nonCreatedFilesPath = filesToCopy.values().stream().map(iFile -> iFile.getFullPath().toString()) .collect(Collectors.joining(", ")); - Activator.getDefault().getLog() - .error(MessageFormat.format(Messages.MigrationAction_Image_ImpossibleToCreateImageFolder, + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(MessageFormat.format(Messages.MigrationAction_Image_ImpossibleToCreateImageFolder, imageFolder.getFullPath(), new EditingDomainServices().getLabelProviderText(contextObject), attribute.getName(), nonCreatedFilesPath), e); } @@ -267,20 +270,19 @@ private Map createFiles(IFolder imageFolder, Map files createdFiles.put(fileToCopy, targetFileToCreate); } catch (CoreException | IOException e) { - Activator.getDefault().getLog().error( + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error( MessageFormat.format(Messages.MigrationAction_Image_ImpossibleToCreateImage, fileToCopy.getAbsolutePath()), e); - nonCreatedFiles.add(fileToCopy); + nonCreatedFiles.add(fileToCopy); } } if (nonCreatedFiles.size() > 0) { - String nonCreatedFilesPath = nonCreatedFiles.stream().map(File::getAbsolutePath) - .collect(Collectors.joining(", ")); - Activator.getDefault().getLog() - .error(MessageFormat.format(Messages.MigrationAction_Image_ImpossibleToCreateImages, - new EditingDomainServices().getLabelProviderText(contextObject), attribute.getName(), - nonCreatedFilesPath)); + String nonCreatedFilesPath = nonCreatedFiles.stream().map(File::getAbsolutePath).collect(Collectors.joining(", ")); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(MessageFormat.format(Messages.MigrationAction_Image_ImpossibleToCreateImages, new EditingDomainServices().getLabelProviderText(contextObject), + attribute.getName(), nonCreatedFilesPath)); } return createdFiles; } diff --git a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/PatternCatalogDeletionContributor.java b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/PatternCatalogDeletionContributor.java index eddf7ecf67..5f6d9a88ac 100644 --- a/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/PatternCatalogDeletionContributor.java +++ b/core/plugins/org.polarsys.capella.core.data.migration/src/org/polarsys/capella/core/data/migration/contribution/PatternCatalogDeletionContributor.java @@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.migration.AbstractMigrationRunnable; import org.polarsys.capella.core.data.migration.MigrationConstants; import org.polarsys.capella.core.data.migration.context.MigrationContext; @@ -50,7 +51,7 @@ public IStatus run(MigrationContext context, boolean checkVersion) { parent.delete(true, new NullProgressMonitor()); } } catch (CoreException e) { - return new Status(IStatus.ERROR, org.polarsys.capella.core.data.migration.Activator.PLUGIN_ID, e.getMessage(), e); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getMessage(), e); } return Status.OK_STATUS; } diff --git a/core/plugins/org.polarsys.capella.core.data.modeller.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.modeller.properties/META-INF/MANIFEST.MF index ea69f18cb3..e566871b59 100644 --- a/core/plugins/org.polarsys.capella.core.data.modeller.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.modeller.properties/META-INF/MANIFEST.MF @@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.modeller.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.modeller.properties.ModellerPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.data.modeller.properties, - org.polarsys.capella.core.data.modeller.properties.sections +Export-Package: org.polarsys.capella.core.data.modeller.properties.sections Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.data.modeller.properties/src/org/polarsys/capella/core/data/modeller/properties/ModellerPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.modeller.properties/src/org/polarsys/capella/core/data/modeller/properties/ModellerPropertiesPlugin.java deleted file mode 100644 index 335101e2b0..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.modeller.properties/src/org/polarsys/capella/core/data/modeller/properties/ModellerPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.modeller.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class ModellerPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.modeller.properties"; //$NON-NLS-1$ - - // The shared instance - private static ModellerPropertiesPlugin plugin; - - /** - * The constructor - */ - public ModellerPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static ModellerPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.oa.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.oa.properties/META-INF/MANIFEST.MF index 6444e02a72..43f240dcad 100644 --- a/core/plugins/org.polarsys.capella.core.data.oa.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.oa.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.oa.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.oa.properties.OaPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.fa.properties;visibility:=reexport, org.polarsys.capella.core.data.interaction.properties;visibility:=reexport, diff --git a/core/plugins/org.polarsys.capella.core.data.oa.properties/src/org/polarsys/capella/core/data/oa/properties/OaPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.oa.properties/src/org/polarsys/capella/core/data/oa/properties/OaPropertiesPlugin.java deleted file mode 100644 index 13740271bd..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.oa.properties/src/org/polarsys/capella/core/data/oa/properties/OaPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.oa.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class OaPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.oa.properties"; //$NON-NLS-1$ - - // The shared instance - private static OaPropertiesPlugin plugin; - - /** - * The constructor - */ - public OaPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static OaPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/META-INF/MANIFEST.MF index 82e5f3083f..a8ed813d16 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/META-INF/MANIFEST.MF @@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.pa.deployment.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.pa.deployment.properties.DeploymentPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.data.pa.deployment.properties, - org.polarsys.capella.core.data.pa.deployment.properties.sections +Export-Package: org.polarsys.capella.core.data.pa.deployment.properties.sections Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/src/org/polarsys/capella/core/data/pa/deployment/properties/DeploymentPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/src/org/polarsys/capella/core/data/pa/deployment/properties/DeploymentPropertiesPlugin.java deleted file mode 100644 index 44110cd8d7..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.pa.deployment.properties/src/org/polarsys/capella/core/data/pa/deployment/properties/DeploymentPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.pa.deployment.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class DeploymentPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.pa.deployment.properties"; //$NON-NLS-1$ - - // The shared instance - private static DeploymentPropertiesPlugin plugin; - - /** - * The constructor - */ - public DeploymentPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static DeploymentPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.pa.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.pa.properties/META-INF/MANIFEST.MF index 9b101fa96b..1ccd8461ee 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.pa.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.pa.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.pa.properties.PaPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.cs.properties;visibility:=reexport, org.polarsys.capella.core.data.fa.properties;visibility:=reexport diff --git a/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/PaPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/PaPropertiesPlugin.java deleted file mode 100644 index 4d285a13fb..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/PaPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.pa.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class PaPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.pa.properties"; //$NON-NLS-1$ - - // The shared instance - private static PaPropertiesPlugin plugin; - - /** - * The constructor - */ - public PaPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static PaPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/sections/PhysicalComponentSection.java b/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/sections/PhysicalComponentSection.java index a1bd7c6a89..32da8925f9 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/sections/PhysicalComponentSection.java +++ b/core/plugins/org.polarsys.capella.core.data.pa.properties/src/org/polarsys/capella/core/data/pa/properties/sections/PhysicalComponentSection.java @@ -18,7 +18,6 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; -import org.polarsys.capella.core.data.cs.Component; import org.polarsys.capella.core.data.cs.CsPackage; import org.polarsys.capella.core.data.cs.properties.controllers.Component_RealizedComponentsController; import org.polarsys.capella.core.data.cs.properties.sections.ComponentSection; @@ -29,7 +28,7 @@ import org.polarsys.capella.core.data.pa.properties.fields.PhysicalComponentKindGroup; import org.polarsys.capella.core.data.pa.properties.fields.PhysicalComponentNatureGroup; import org.polarsys.capella.core.model.helpers.ComponentExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.ui.properties.fields.AbstractSemanticField; import org.polarsys.capella.core.ui.properties.fields.MultipleSemanticField; @@ -61,7 +60,7 @@ public void createContents(Composite parent, TabbedPropertySheetPage aTabbedProp pcKindGroup = new PhysicalComponentKindGroup(parent, getWidgetFactory(), true); pcKindGroup.setDisplayedInWizard(displayedInWizard); pcNatureGroup = new PhysicalComponentNatureGroup(parent, getWidgetFactory(), - CapellaModelPreferencesPlugin.getDefault().isChangePhysicalComponentNatureAllowed()); + PreferencesHelper.isChangePhysicalComponentNatureAllowed()); pcNatureGroup.setDisplayedInWizard(displayedInWizard); logicalComponentRealizations = new MultipleSemanticField(getReferencesGroup(), @@ -83,7 +82,7 @@ public void loadData(EObject capellaElement) { if (capellaElement instanceof PhysicalComponent) { updateAllocatedFunctionsField((PhysicalComponent) capellaElement); } - pcNatureGroup.setEnabled(CapellaModelPreferencesPlugin.getDefault().isChangePhysicalComponentNatureAllowed()); + pcNatureGroup.setEnabled(PreferencesHelper.isChangePhysicalComponentNatureAllowed()); } /** diff --git a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/META-INF/MANIFEST.MF index 06dc08ff23..60f538a8e1 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.pa.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.pa.ui.quickfix.PaQuickFixActivator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.validation.ui.ide, org.polarsys.capella.core.model.helpers, @@ -19,5 +18,4 @@ Require-Bundle: org.polarsys.capella.core.validation.ui.ide, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.data.pa.ui.quickfix, - org.polarsys.capella.core.data.pa.ui.quickfix.resolver +Export-Package: org.polarsys.capella.core.data.pa.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/PaQuickFixActivator.java b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/PaQuickFixActivator.java deleted file mode 100644 index b44abb1a86..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/PaQuickFixActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.pa.ui.quickfix; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class PaQuickFixActivator extends AbstractUIActivator { - // The shared instance - private static PaQuickFixActivator plugin; - - /** - * The constructor - */ - public PaQuickFixActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static PaQuickFixActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/AbstractPhysicalComponentNatureChangeResolver.java b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/AbstractPhysicalComponentNatureChangeResolver.java index 5837c2e604..4c9bbdc6c5 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/AbstractPhysicalComponentNatureChangeResolver.java +++ b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/AbstractPhysicalComponentNatureChangeResolver.java @@ -16,15 +16,16 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.ef.command.ICommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.pa.PhysicalComponent; import org.polarsys.capella.core.data.pa.PhysicalComponentNature; -import org.polarsys.capella.core.data.pa.ui.quickfix.PaQuickFixActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -48,7 +49,8 @@ public void run() { try { marker.delete(); } catch (CoreException e) { - PaQuickFixActivator.getDefault().log(IStatus.ERROR, "Error while deleting marker", e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Error while deleting marker", e); } } }; diff --git a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/SwitchPhysicalComponentNature.java b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/SwitchPhysicalComponentNature.java index 3887978178..2a8bb67c1d 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/SwitchPhysicalComponentNature.java +++ b/core/plugins/org.polarsys.capella.core.data.pa.ui.quickfix/src/org/polarsys/capella/core/data/pa/ui/quickfix/resolver/SwitchPhysicalComponentNature.java @@ -16,15 +16,16 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.ef.command.ICommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.data.pa.PhysicalComponent; import org.polarsys.capella.core.data.pa.PhysicalComponentNature; -import org.polarsys.capella.core.data.pa.ui.quickfix.PaQuickFixActivator; /** * Open capella element editor to edit respected values @@ -51,7 +52,8 @@ public void run() { try { marker.delete(); } catch (CoreException e) { - PaQuickFixActivator.getDefault().log(IStatus.ERROR, "Error while deleting marker", e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Error while deleting marker", e); } } }; diff --git a/core/plugins/org.polarsys.capella.core.data.pa.validation/src/org/polarsys/capella/core/data/pa/validation/physicalComponent/MDCHK_Component_Deployment.java b/core/plugins/org.polarsys.capella.core.data.pa.validation/src/org/polarsys/capella/core/data/pa/validation/physicalComponent/MDCHK_Component_Deployment.java index d580821105..fb5c2ca416 100644 --- a/core/plugins/org.polarsys.capella.core.data.pa.validation/src/org/polarsys/capella/core/data/pa/validation/physicalComponent/MDCHK_Component_Deployment.java +++ b/core/plugins/org.polarsys.capella.core.data.pa.validation/src/org/polarsys/capella/core/data/pa/validation/physicalComponent/MDCHK_Component_Deployment.java @@ -18,13 +18,13 @@ import org.polarsys.capella.core.data.cs.Part; import org.polarsys.capella.core.data.pa.PhysicalComponent; import org.polarsys.capella.core.model.helpers.CapellaElementExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.validation.rule.AbstractValidationRule; public class MDCHK_Component_Deployment extends AbstractValidationRule { public boolean isMultipleDeploymentAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMultipleDeploymentAllowed(); + return PreferencesHelper.isMultipleDeploymentAllowed(); } @Override diff --git a/core/plugins/org.polarsys.capella.core.data.requirement.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.requirement.properties/META-INF/MANIFEST.MF index b10b047834..3e94ac1d0f 100644 --- a/core/plugins/org.polarsys.capella.core.data.requirement.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.requirement.properties/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.requirement.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.requirement.properties.RequirementPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/core/plugins/org.polarsys.capella.core.data.requirement.properties/src/org/polarsys/capella/core/data/requirement/properties/RequirementPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.requirement.properties/src/org/polarsys/capella/core/data/requirement/properties/RequirementPropertiesPlugin.java deleted file mode 100644 index 038ce40840..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.requirement.properties/src/org/polarsys/capella/core/data/requirement/properties/RequirementPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.requirement.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class RequirementPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.requirement.properties"; //$NON-NLS-1$ - - // The shared instance - private static RequirementPropertiesPlugin plugin; - - /** - * The constructor - */ - public RequirementPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static RequirementPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/META-INF/MANIFEST.MF index f0555c821f..36f2c51f3b 100644 --- a/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/META-INF/MANIFEST.MF @@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.data.sharedmodel.properties;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.data.sharedmodel.properties.SharedModelPropertiesPlugin Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.data.core.properties;visibility:=reexport Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.data.sharedmodel.properties, - org.polarsys.capella.core.data.sharedmodel.properties.sections +Export-Package: org.polarsys.capella.core.data.sharedmodel.properties.sections Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/src/org/polarsys/capella/core/data/sharedmodel/properties/SharedModelPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/src/org/polarsys/capella/core/data/sharedmodel/properties/SharedModelPropertiesPlugin.java deleted file mode 100644 index b22e76d60e..0000000000 --- a/core/plugins/org.polarsys.capella.core.data.sharedmodel.properties/src/org/polarsys/capella/core/data/sharedmodel/properties/SharedModelPropertiesPlugin.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.data.sharedmodel.properties; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class SharedModelPropertiesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.data.sharedmodel.properties"; //$NON-NLS-1$ - - // The shared instance - private static SharedModelPropertiesPlugin plugin; - - /** - * The constructor - */ - public SharedModelPropertiesPlugin() { - // - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static SharedModelPropertiesPlugin getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/META-INF/MANIFEST.MF index 39bcfae4dc..671b1a16b5 100644 --- a/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.explorer.activity.ui.richtext;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.explorer.activity.ui.richtext.CapellaActivityExplorerRichTextActivator Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui.views.properties.tabbed, org.polarsys.capella.common.ui, @@ -15,7 +14,6 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.ui.properties.richtext Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.polarsys.capella.core.explorer.activity.ui.richtext, - org.polarsys.capella.core.explorer.activity.ui.richtext.page +Export-Package: org.polarsys.capella.core.explorer.activity.ui.richtext.page Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/src/org/polarsys/capella/core/explorer/activity/ui/richtext/CapellaActivityExplorerRichTextActivator.java b/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/src/org/polarsys/capella/core/explorer/activity/ui/richtext/CapellaActivityExplorerRichTextActivator.java deleted file mode 100644 index 1e19d517cc..0000000000 --- a/core/plugins/org.polarsys.capella.core.explorer.activity.ui.richtext/src/org/polarsys/capella/core/explorer/activity/ui/richtext/CapellaActivityExplorerRichTextActivator.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.explorer.activity.ui.richtext; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CapellaActivityExplorerRichTextActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.explorer.activity.ui.richtext"; //$NON-NLS-1$ - - // The shared instance - private static CapellaActivityExplorerRichTextActivator plugin; - - /** - * The constructor - */ - public CapellaActivityExplorerRichTextActivator() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 CapellaActivityExplorerRichTextActivator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.explorer.activity.ui/src/org/polarsys/capella/core/explorer/activity/ui/CapellaActivityExplorerActivator.java b/core/plugins/org.polarsys.capella.core.explorer.activity.ui/src/org/polarsys/capella/core/explorer/activity/ui/CapellaActivityExplorerActivator.java index 4a70b12006..eb9a2becb1 100644 --- a/core/plugins/org.polarsys.capella.core.explorer.activity.ui/src/org/polarsys/capella/core/explorer/activity/ui/CapellaActivityExplorerActivator.java +++ b/core/plugins/org.polarsys.capella.core.explorer.activity.ui/src/org/polarsys/capella/core/explorer/activity/ui/CapellaActivityExplorerActivator.java @@ -21,9 +21,6 @@ public class CapellaActivityExplorerActivator extends AbstractUIActivator { private static BundleContext context; - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.explorer.activity.ui.CapellaActivityExplorerActivator"; //$NON-NLS-1$ - /** * The shared instance */ diff --git a/core/plugins/org.polarsys.capella.core.flexibility.wizards/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.flexibility.wizards/META-INF/MANIFEST.MF index 740d46b434..3be10d1279 100644 --- a/core/plugins/org.polarsys.capella.core.flexibility.wizards/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.flexibility.wizards/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.flexibility.wizards;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.flexibility.wizards.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/core/plugins/org.polarsys.capella.core.flexibility.wizards/src/org/polarsys/capella/core/flexibility/wizards/Activator.java b/core/plugins/org.polarsys.capella.core.flexibility.wizards/src/org/polarsys/capella/core/flexibility/wizards/Activator.java deleted file mode 100644 index e5f378ab7f..0000000000 --- a/core/plugins/org.polarsys.capella.core.flexibility.wizards/src/org/polarsys/capella/core/flexibility/wizards/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.flexibility.wizards; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.flexibility.wizards"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - //Nothing - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.libraries.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.libraries.ui/META-INF/MANIFEST.MF index 2fe96c01f2..b7731cb300 100644 --- a/core/plugins/org.polarsys.capella.core.libraries.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.libraries.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.libraries.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.libraries.ui.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.expressions, org.eclipse.ui.ide, @@ -20,8 +19,7 @@ Require-Bundle: org.eclipse.core.expressions, org.polarsys.capella.common.ui.toolkit Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.libraries.ui, - org.polarsys.capella.core.libraries.ui.handlers, +Export-Package: org.polarsys.capella.core.libraries.ui.handlers, org.polarsys.capella.core.libraries.ui.move, org.polarsys.capella.core.libraries.ui.propertyTester, org.polarsys.capella.core.libraries.ui.views.libraryManager, diff --git a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/Activator.java b/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/Activator.java deleted file mode 100644 index d3196cb6b2..0000000000 --- a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/Activator.java +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.libraries.ui; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - private static final String ICONS_PATH = "icons/"; - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.libraries.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - public ImageDescriptor getImageDescriptor(String key_p) { - ImageRegistry imageRegistry = getImageRegistry(); - ImageDescriptor imageDescriptor = imageRegistry.getDescriptor(key_p); - - if (null == imageDescriptor) { - imageDescriptor = createImageDescriptor(key_p); - imageRegistry.put(key_p, imageDescriptor); - } - return imageDescriptor; - } - - protected ImageDescriptor createImageDescriptor(String key_p) { - ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(getPluginId(), ICONS_PATH + key_p); - return imageDescriptor; - } - - public String getPluginId() { - return getBundle().getSymbolicName(); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/move/MoveStagingView.java b/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/move/MoveStagingView.java index ec4b920522..e2aee11ff1 100644 --- a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/move/MoveStagingView.java +++ b/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/move/MoveStagingView.java @@ -28,6 +28,7 @@ import org.apache.log4j.Priority; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.debug.internal.ui.DebugPluginImages; import org.eclipse.debug.ui.IDebugUIConstants; @@ -119,9 +120,12 @@ import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Section; import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.views.properties.IPropertySheetPage; import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.wizards.ui.FlexibilityColors; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.libraries.IModel; @@ -132,7 +136,6 @@ import org.polarsys.capella.common.ui.toolkit.ToolkitPlugin; import org.polarsys.capella.core.data.core.validation.constraint.ReferentialConstraintsResourceSetListener; import org.polarsys.capella.core.libraries.model.ICapellaModel; -import org.polarsys.capella.core.libraries.ui.Activator; import org.polarsys.capella.core.model.helpers.move.CapellaMoveHelper; import org.polarsys.capella.core.model.helpers.move.Stage; import org.polarsys.capella.core.model.helpers.move.StageListener; @@ -333,7 +336,7 @@ public void run() { referenceErrors.set(status); MyDiagnosticDialog dialog = new MyDiagnosticDialog(getViewSite().getShell(), status); if (dialog.open() == Window.CANCEL) { - throw new RollbackException(new Status(IStatus.CANCEL, Activator.PLUGIN_ID, Messages.MoveStagingView_CancelStatusMessage)); + throw new RollbackException(new Status(IStatus.CANCEL, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.MoveStagingView_CancelStatusMessage)); } else { forcedMove.set(true); } @@ -977,7 +980,8 @@ private class AddRequiredAction extends AbstractAddRequiredAction { private AddRequiredAction() { super(Messages.MoveStagingView_addRequiredElementsLabel); - setImageDescriptor(Activator.getDefault().getImageDescriptor("full/etool16/add_dependencies.gif")); //$NON-NLS-1$ + final String ICONS_PATH = "icons/"; + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/add_dependencies.gif")); //$NON-NLS-1$ setToolTipText(Messages.MoveStagingView_addRequiredElementsLabel); } @@ -997,7 +1001,8 @@ private class AddAllRequiredAction extends AbstractAddRequiredAction { protected AddAllRequiredAction() { super(Messages.MoveStagingView_addAllRequiredElementsLabel); - setImageDescriptor(Activator.getDefault().getImageDescriptor("full/etool16/add_alldependencies.gif")); //$NON-NLS-1$ + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "full/etool16/add_alldependencies.gif")); //$NON-NLS-1$ setToolTipText(Messages.MoveStagingView_addAllRequiredElementsLabel); } @@ -1472,7 +1477,8 @@ public void selectElementInCapellaExplorer(ISelection selection) { try { window.getActivePage().showView(CapellaCommonNavigator.ID, null, IWorkbenchPage.VIEW_ACTIVATE); } catch (PartInitException e) { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(e.getLocalizedMessage(), e); } super.selectElementInCapellaExplorer(selection); } diff --git a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/wizard/newLibrary/NewLibraryProjectWizard.java b/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/wizard/newLibrary/NewLibraryProjectWizard.java index 8145791b6b..2c7c8e018d 100644 --- a/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/wizard/newLibrary/NewLibraryProjectWizard.java +++ b/core/plugins/org.polarsys.capella.core.libraries.ui/src/org/polarsys/capella/core/libraries/ui/wizard/newLibrary/NewLibraryProjectWizard.java @@ -15,7 +15,8 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IWorkbench; -import org.polarsys.capella.core.libraries.ui.Activator; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.platform.sirius.ui.project.NewProjectWizard; import org.polarsys.capella.core.platform.sirius.ui.project.internal.WizardNewProjectCreationPage; import org.polarsys.capella.core.platform.sirius.ui.project.operations.SessionCreationHelper; @@ -32,7 +33,8 @@ protected SessionCreationHelper createSessionCreationHelper() { public void init(IWorkbench workbench, IStructuredSelection currentSelection) { super.init(workbench, currentSelection); setWindowTitle("New Capella Library"); //$NON-NLS-1$ - ImageDescriptor descriptor = Activator.getDefault().getImageDescriptor("libraryWizard.png"); //$NON-NLS-1$ + final String ICONS_PATH = "icons/"; //$NON-NLS-1$ + ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + "libraryWizard.png"); //$NON-NLS-1$ if (null == descriptor) { descriptor = ImageDescriptor.getMissingImageDescriptor(); } diff --git a/core/plugins/org.polarsys.capella.core.libraries/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.libraries/META-INF/MANIFEST.MF index d1a9bacb35..5dac393c3d 100644 --- a/core/plugins/org.polarsys.capella.core.libraries/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.libraries/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.libraries;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.libraries.Activator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.common.flexibility.properties, org.polarsys.capella.common.libraries;visibility:=reexport, @@ -13,8 +12,7 @@ Require-Bundle: org.polarsys.capella.common.flexibility.properties, org.polarsys.capella.common.queries Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.libraries, - org.polarsys.capella.core.libraries.model, +Export-Package: org.polarsys.capella.core.libraries.model, org.polarsys.capella.core.libraries.nature, org.polarsys.capella.core.libraries.properties, org.polarsys.capella.core.libraries.provider, diff --git a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/Activator.java b/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/Activator.java deleted file mode 100644 index d21a07825a..0000000000 --- a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/Activator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.libraries; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator extends Plugin implements BundleActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.libraries"; //$NON-NLS-1$ - - // The shared instance - public static Activator plugin; - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - plugin = null; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/model/CapellaModel.java b/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/model/CapellaModel.java index 072d2e1b9c..78a40fc2b4 100644 --- a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/model/CapellaModel.java +++ b/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/model/CapellaModel.java @@ -27,6 +27,7 @@ import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.sirius.business.internal.session.danalysis.DAnalysisSessionImpl; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; @@ -39,7 +40,6 @@ import org.polarsys.capella.common.libraries.LibraryReference; import org.polarsys.capella.common.libraries.ModelInformation; import org.polarsys.capella.core.data.capellamodeller.Project; -import org.polarsys.capella.core.libraries.Activator; import org.polarsys.capella.core.model.handler.command.BasicCapellaDeleteCommand; import org.polarsys.capella.core.model.handler.helpers.CrossReferencerHelper; import org.polarsys.kitalpha.ad.metadata.helpers.LibraryHelper; @@ -312,14 +312,14 @@ public boolean canReference(IModel referencedLibrary) { @Override public boolean isActive(IModel library) { - Preferences activeLibraryPrefInfos = ConfigurationScope.INSTANCE.getNode(Activator.PLUGIN_ID).node(ACTIVE_STATE_PREF_ID); + Preferences activeLibraryPrefInfos = ConfigurationScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).node(ACTIVE_STATE_PREF_ID); Preferences libraryContextPref = activeLibraryPrefInfos.node(this.getIdentifier().getName()); return libraryContextPref.getBoolean(library.getIdentifier().getName(), getDefaultActiveState(library)); } @Override public void setActive(IModel library, boolean activeState) { - final Preferences activeLibraryPrefInfos = ConfigurationScope.INSTANCE.getNode(Activator.PLUGIN_ID).node(ACTIVE_STATE_PREF_ID); + final Preferences activeLibraryPrefInfos = ConfigurationScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).node(ACTIVE_STATE_PREF_ID); Preferences libraryContextPref = activeLibraryPrefInfos.node(this.getIdentifier().getName()); libraryContextPref.putBoolean(library.getIdentifier().getName(), activeState); diff --git a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/properties/ReferencesProperty.java b/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/properties/ReferencesProperty.java index 6a6054f295..497e37a602 100644 --- a/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/properties/ReferencesProperty.java +++ b/core/plugins/org.polarsys.capella.core.libraries/src/org/polarsys/capella/core/libraries/properties/ReferencesProperty.java @@ -18,11 +18,11 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.osgi.util.NLS; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.property.AbstractProperty; import org.polarsys.capella.common.flexibility.properties.schema.IEditableProperty; import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext; import org.polarsys.capella.common.libraries.IModel; -import org.polarsys.capella.core.libraries.Activator; public class ReferencesProperty extends AbstractProperty implements IEditableProperty { @@ -50,20 +50,20 @@ public Object getValue(IPropertyContext context_p) { public IStatus validate(Object newValue_p, IPropertyContext context_p) { if (!model.getUnsavedModels().isEmpty()) { String unsavedTxt = model.getUnsavedModels().stream().map(m -> m.getIdentifier().getName()).collect(Collectors.joining(", ")); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind( + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind( "There is other unsaved session(s) ({0}), this may lead to inconsistencies,\n You should save others sessions before manage references.", unsavedTxt)); } boolean unsavedModel = model.isUnsavedRootModel(); if (unsavedModel) { - return new Status(IStatus.WARNING, Activator.PLUGIN_ID, + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "The session is unsaved. Manage references will save the session."); } if (!model.getUnresolvableReferencedLibraries().isEmpty()) { String unresolvableLibs = model.getUnresolvableReferencedLibraries().stream() .map(m -> m.getIdentifier().getName()).collect(Collectors.joining(", ")); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind( + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind( "The following libraries are not properly referenced: ({0}). This may lead to inconsistencies.\n You should uncheck these dependencies, click OK and reference them again using the same wizard.", unresolvableLibs)); } @@ -72,7 +72,7 @@ public IStatus validate(Object newValue_p, IPropertyContext context_p) { Collection cycle = model.getCycles().iterator().next(); String cycleLibTxt = cycle.stream() .map(m -> m.getIdentifier().getName()).collect(Collectors.joining(" ")); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, model.getCycles().size() + " cycles found. First one is [" + cycleLibTxt + "]"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), model.getCycles().size() + " cycles found. First one is [" + cycleLibTxt + "]"); } return Status.OK_STATUS; diff --git a/core/plugins/org.polarsys.capella.core.linkedtext.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.linkedtext.ui/META-INF/MANIFEST.MF index 7d97c5dca3..4e4c9fa8e3 100644 --- a/core/plugins/org.polarsys.capella.core.linkedtext.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.linkedtext.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.linkedtext.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.linkedtext.ui.CapellaLinkedTextUIActivator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.emf.ecore, diff --git a/core/plugins/org.polarsys.capella.core.linkedtext.ui/src/org/polarsys/capella/core/linkedtext/ui/CapellaLinkedTextUIActivator.java b/core/plugins/org.polarsys.capella.core.linkedtext.ui/src/org/polarsys/capella/core/linkedtext/ui/CapellaLinkedTextUIActivator.java deleted file mode 100644 index ec4e8b50f9..0000000000 --- a/core/plugins/org.polarsys.capella.core.linkedtext.ui/src/org/polarsys/capella/core/linkedtext/ui/CapellaLinkedTextUIActivator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.linkedtext.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class CapellaLinkedTextUIActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.linkedtext.ui"; //$NON-NLS-1$ - - // The shared instance - private static CapellaLinkedTextUIActivator plugin; - - /** - * The constructor - */ - public CapellaLinkedTextUIActivator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static CapellaLinkedTextUIActivator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.model.detachement/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.model.detachement/META-INF/MANIFEST.MF index 13c80fc208..5b2236875f 100644 --- a/core/plugins/org.polarsys.capella.core.model.detachement/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.model.detachement/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.model.detachement;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.model.detachement.CapellaModelDetachementPlugin Require-Bundle: org.eclipse.ui, org.eclipse.ui.forms, org.polarsys.kitalpha.model.common.commands, diff --git a/core/plugins/org.polarsys.capella.core.model.detachement/src/org/polarsys/capella/core/model/detachement/CapellaModelDetachementPlugin.java b/core/plugins/org.polarsys.capella.core.model.detachement/src/org/polarsys/capella/core/model/detachement/CapellaModelDetachementPlugin.java deleted file mode 100644 index 085cde7226..0000000000 --- a/core/plugins/org.polarsys.capella.core.model.detachement/src/org/polarsys/capella/core/model/detachement/CapellaModelDetachementPlugin.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.model.detachement; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class CapellaModelDetachementPlugin implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /** - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - CapellaModelDetachementPlugin.context = bundleContext; - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - CapellaModelDetachementPlugin.context = null; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.model.handler/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.model.handler/META-INF/MANIFEST.MF index 93b435afeb..a02579611a 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.model.handler/META-INF/MANIFEST.MF @@ -29,5 +29,4 @@ Export-Package: org.polarsys.capella.core.model.handler, org.polarsys.capella.core.model.handler.pre.condition, org.polarsys.capella.core.model.handler.provider, org.polarsys.capella.core.model.handler.validation -Bundle-Activator: org.polarsys.capella.core.model.handler.ModelHandlerPlugin Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/ModelHandlerPlugin.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/ModelHandlerPlugin.java deleted file mode 100644 index 0bd79f8b7a..0000000000 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/ModelHandlerPlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.model.handler; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class ModelHandlerPlugin extends Plugin { - - /** - * The plugin id - */ - public static String PLUGIN_ID = "org.polarsys.capella.core.model.handler"; //$NON-NLS-1$ - - /** - * The shared instance - */ - private static ModelHandlerPlugin __plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - __plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static ModelHandlerPlugin getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/advisor/DelegateWorkbenchAdvisor.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/advisor/DelegateWorkbenchAdvisor.java index 35c1e85edb..8e63d162ad 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/advisor/DelegateWorkbenchAdvisor.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/advisor/DelegateWorkbenchAdvisor.java @@ -14,11 +14,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; - -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; /** * See 'delegateWorkbenchAdvisor' extension point.
@@ -88,7 +86,8 @@ public void callPostShutdown() { } private void logError(CoreException e) { - ModelHandlerPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, "org.polarsys.capella.core.model.handler", e.getMessage(), e)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(e.getMessage(), e); } } diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/BasicCapellaDeleteCommand.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/BasicCapellaDeleteCommand.java index cca220ca3d..8979d5a1d4 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/BasicCapellaDeleteCommand.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/BasicCapellaDeleteCommand.java @@ -34,13 +34,13 @@ import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.operations.LongRunningListenersRegistry; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.common.tools.report.util.LogExt; -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; import org.polarsys.capella.core.model.handler.helpers.RepresentationHelper; /** @@ -246,7 +246,7 @@ public void run() { } catch (Exception re) { // For other kind of Exception, we only log them. LogExt.log(IReportManagerDefaultComponents.MODEL, - new Status(IStatus.WARNING, ModelHandlerPlugin.PLUGIN_ID, re.getMessage(), re)); + new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), re.getMessage(), re)); } } } diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CapellaResourceNamingHelper.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CapellaResourceNamingHelper.java index 2d4c50b6c3..f9b509faa4 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CapellaResourceNamingHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CapellaResourceNamingHelper.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.osgi.util.NLS; import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; +import org.osgi.framework.FrameworkUtil; @SuppressWarnings("restriction") public class CapellaResourceNamingHelper { @@ -67,7 +67,7 @@ public static IStatus validateName(String name, int typeMask) { String message = NLS.bind(Messages.CapellaResourceNamingHelper_invalidCharInName, String.valueOf(invalidChar), name); - return new Status(IStatus.ERROR, ModelHandlerPlugin.PLUGIN_ID, message); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(CapellaResourceNamingHelper.class).getSymbolicName(), message); } } diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CompoundDeleteHelper.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CompoundDeleteHelper.java index 11943c7c0b..8d34139cad 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CompoundDeleteHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/command/CompoundDeleteHelper.java @@ -23,9 +23,9 @@ import org.eclipse.emf.common.command.Command; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; /** * Default implementation of the delete command helper, using extension mechanism @@ -42,7 +42,7 @@ protected Collection getHelpers() { //Read extension point looking for instances of IDeleteHelper for (IConfigurationElement element : ExtensionPointHelper - .getConfigurationElements(ModelHandlerPlugin.PLUGIN_ID, "deleteCommandProvider")) { + .getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "deleteCommandProvider")) { try { IDeleteHelper helper = (IDeleteHelper) element.createExecutableExtension("class"); if (helper != null) { diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/provider/CapellaReadOnlyHelper.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/provider/CapellaReadOnlyHelper.java index c6ad658f08..13f1b8b06f 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/provider/CapellaReadOnlyHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/provider/CapellaReadOnlyHelper.java @@ -14,8 +14,8 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; /** */ @@ -79,7 +79,7 @@ public static IReadOnlySectionHandler getReadOnlySectionHandler() { private static IReadOnlySectionHandler getContributedReadOnlySectionHandler() { // Load IReadOnlySectionHandler contributor if any. IConfigurationElement[] configurationElements = - ExtensionPointHelper.getConfigurationElements(ModelHandlerPlugin.PLUGIN_ID, "readOnlySectionHandler"); //$NON-NLS-1$ + ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(CapellaReadOnlyHelper.class).getSymbolicName(), "readOnlySectionHandler"); //$NON-NLS-1$ // Loop over contributed IReadOnlySectionHandler and add them to the delegate. if (configurationElements.length > 0) { ReadOnlySectionHandlerDelegate delegate = new ReadOnlySectionHandlerDelegate(); diff --git a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/validation/PluggableDiagnosticianProvider.java b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/validation/PluggableDiagnosticianProvider.java index 1d9db0a5a2..189d81dd19 100644 --- a/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/validation/PluggableDiagnosticianProvider.java +++ b/core/plugins/org.polarsys.capella.core.model.handler/src/org/polarsys/capella/core/model/handler/validation/PluggableDiagnosticianProvider.java @@ -15,13 +15,11 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.ecore.util.Diagnostician; - -import org.polarsys.capella.core.model.handler.ModelHandlerPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; /** * Provides diagnosticians by searching the extension registry for DiagnosticianProviders @@ -33,7 +31,7 @@ */ public class PluggableDiagnosticianProvider extends AbstractDiagnosticianProvider { - public static final String DIAGNOSTICIAN_PROVIDER_EXTENSION = ModelHandlerPlugin.PLUGIN_ID + ".diagnosticianProviders"; //$NON-NLS-1$ + public static final String DIAGNOSTICIAN_PROVIDER_EXTENSION = FrameworkUtil.getBundle(PluggableDiagnosticianProvider.class).getSymbolicName() + ".diagnosticianProviders"; //$NON-NLS-1$ @Override public Diagnostician getDiagnostician(AdapterFactory adapterFactory_p, IProgressMonitor progressMonitor_p) { @@ -44,7 +42,8 @@ public Diagnostician getDiagnostician(AdapterFactory adapterFactory_p, IProgress AbstractDiagnosticianProvider provider = (AbstractDiagnosticianProvider) elems[0].createExecutableExtension("class"); //$NON-NLS-1$ result = provider.getDiagnostician(adapterFactory_p, progressMonitor_p); } catch (CoreException e1) { - ModelHandlerPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, ModelHandlerPlugin.PLUGIN_ID, e1.getMessage(), e1)); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(e1.getMessage(), e1); } } if (null == result) { diff --git a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/PartExt.java b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/PartExt.java index 157255d592..3152208068 100644 --- a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/PartExt.java +++ b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/PartExt.java @@ -41,7 +41,7 @@ import org.polarsys.capella.core.data.la.LogicalArchitecture; import org.polarsys.capella.core.data.pa.PhysicalArchitecture; import org.polarsys.capella.core.data.pa.deployment.PartDeploymentLink; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** * Part helpers @@ -294,7 +294,7 @@ public static Collection getFirstPartAncestors(Part currentPart) { } public static boolean isDeployable(Part part) { - if (CapellaModelPreferencesPlugin.getDefault().isMultipleDeploymentAllowed()) { + if (PreferencesHelper.isMultipleDeploymentAllowed()) { return true; } return part.getDeployingParts().isEmpty(); diff --git a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/delete/DeleteHelper.java b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/delete/DeleteHelper.java index cfc92a4a28..e5e55f757a 100644 --- a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/delete/DeleteHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/delete/DeleteHelper.java @@ -82,8 +82,8 @@ import org.polarsys.capella.core.model.helpers.PhysicalLinkExt; import org.polarsys.capella.core.model.helpers.PhysicalPathExt; import org.polarsys.capella.core.model.helpers.SequenceLinkEndExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.model.preferences.IDeletePreferences; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** * @@ -310,14 +310,14 @@ public Set getExpandedSelection(Collection selection) { // Special case for Sequence Link Ends. addElementsForSequenceLinkEnd(expandedSelection); - if (CapellaModelPreferencesPlugin.getDefault().isSynchronizationOfComponentPortToFunctionPortAllowed()) { + if (PreferencesHelper.isSynchronizationOfComponentPortToFunctionPortAllowed()) { addElementsForComponentExchangeFunctionalExchangeAllocation(expandedSelection); } - if (CapellaModelPreferencesPlugin.getDefault() + if (PreferencesHelper .isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed()) { addElementsForComponentExchangeAllocationFromPL(expandedSelection); } - if (CapellaModelPreferencesPlugin.getDefault() + if (PreferencesHelper .isSynchronizationOfPhysicalPortToComponentPortOnPhysicalPathAllowed()) { addElementsForComponentExchangeAllocationFromPP(expandedSelection); } diff --git a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/listeners/CapellaModelDataListenerForDatas.java b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/listeners/CapellaModelDataListenerForDatas.java index 1d6d0efc54..0f9a815cd3 100644 --- a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/listeners/CapellaModelDataListenerForDatas.java +++ b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/listeners/CapellaModelDataListenerForDatas.java @@ -35,7 +35,7 @@ import org.polarsys.capella.core.data.information.InformationPackage; import org.polarsys.capella.core.data.information.Property; import org.polarsys.capella.core.data.information.datatype.DataType; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** */ @@ -84,7 +84,7 @@ public void run() { if (notifier instanceof Class) { Object value = notification.getNewValue(); if ((value instanceof Boolean) && Boolean.TRUE.equals(value) - && CapellaModelPreferencesPlugin.getDefault().isPrimitiveSynchroAllowed()) + && PreferencesHelper.isPrimitiveSynchroAllowed()) { final List assocToBeRemoved = new ArrayList(); for (EObject ref : EObjectExt.getReferencers((Class) notifier, ModellingcorePackage.Literals.ABSTRACT_TYPED_ELEMENT__ABSTRACT_TYPE)) { diff --git a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/move/MoveHelper.java b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/move/MoveHelper.java index 5059e6e424..66260e7b15 100644 --- a/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/move/MoveHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.helpers/src/org/polarsys/capella/core/model/helpers/move/MoveHelper.java @@ -20,8 +20,6 @@ import org.apache.log4j.Logger; import org.eclipse.core.runtime.IConfigurationElement; -import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.util.EList; @@ -36,6 +34,8 @@ import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.common.helpers.EObjectLabelProviderHelper; import org.polarsys.capella.common.helpers.EcoreUtil2; +import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; +import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.core.data.capellacommon.AbstractCapabilityPkg; import org.polarsys.capella.core.data.capellacommon.AbstractState; import org.polarsys.capella.core.data.capellacommon.CapellacommonPackage; @@ -84,7 +84,7 @@ import org.polarsys.capella.core.model.helpers.PartExt; import org.polarsys.capella.core.model.helpers.StateExt; import org.polarsys.capella.core.model.helpers.StateMachineExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.kitalpha.emde.model.edit.provider.ExtensibleElementItemProvider; /** @@ -427,7 +427,7 @@ protected boolean checkCompatibility(List modelElements, * @return true if the region could be moved, false if not */ public boolean canMoveRegion(Region sourceRegion, StateMachine stateMachine) { - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { List regionStates = getAllModeState(sourceRegion); EList machineRegions = stateMachine.getOwnedRegions(); for (Region machineRegion : machineRegions) { @@ -449,7 +449,7 @@ public boolean canMoveRegion(Region sourceRegion, StateMachine stateMachine) { * @return true if the region could be moved, false if not */ public boolean canMoveRegion(Region sourceRegion, AbstractState targetState) { - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { List sourceRegionStates = getAllModeState(sourceRegion); return canMoveStatesInState(sourceRegionStates, targetState); } @@ -466,7 +466,7 @@ public boolean canMoveRegion(Region sourceRegion, AbstractState targetState) { * @return true if the region could be moved, false if not */ public boolean canMoveRegion(Region sourceRegion, Region targetRegion) { - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { List sourceRegionStates = getAllModeState(sourceRegion); return canMoveStatesInRegion(sourceRegionStates, targetRegion); } @@ -519,7 +519,7 @@ public boolean canMoveModeState(State source, Region targetElement) { if (targetElement.eContainer() != null && !(source instanceof FinalState)) { EObject targetContainer = targetElement.eContainer(); - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { boolean isSameType = true; // Check source/target type compatibility if target is a Mode/State if (targetContainer instanceof State) { diff --git a/core/plugins/org.polarsys.capella.core.model.obfuscator/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.model.obfuscator/META-INF/MANIFEST.MF index de6c613c77..1456a90be3 100644 --- a/core/plugins/org.polarsys.capella.core.model.obfuscator/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.model.obfuscator/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.polarsys.capella.core.platform.sirius.ui.navigator, org.eclipse.sirius.table, org.eclipse.sirius.diagram, org.polarsys.kitalpha.ad.metadata -Bundle-Activator: org.polarsys.capella.core.model.obfuscator.CapellaModelObfuscatorActivator Export-Package: org.polarsys.capella.core.model.obfuscator, org.polarsys.capella.core.model.obfuscator.actions Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/CapellaModelObfuscatorActivator.java b/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/CapellaModelObfuscatorActivator.java deleted file mode 100644 index f84a631e6d..0000000000 --- a/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/CapellaModelObfuscatorActivator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.model.obfuscator; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle. - */ -public class CapellaModelObfuscatorActivator extends AbstractUIActivator { - /** - * The singleton instance. - */ - private static CapellaModelObfuscatorActivator __plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context_p) throws Exception { - super.start(context_p); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context_p) throws Exception { - __plugin = null; - super.stop(context_p); - } - - /** - * Returns the singleton instance - * @return - */ - public static CapellaModelObfuscatorActivator getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/actions/ObfuscateSessionAction.java b/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/actions/ObfuscateSessionAction.java index 589039bbb3..c1d0d05e7a 100644 --- a/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/actions/ObfuscateSessionAction.java +++ b/core/plugins/org.polarsys.capella.core.model.obfuscator/src/org/polarsys/capella/core/model/obfuscator/actions/ObfuscateSessionAction.java @@ -25,16 +25,16 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.session.Session; -import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.BaseSelectionListenerAction; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.mdsofa.common.misc.Couple; -import org.polarsys.capella.core.model.obfuscator.CapellaModelObfuscatorActivator; import org.polarsys.capella.core.model.obfuscator.IImageKeys; import org.polarsys.capella.core.model.obfuscator.IResourceObfuscator; import org.polarsys.capella.core.sirius.ui.actions.CloseSessionAction; @@ -54,7 +54,7 @@ public class ObfuscateSessionAction extends BaseSelectionListenerAction { */ public ObfuscateSessionAction() { super(Messages.ObfuscateModelAction_Title); - setImageDescriptor(CapellaModelObfuscatorActivator.getDefault().getImageDescriptor(IImageKeys.IMG_OBFUSCATE_MODEL)); + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IImageKeys.IMG_OBFUSCATE_MODEL)); } @Override @@ -144,7 +144,7 @@ protected void obfuscateComplementaryResource(final Resource resource_p, Executi executionManager_p.execute(new AbstractReadWriteCommand() { public void run() { IConfigurationElement[] element = - ExtensionPointHelper.getConfigurationElements(CapellaModelObfuscatorActivator.getDefault().getPluginId(), "Obfuscator"); + ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Obfuscator"); for (IConfigurationElement ce : element) { IResourceObfuscator obfuscator = (IResourceObfuscator) ExtensionPointHelper.createInstance(ce, "obfuscatorClass"); if ((obfuscator != null) && obfuscator.isApplicableOn(resource_p)) { diff --git a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesInitializer.java index 877f412cd2..0e4c3f1000 100644 --- a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesInitializer.java @@ -13,6 +13,7 @@ package org.polarsys.capella.core.model.preferences; import org.eclipse.core.resources.ProjectScope; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; /** @@ -23,7 +24,7 @@ public class CapellaModelPreferencesInitializer extends AbstractPreferencesIniti * Default constructor. */ public CapellaModelPreferencesInitializer() { - super(CapellaModelPreferencesPlugin.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaModelPreferencesInitializer.class).getSymbolicName()); } @Override diff --git a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesPlugin.java b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesPlugin.java index b9518fd4bb..abf0c52c69 100644 --- a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesPlugin.java +++ b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/CapellaModelPreferencesPlugin.java @@ -21,9 +21,6 @@ */ public class CapellaModelPreferencesPlugin extends Plugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.model.preferences"; //$NON-NLS-1$ - // The shared instance private static CapellaModelPreferencesPlugin plugin; @@ -63,153 +60,4 @@ public static CapellaModelPreferencesPlugin getDefault() { return plugin; } - /** - * Get the Confirm Delete current preference value.
- *
- * - * @deprecated use IDeletePreferences.INSTANCE.isConfirmationRequired() - * @link {@link IDeletePreferences#PREFERENCE_CONFIRM_DELETE} value true or false - * @return boolean value - */ - @Deprecated - public boolean isConfirmDeleteAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, - IDeletePreferences.PREFERENCE_CONFIRM_DELETE_DEFAULT); - } - - /** - * Get the Delete Parts current preference value.
- *
- * - * @deprecated use IDeletePreferences.INSTANCE.isDeletePartsAllowed() - * @link {@link IDeletePreferences#PREFERENCE_DELETE_PARTS} value true or false - * @return boolean value - */ - @Deprecated - public boolean isDeletePartsAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_DELETE_PARTS, - IDeletePreferences.PREFERENCE_DELETE_PARTS_DEFAULT); - } - - /** - * Get the Allow Primitive Synchronization Strategy current preference value.
- *
- * - * @link {@link IDataPreferences#PREFS_ALLOW_PRIMITIVE_SYNCHRONIZATION} value true or false - * @return boolean value - */ - public boolean isPrimitiveSynchroAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDataPreferences.PREFS_ALLOW_PRIMITIVE_SYNCHRONIZATION, true); - - } - - /** - * Get the Allow Reuse of components Strategy current preference value.
- *
- * - * @link {@link IReuseComponentsPreferences#PREFS_ALLOW_REUSE_COMPONENTS} value true or false - * @return boolean value - */ - public boolean isReuseOfComponentsAllowed() { - return AbstractPreferencesInitializer.getBoolean(IReuseComponentsPreferences.PREFS_ALLOW_REUSE_COMPONENTS, true); - - } - - /** - * Get the Allow Multiple Inheritance Strategy current preference value.
- *
- * - * @link {@link IInheritancePreferences#PREFS_ALLOW_MULTIPLE_INHERITANCE} value true or false - * @return boolean value - */ - public boolean isMultipleInheritanceAllowed() { - return AbstractPreferencesInitializer.getBoolean(IInheritancePreferences.PREFS_ALLOW_MULTIPLE_INHERITANCE, true); - - } - - /** - * Get the Allowed Component Non Actor Inheritance Strategy current preference value.
- *
- * - * @link {@link IInheritancePreferences#PREFS_ALLOW_COMPONENT_NON_ACTOR_INHERITANCE} value true or false - * @return boolean value - */ - public boolean isComponentNonActorInheritanceAllowed() { - return AbstractPreferencesInitializer - .getBoolean(IInheritancePreferences.PREFS_ALLOW_COMPONENT_NON_ACTOR_INHERITANCE, true); - - } - - /** - * Get the Allow Multiple Deployment Strategy current preference value.
- *
- * - * @link {@link IDeploymentPreferences#PREFS_ALLOW_MULTIPLE_DEPLOYMENT} value true or false - * @return boolean value - */ - public boolean isMultipleDeploymentAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDeploymentPreferences.PREFS_ALLOW_MULTIPLE_DEPLOYMENT, true); - } - - /** - * Get the Allow Synchronization of ComponentPort to FunctionPort current preference value.
- *
- * - * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_COMPONENTPORT_TO_FUNCTIONPORT} value - * true or false - * @return boolean value - */ - public boolean isSynchronizationOfComponentPortToFunctionPortAllowed() { - return AbstractPreferencesInitializer - .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_COMPONENTPORT_TO_FUNCTIONPORT, true); - } - - /** - * Get the Allow Synchronization of PhysicalPort to ComponentPort on Physical Link current preference value.
- *
- * - * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALLINK} value - * true or false - * @return boolean value - */ - public boolean isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed() { - return AbstractPreferencesInitializer - .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALLINK, true); - } - - /** - * Get the Allow Synchronization of PhysicalPort to ComponentPort on Physical Path current preference value.
- *
- * - * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALPATH} value - * true or false - * @return boolean value - */ - public boolean isSynchronizationOfPhysicalPortToComponentPortOnPhysicalPathAllowed() { - return AbstractPreferencesInitializer - .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALPATH, true); - } - - public boolean isMixedModeStateAllowed() { - return AbstractPreferencesInitializer.getBoolean(IModeAndStateManagementPreferences.PREFS_MIXED_MODE_STATE_ALLOWED, - true); - } - - /** - * @return whether it's allowed to change the Physical Component Nature - */ - public boolean isChangePhysicalComponentNatureAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDataPreferences.PREFS_ALLOW_PHYSICAL_COMPONENT_NATURE_CHANGE, - true); - } - - /** - * - * @return - */ - public boolean isSpecialElementProtectionAllowed() { - return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_DELETE_PROTECTED_ELEMENTS, - IDeletePreferences.PREFERENCE_DELETE_PREOTECTED_ELEMENTS_DEFAULT); - } - } diff --git a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/DeletePreferences.java b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/DeletePreferences.java index 75e5023dfd..cced2406ca 100644 --- a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/DeletePreferences.java +++ b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/DeletePreferences.java @@ -14,6 +14,7 @@ import org.eclipse.core.resources.ProjectScope; import org.eclipse.core.runtime.preferences.DefaultScope; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; /** @@ -24,7 +25,7 @@ public class DeletePreferences extends AbstractPreferencesInitializer implements * @param pluginID */ public DeletePreferences() { - super(CapellaModelPreferencesPlugin.PLUGIN_ID); + super(FrameworkUtil.getBundle(DeletePreferences.class).getSymbolicName()); } /** diff --git a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/DeleteHelper.java b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/DeleteHelper.java index 7347675a80..a763845e4a 100644 --- a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/DeleteHelper.java +++ b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/DeleteHelper.java @@ -60,7 +60,6 @@ import org.polarsys.capella.core.model.handler.command.PreDeleteStructureCommand; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper.TriStateBoolean; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; /** * Helper to compute all deleted semantic elements from a collection of semantic elements to delete applying business delete rules. @@ -259,7 +258,7 @@ public static boolean computeAllDeletedElementsFor(Collection elementsToDelet * diagrams editor, this command is called twice : one only to get a deleted elements preview (through static method) and after end-user confirmation, a new * command (without confirmation) is run to really delete elements. */ - boolean preferenceDeleteParts = CapellaModelPreferencesPlugin.getDefault().isDeletePartsAllowed(); + boolean preferenceDeleteParts = PreferencesHelper.isDeletePartsAllowed(); Collection eltsToDelete = (Collection) elementsToDelete; eltsToDelete.addAll(getAdditionalElementsForParts(eltsToDelete, preferenceDeleteParts)); diff --git a/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/PreferencesHelper.java b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/PreferencesHelper.java new file mode 100644 index 0000000000..be8e0b4128 --- /dev/null +++ b/core/plugins/org.polarsys.capella.core.model.preferences/src/org/polarsys/capella/core/model/preferences/helpers/PreferencesHelper.java @@ -0,0 +1,164 @@ +package org.polarsys.capella.core.model.preferences.helpers; + +import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; +import org.polarsys.capella.core.model.preferences.IDataPreferences; +import org.polarsys.capella.core.model.preferences.IDeletePreferences; +import org.polarsys.capella.core.model.preferences.IDeploymentPreferences; +import org.polarsys.capella.core.model.preferences.IInheritancePreferences; +import org.polarsys.capella.core.model.preferences.IModeAndStateManagementPreferences; +import org.polarsys.capella.core.model.preferences.IReuseComponentsPreferences; +import org.polarsys.capella.core.model.preferences.ISynchronizationPreferences; + +public class PreferencesHelper { + + PreferencesHelper() {} + + /** + * Get the Confirm Delete current preference value.
+ *
+ * + * @deprecated use IDeletePreferences.INSTANCE.isConfirmationRequired() + * @link {@link IDeletePreferences#PREFERENCE_CONFIRM_DELETE} value true or false + * @return boolean value + */ + @Deprecated + public static boolean isConfirmDeleteAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, + IDeletePreferences.PREFERENCE_CONFIRM_DELETE_DEFAULT); + } + + /** + * Get the Delete Parts current preference value.
+ *
+ * + * @deprecated use IDeletePreferences.INSTANCE.isDeletePartsAllowed() + * @link {@link IDeletePreferences#PREFERENCE_DELETE_PARTS} value true or false + * @return boolean value + */ + @Deprecated + public static boolean isDeletePartsAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_DELETE_PARTS, + IDeletePreferences.PREFERENCE_DELETE_PARTS_DEFAULT); + } + + /** + * Get the Allow Primitive Synchronization Strategy current preference value.
+ *
+ * + * @link {@link IDataPreferences#PREFS_ALLOW_PRIMITIVE_SYNCHRONIZATION} value true or false + * @return boolean value + */ + public static boolean isPrimitiveSynchroAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDataPreferences.PREFS_ALLOW_PRIMITIVE_SYNCHRONIZATION, true); + + } + + /** + * Get the Allow Reuse of components Strategy current preference value.
+ *
+ * + * @link {@link IReuseComponentsPreferences#PREFS_ALLOW_REUSE_COMPONENTS} value true or false + * @return boolean value + */ + public static boolean isReuseOfComponentsAllowed() { + return AbstractPreferencesInitializer.getBoolean(IReuseComponentsPreferences.PREFS_ALLOW_REUSE_COMPONENTS, true); + + } + + /** + * Get the Allow Multiple Inheritance Strategy current preference value.
+ *
+ * + * @link {@link IInheritancePreferences#PREFS_ALLOW_MULTIPLE_INHERITANCE} value true or false + * @return boolean value + */ + public static boolean isMultipleInheritanceAllowed() { + return AbstractPreferencesInitializer.getBoolean(IInheritancePreferences.PREFS_ALLOW_MULTIPLE_INHERITANCE, true); + + } + + /** + * Get the Allowed Component Non Actor Inheritance Strategy current preference value.
+ *
+ * + * @link {@link IInheritancePreferences#PREFS_ALLOW_COMPONENT_NON_ACTOR_INHERITANCE} value true or false + * @return boolean value + */ + public static boolean isComponentNonActorInheritanceAllowed() { + return AbstractPreferencesInitializer + .getBoolean(IInheritancePreferences.PREFS_ALLOW_COMPONENT_NON_ACTOR_INHERITANCE, true); + + } + + /** + * Get the Allow Multiple Deployment Strategy current preference value.
+ *
+ * + * @link {@link IDeploymentPreferences#PREFS_ALLOW_MULTIPLE_DEPLOYMENT} value true or false + * @return boolean value + */ + public static boolean isMultipleDeploymentAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDeploymentPreferences.PREFS_ALLOW_MULTIPLE_DEPLOYMENT, true); + } + + /** + * Get the Allow Synchronization of ComponentPort to FunctionPort current preference value.
+ *
+ * + * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_COMPONENTPORT_TO_FUNCTIONPORT} value + * true or false + * @return boolean value + */ + public static boolean isSynchronizationOfComponentPortToFunctionPortAllowed() { + return AbstractPreferencesInitializer + .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_COMPONENTPORT_TO_FUNCTIONPORT, true); + } + + /** + * Get the Allow Synchronization of PhysicalPort to ComponentPort on Physical Link current preference value.
+ *
+ * + * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALLINK} value + * true or false + * @return boolean value + */ + public static boolean isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed() { + return AbstractPreferencesInitializer + .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALLINK, true); + } + + /** + * Get the Allow Synchronization of PhysicalPort to ComponentPort on Physical Path current preference value.
+ *
+ * + * @link {@link ISynchronizationPreferences#PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALPATH} value + * true or false + * @return boolean value + */ + public static boolean isSynchronizationOfPhysicalPortToComponentPortOnPhysicalPathAllowed() { + return AbstractPreferencesInitializer + .getBoolean(ISynchronizationPreferences.PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALPATH, true); + } + + public static boolean isMixedModeStateAllowed() { + return AbstractPreferencesInitializer.getBoolean(IModeAndStateManagementPreferences.PREFS_MIXED_MODE_STATE_ALLOWED, + true); + } + + /** + * @return whether it's allowed to change the Physical Component Nature + */ + public static boolean isChangePhysicalComponentNatureAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDataPreferences.PREFS_ALLOW_PHYSICAL_COMPONENT_NATURE_CHANGE, + true); + } + + /** + * + * @return + */ + public static boolean isSpecialElementProtectionAllowed() { + return AbstractPreferencesInitializer.getBoolean(IDeletePreferences.PREFERENCE_DELETE_PROTECTED_ELEMENTS, + IDeletePreferences.PREFERENCE_DELETE_PREOTECTED_ELEMENTS_DEFAULT); + } +} diff --git a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/FilteredSimplifiedCapellaMetaData.java b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/FilteredSimplifiedCapellaMetaData.java index a7a30028b1..cee61719f6 100644 --- a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/FilteredSimplifiedCapellaMetaData.java +++ b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/FilteredSimplifiedCapellaMetaData.java @@ -26,8 +26,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; - -import org.polarsys.capella.core.model.semantic.internal.SemanticModelActivator; +import org.osgi.framework.FrameworkUtil; /** * A SimplifiedCapellaMetadata implementation that uses an extension point mechanism that works @@ -209,7 +208,7 @@ private boolean isFiltered(EPackage ePackage) { private void reloadFilteredPackagesFromRegistry(){ packageFilters = new ArrayList(); unfilteredEPackages = Collections.synchronizedSet(new HashSet()); - for (IConfigurationElement e : Platform.getExtensionRegistry().getConfigurationElementsFor(SemanticModelActivator.PLUGIN_ID, EXTENSION_SEMANTIC_METADATA)){ + for (IConfigurationElement e : Platform.getExtensionRegistry().getConfigurationElementsFor(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), EXTENSION_SEMANTIC_METADATA)){ if (NAME_PACKAGE_FILTER_ELEMENT.equals(e.getName())){ String nsURI = e.getAttribute(ATTRIBUTE_NS_URI); if (nsURI != null){ diff --git a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/internal/SemanticModelActivator.java b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/internal/SemanticModelActivator.java index 70359aeb86..be0dc3cd97 100644 --- a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/internal/SemanticModelActivator.java +++ b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/internal/SemanticModelActivator.java @@ -20,8 +20,6 @@ public class SemanticModelActivator implements BundleActivator { - public static final String PLUGIN_ID = "org.polarsys.capella.core.model.semantic"; //$NON-NLS-1$ - private static BundleContext context; private static SemanticModelActivator defaultActivator; private ISemanticModelPreferences preferences = new SemanticModelPreferences(); diff --git a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/prefs/SemanticModelPreferences.java b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/prefs/SemanticModelPreferences.java index 140ccddb71..16987cabb6 100644 --- a/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/prefs/SemanticModelPreferences.java +++ b/core/plugins/org.polarsys.capella.core.model.semantic/src/org/polarsys/capella/core/model/semantic/prefs/SemanticModelPreferences.java @@ -16,8 +16,7 @@ import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.InstanceScope; - -import org.polarsys.capella.core.model.semantic.internal.SemanticModelActivator; +import org.osgi.framework.FrameworkUtil; /** */ @@ -28,21 +27,21 @@ public class SemanticModelPreferences extends AbstractPreferenceInitializer impl */ @Override public void initializeDefaultPreferences() { - new DefaultScope().getNode(SemanticModelActivator.PLUGIN_ID).putBoolean(ISemanticModelPreferences.KEY_SEMANTIC_MODE, true); + DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).putBoolean(ISemanticModelPreferences.KEY_SEMANTIC_MODE, true); } /** * {@inheritDoc} */ public void setSemanticMode(boolean enabled_p) { - new InstanceScope().getNode(SemanticModelActivator.PLUGIN_ID).putBoolean(ISemanticModelPreferences.KEY_SEMANTIC_MODE, enabled_p); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).putBoolean(ISemanticModelPreferences.KEY_SEMANTIC_MODE, enabled_p); } /** * {@inheritDoc} */ public boolean isSemanticMode() { - return Platform.getPreferencesService().getBoolean(SemanticModelActivator.PLUGIN_ID, ISemanticModelPreferences.KEY_SEMANTIC_MODE, false, null); + return Platform.getPreferencesService().getBoolean(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ISemanticModelPreferences.KEY_SEMANTIC_MODE, false, null); } } diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/META-INF/MANIFEST.MF index 37eac400de..1e290de37f 100644 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/META-INF/MANIFEST.MF @@ -11,14 +11,12 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.common.ui, org.polarsys.capella.core.ui.properties Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.platform.eclipse.capella.ui.trace, - org.polarsys.capella.core.platform.eclipse.capella.ui.trace.commands, +Export-Package: org.polarsys.capella.core.platform.eclipse.capella.ui.trace.commands, org.polarsys.capella.core.platform.eclipse.capella.ui.trace.icons, org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages, org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views, org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.components, org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.providers Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.core.platform.eclipse.capella.ui.trace.MDTrace Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/MDTrace.java b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/MDTrace.java deleted file mode 100644 index fdcbf724ce..0000000000 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/MDTrace.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.platform.eclipse.capella.ui.trace; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - */ -public class MDTrace extends AbstractUIPlugin { - - /** - * - */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.eclipse.ui.trace"; //$NON-NLS-1$ - - /** - * - */ - public MDTrace() { - // do nothing - } - - /** - * - */ - public static ImageDescriptor imageDescriptorFromPlugin(String pluginId, String imageFilePath) { - return ImageDescriptor.createFromURL(MDTrace.class.getResource(imageFilePath)); - } -} diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/TraceTreeSelectionDialog.java b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/TraceTreeSelectionDialog.java index de9bd19416..288b5b04c8 100644 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/TraceTreeSelectionDialog.java +++ b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/TraceTreeSelectionDialog.java @@ -36,16 +36,15 @@ import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.ui.dialogs.ISelectionStatusValidator; - +import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.common.data.modellingcore.TraceableElement; import org.polarsys.capella.core.data.capellacore.NamedElement; import org.polarsys.capella.core.data.capellamodeller.SystemEngineering; import org.polarsys.capella.core.model.helpers.query.CapellaQueries; -import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.MDTrace; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.Messages; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.TraceUtil; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.providers.CapellaModelFilter; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.providers.IImageKeys; -import org.polarsys.capella.common.data.modellingcore.TraceableElement; /** */ @@ -153,12 +152,12 @@ protected boolean isOkToClose(ISelection selection) { // Loop over selected elements to check validity. if (_currentElement.equals(elem) || (!_isNewTrace && TraceUtil.containsTraceElement(_currentElement, (TraceableElement) elem))) { - updateStatus(new Status(IStatus.WARNING, MDTrace.PLUGIN_ID, IStatus.WARNING, + updateStatus(new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.WARNING, Messages.getString("AddTraceWizard.warning_element_already_exists"), //$NON-NLS-1$ null)); isOkEnabled = false; } else { - updateStatus(new Status(IStatus.OK, MDTrace.PLUGIN_ID, IStatus.OK, "", null)); //$NON-NLS-1$ + updateStatus(new Status(IStatus.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.OK, "", null)); //$NON-NLS-1$ isOkEnabled = true; } } @@ -173,17 +172,17 @@ public IStatus validate(Object[] selection_p) { if (selection_p[0] instanceof NamedElement) { if (_currentElement.equals(selection_p[0]) || (!_isNewTrace && TraceUtil.containsTraceElement(_currentElement, (NamedElement) selection_p[0]))) { - Status status = new Status(IStatus.WARNING, MDTrace.PLUGIN_ID, IStatus.WARNING, Messages.getString("AddTraceWizard.warning_element_already_exists"), //$NON-NLS-1$ + Status status = new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.WARNING, Messages.getString("AddTraceWizard.warning_element_already_exists"), //$NON-NLS-1$ null); updateStatus(status); return status; } } } else if (selection_p.length == 0) { - return new Status(IStatus.WARNING, MDTrace.PLUGIN_ID, IStatus.WARNING, Messages.getString("AddTraceWizard.warning_named_element"), + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.WARNING, Messages.getString("AddTraceWizard.warning_named_element"), null); } - return new Status(IStatus.OK, MDTrace.PLUGIN_ID, IStatus.OK, "", null); //$NON-NLS-1$ + return new Status(IStatus.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.OK, "", null); //$NON-NLS-1$ } }; diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/ViewEditPage.java b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/ViewEditPage.java index 2a06f38d8e..5d63191d4b 100644 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/ViewEditPage.java +++ b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/ViewEditPage.java @@ -42,6 +42,7 @@ import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.AbstractNamedElement; import org.polarsys.capella.common.data.modellingcore.TraceableElement; import org.polarsys.capella.common.ui.toolkit.viewers.menu.ModalContextMenuExtender; @@ -50,7 +51,6 @@ import org.polarsys.capella.core.data.capellamodeller.SystemEngineering; import org.polarsys.capella.core.data.requirement.RequirementsTrace; import org.polarsys.capella.core.model.helpers.query.CapellaQueries; -import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.MDTrace; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.Messages; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.components.TraceTreeViewer; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.views.components.TraceTreeViewer.TraceType; @@ -162,7 +162,7 @@ public void createControl(Composite parent_p) { gdData.horizontalSpan = 2; imageExplanation.setLayoutData(gdData); imageExplanation - .setImage(AbstractUIPlugin.imageDescriptorFromPlugin(MDTrace.PLUGIN_ID, IImageKeys.EXPLANATION).createImage()); + .setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IImageKeys.EXPLANATION).createImage()); // **Presentation of trace elements(source and target) Composite traceTreeComposite = new Composite(composite, SWT.FILL); diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/components/TraceTreeViewer.java b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/components/TraceTreeViewer.java index 46486bd944..5304ccf80c 100644 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/components/TraceTreeViewer.java +++ b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/components/TraceTreeViewer.java @@ -45,6 +45,7 @@ import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.AbstractTrace; import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.common.data.modellingcore.TraceableElement; @@ -56,7 +57,6 @@ import org.polarsys.capella.core.data.requirement.RequirementsTrace; import org.polarsys.capella.core.data.sharedmodel.SharedmodelPackage; import org.polarsys.capella.core.model.helpers.query.CapellaQueries; -import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.MDTrace; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.Messages; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.TraceNameHelper; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.TraceUtil; @@ -260,12 +260,12 @@ public Composite getControl(Composite parent_p) { _addItem = new ToolItem(toolBar, SWT.DROP_DOWN); _addItem.setToolTipText(Messages.getString("TraceTreeViewer.addTrace_tooltip")); //$NON-NLS-1$ - _addItem.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(MDTrace.PLUGIN_ID, IImageKeys.ACTION_ADD).createImage()); + _addItem.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IImageKeys.ACTION_ADD).createImage()); prepareMenuItems(); _removeItem = new ToolItem(toolBar, SWT.PUSH); _removeItem.setToolTipText(Messages.getString("TraceTreeViewer.removeTrace_tooltip")); //$NON-NLS-1$ - _removeItem.setImage(MDTrace.imageDescriptorFromPlugin(MDTrace.PLUGIN_ID, IImageKeys.ACTION_REMOVE).createImage()); + _removeItem.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IImageKeys.ACTION_REMOVE).createImage()); // disable the remove item _removeItem.setEnabled(false); @@ -385,7 +385,7 @@ public void prepareMenuItems() { for (String traceName : TraceNameHelper.getManualTraceTypes()) { MenuItem item = new MenuItem(_additionMenu, SWT.PUSH); item.setText(traceName); - item.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(MDTrace.PLUGIN_ID, IImageKeys.MENU_ITEM).createImage()); + item.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IImageKeys.MENU_ITEM).createImage()); item.addSelectionListener(_menuSelectionListener); } } diff --git a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/providers/ElementLabelProvider.java b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/providers/ElementLabelProvider.java index 25e706a385..b62ebf94b6 100644 --- a/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/providers/ElementLabelProvider.java +++ b/core/plugins/org.polarsys.capella.core.platform.eclipse.ui.trace/src/org/polarsys/capella/core/platform/eclipse/capella/ui/trace/views/providers/ElementLabelProvider.java @@ -14,9 +14,9 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.providers.MDEAdapterFactoryLabelProvider; import org.polarsys.capella.core.data.capellacore.Trace; -import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.MDTrace; import org.polarsys.capella.core.platform.eclipse.capella.ui.trace.messages.TraceNameHelper; /** @@ -46,7 +46,7 @@ public String getText(Object element) { @Override public Image getImage(Object element) { if (element instanceof Class) { - return AbstractUIPlugin.imageDescriptorFromPlugin(MDTrace.PLUGIN_ID, "icons/generic_value.gif").createImage(); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/generic_value.gif").createImage(); } return super.getImage(element); } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/META-INF/MANIFEST.MF index 674401ed49..02b9fe81ce 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.platform.sirius.adapter;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.platform.sirius.adapter.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.sirius.diagram;visibility:=reexport, org.polarsys.capella.core.services;visibility:=reexport, diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/src/org/polarsys/capella/core/platform/sirius/adapter/Activator.java b/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/src/org/polarsys/capella/core/platform/sirius/adapter/Activator.java deleted file mode 100644 index d347ab49d9..0000000000 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.adapter/src/org/polarsys/capella/core/platform/sirius/adapter/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.platform.sirius.adapter; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - /** The plug-in ID */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.adapter"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * Constructs the activator. - */ - public Activator() { - // Do nothing. - } - - /** - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/META-INF/MANIFEST.MF index da17f1335f..9eac4683ad 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.platform.sirius.clipboard;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.platform.sirius.clipboard.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.sirius.diagram.sequence, org.eclipse.sirius.diagram.formatdata, diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/Activator.java b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/Activator.java deleted file mode 100644 index 8107953ce4..0000000000 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.platform.sirius.clipboard; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - //The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.clipboard"; //$NON-NLS-1$ - - // The shared instance - private static Activator __plugin; - - // A label describing this plugin - public static final String LABEL = Messages.Activator_Label; - - /** - * The constructor - */ - public Activator() { - // Nothing - } - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - @Override - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/ClipboardStatusHandler.java b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/ClipboardStatusHandler.java index 4865d66855..77a933cd8c 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/ClipboardStatusHandler.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/ClipboardStatusHandler.java @@ -36,7 +36,7 @@ public void handle(StatusAdapter statusAdapter, int style) { Shell activeShell = window.getShell(); Logger logger = ReportManagerRegistry.getInstance().subscribe(IReportManagerDefaultComponents.DIAGRAM); logger.warn(new EmbeddedMessage(status.getMessage(), IReportManagerDefaultComponents.DIAGRAM), status.getException()); - MessageDialog.openWarning(activeShell, Activator.LABEL, status.getMessage()); + MessageDialog.openWarning(activeShell, Messages.Activator_Label, status.getMessage()); } } } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/commands/CapellaDiagramPasteCommand.java b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/commands/CapellaDiagramPasteCommand.java index 41cd62f07e..be7fd5a6ff 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/commands/CapellaDiagramPasteCommand.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/commands/CapellaDiagramPasteCommand.java @@ -28,6 +28,7 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; @@ -55,9 +56,10 @@ import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.Style; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EObjectExt; import org.polarsys.capella.core.data.cs.Part; -import org.polarsys.capella.core.platform.sirius.clipboard.Activator; import org.polarsys.capella.core.platform.sirius.clipboard.Messages; import org.polarsys.capella.core.platform.sirius.clipboard.util.BusinessHelper; import org.polarsys.capella.core.platform.sirius.clipboard.util.CapellaDiagramClipboard; @@ -218,7 +220,8 @@ protected void ensureCopyPasteValidity(DSemanticDecorator siriusPasteTarget, Cap } protected void log(IStatus validityStatus) { - Activator.getDefault().getLog().log(validityStatus); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).log(validityStatus); } /** @@ -247,7 +250,7 @@ public IStatus checkPastedElementValidity(DDiagramElement pastedElement, Abstrac if (!abstractNodeMappingApplicabilityTester.canCreateIn(diagram)) { String statusMessage = NLS.bind(Messages.CapellaDiagramPasteAction_InvalidDiagramTarget, new String[] { elementName, elementTargetType, EObjectExt.getText(diagram) }); - return new Status(Status.WARNING, Activator.PLUGIN_ID, statusMessage); + return new Status(Status.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), statusMessage); } } else if (pasteTarget instanceof DNodeContainer) { @@ -256,7 +259,7 @@ public IStatus checkPastedElementValidity(DDiagramElement pastedElement, Abstrac String statusMessage = NLS.bind(Messages.CapellaDiagramPasteAction_InvalidNodeContainerTarget, new String[] { elementName, elementTargetType, nodeContainer.getName() }); - return new Status(Status.WARNING, Activator.PLUGIN_ID, statusMessage); + return new Status(Status.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), statusMessage); } } else if (pasteTarget instanceof DNode) { @@ -265,7 +268,7 @@ public IStatus checkPastedElementValidity(DDiagramElement pastedElement, Abstrac String statusMessage = NLS.bind(Messages.CapellaDiagramPasteAction_InvalidNodeTarget, new String[] { elementName, elementTargetType, node.getName() }); - return new Status(Status.WARNING, Activator.PLUGIN_ID, statusMessage); + return new Status(Status.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), statusMessage); } } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/BusinessHelper.java b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/BusinessHelper.java index 238247f55c..e42cffc49c 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/BusinessHelper.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/BusinessHelper.java @@ -82,7 +82,7 @@ import org.polarsys.capella.core.data.pa.deployment.PartDeploymentLink; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper.TriStateBoolean; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** * This class defines business-specific rules for managing Capella models @@ -480,7 +480,7 @@ private boolean isMultipartAllowed(EObject element) { * an element that defines a project context */ private boolean isMultipleDeploymentAllowed(EObject element) { - return CapellaModelPreferencesPlugin.getDefault().isMultipleDeploymentAllowed(); + return PreferencesHelper.isMultipleDeploymentAllowed(); } /** diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/MiscUtil.java b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/MiscUtil.java index 1faa39348e..799a12230a 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/MiscUtil.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.clipboard/src/org/polarsys/capella/core/platform/sirius/clipboard/util/MiscUtil.java @@ -34,12 +34,12 @@ import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.ICommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.lib.IdGenerator; import org.polarsys.capella.common.platform.sirius.ted.SemanticEditingDomainFactory.SemanticEditingDomain; -import org.polarsys.capella.core.platform.sirius.clipboard.Activator; import org.polarsys.capella.core.platform.sirius.clipboard.Messages; /** @@ -66,7 +66,7 @@ public static boolean transactionallyExecute(Collection selec if (e.getMessage() != null) { message = e.getMessage(); } - StatusManager.getManager().handle(new Status(IStatus.WARNING, Activator.PLUGIN_ID, message, e)); + StatusManager.getManager().handle(new Status(IStatus.WARNING, FrameworkUtil.getBundle(MiscUtil.class).getSymbolicName(), message, e)); result = false; } return result; diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/AllocationManagementAction.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/AllocationManagementAction.java index 069f09157f..f125caeb63 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/AllocationManagementAction.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/AllocationManagementAction.java @@ -39,7 +39,7 @@ import org.polarsys.capella.core.model.helpers.ComponentExchangeExt; import org.polarsys.capella.core.model.helpers.PhysicalComponentExt; import org.polarsys.capella.core.model.helpers.PhysicalLinkExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; /** */ @@ -183,7 +183,7 @@ public void allocatingPCPartsToPCPart(List targetElements, EObject sour public void allocatingFEsToComponentExchanges(List targetElements, EObject sourceElement) { if (sourceElement instanceof ComponentExchange) { ComponentExchange componentExchange = (ComponentExchange) sourceElement; - boolean shouldSyncronize = CapellaModelPreferencesPlugin.getDefault() + boolean shouldSyncronize = PreferencesHelper .isSynchronizationOfComponentPortToFunctionPortAllowed(); for (EObject object : targetElements) { @@ -213,7 +213,7 @@ public void allocatingFEsToComponentExchanges(List targetElements, EObj public void allocatingCEsToPhysicalLinks(List targetElements, EObject sourceElement) { if (sourceElement instanceof PhysicalLink) { PhysicalLink physicalLink = (PhysicalLink) sourceElement; - boolean shouldSyncronize = CapellaModelPreferencesPlugin.getDefault() + boolean shouldSyncronize = PreferencesHelper .isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed(); for (EObject object : targetElements) { diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaActionsActivator.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaActionsActivator.java index b3fab9a334..1d4309d970 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaActionsActivator.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaActionsActivator.java @@ -23,11 +23,6 @@ */ public class CapellaActionsActivator extends AbstractUIActivator { - /* - * - */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.ui.actions"; //$NON-NLS-1$ - /** * Shared instance. */ diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaDeleteAction.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaDeleteAction.java index 8fa92a7500..1181377e89 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaDeleteAction.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/actions/CapellaDeleteAction.java @@ -45,8 +45,8 @@ import org.polarsys.capella.core.data.oa.RolePkg; import org.polarsys.capella.core.data.pa.PaPackage; import org.polarsys.capella.core.model.helpers.BlockArchitectureExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.model.preferences.IDeletePreferences; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.platform.sirius.ui.commands.CapellaDeleteCommand; import org.polarsys.capella.core.platform.sirius.ui.commands.Messages; import org.polarsys.capella.core.ui.toolkit.AbstractCommandActionHandler; @@ -148,7 +148,7 @@ public static boolean canDelete(Collection selectedElements) { */ public static boolean isElementProtected(Element element) { - boolean specialElementProtectionAllowed = CapellaModelPreferencesPlugin.getDefault() + boolean specialElementProtectionAllowed = PreferencesHelper .isSpecialElementProtectionAllowed(); if (specialElementProtectionAllowed) { diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/CapellaDeleteCommand.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/CapellaDeleteCommand.java index d7b0234edc..e0a5619f68 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/CapellaDeleteCommand.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/CapellaDeleteCommand.java @@ -30,6 +30,7 @@ import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; import org.eclipse.swt.SWT; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.core.model.handler.command.BasicCapellaDeleteCommand; import org.polarsys.capella.core.model.handler.helpers.RepresentationHelper; @@ -148,7 +149,7 @@ public void run() { protected IStatus preDeleteChecks() { Set elementsToDelete = getAllElementsToDelete(); if (preventProtectedElementsDeletion && !CapellaDeleteAction.canDelete(elementsToDelete)) { - deletionStatus = new Status(Status.ERROR, CapellaActionsActivator.PLUGIN_ID, + deletionStatus = new Status(Status.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.CapellaDeleteCommand_ProtectedElementsError); } else { long nbRepresentations = elementsToDelete.stream().filter(DRepresentationDescriptor.class::isInstance).count(); @@ -174,7 +175,7 @@ protected IStatus preDeleteChecks() { } String message = MessageFormat.format(Messages.CapellaDeleteCommand_ConfirmDeletionQuestion, messageNbSemanticElement, messageNbRepresentation); - deletionStatus = new Status(status, CapellaActionsActivator.PLUGIN_ID, message); + deletionStatus = new Status(status, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); } return deletionStatus; diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/PasteCommandHelper.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/PasteCommandHelper.java index 677ae66e6b..007a7ea366 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/PasteCommandHelper.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/commands/PasteCommandHelper.java @@ -16,7 +16,6 @@ import java.util.Collections; import java.util.List; import java.util.Optional; -import java.util.stream.Collectors; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -31,16 +30,14 @@ import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.model.copypaste.SharedCopyPasteElements; import org.polarsys.capella.core.data.capellacore.CapellacorePackage; import org.polarsys.capella.core.data.cs.Component; import org.polarsys.capella.core.data.cs.ComponentPkg; import org.polarsys.capella.core.data.cs.CsPackage; import org.polarsys.capella.core.data.cs.Part; -import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper; -import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper.TriStateBoolean; import org.polarsys.capella.core.model.handler.helpers.CrossReferencerHelper; -import org.polarsys.capella.core.ui.toolkit.Activator; /** * Helper to ease paste commands to create when cut/copy/drag paste elements. @@ -111,12 +108,12 @@ public static IStatus createPasteCommands(Collection pasteElements, CompoundC commands.append(command); } else { // It was not possible to create the command - status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CapellaPasteCommand_error_command, null); + status = new Status(IStatus.ERROR, FrameworkUtil.getBundle(PasteCommandHelper.class).getSymbolicName(), Messages.CapellaPasteCommand_error_command, null); commands.append(UnexecutableCommand.INSTANCE); } } else { // Different session and no self contained element - status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CapellaPasteCommand_error_session, null); + status = new Status(IStatus.ERROR, FrameworkUtil.getBundle(PasteCommandHelper.class).getSymbolicName(), Messages.CapellaPasteCommand_error_session, null); commands.append(UnexecutableCommand.INSTANCE); } } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/ActionsPreferenceInitializer.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/ActionsPreferenceInitializer.java index 072fbc4bb4..625150e326 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/ActionsPreferenceInitializer.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/ActionsPreferenceInitializer.java @@ -15,10 +15,9 @@ import org.eclipse.core.resources.ProjectScope; import org.eclipse.core.runtime.preferences.DefaultScope; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; -import org.polarsys.capella.core.platform.sirius.ui.actions.CapellaActionsActivator; /** */ @@ -27,7 +26,7 @@ public class ActionsPreferenceInitializer extends AbstractPreferencesInitializer * @param pluginID */ public ActionsPreferenceInitializer() { - super(CapellaActionsActivator.PLUGIN_ID); + super(FrameworkUtil.getBundle(ActionsPreferenceInitializer.class).getSymbolicName()); } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesInitializer.java index 6963fb6099..fa79a29f00 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesInitializer.java @@ -13,9 +13,8 @@ package org.polarsys.capella.core.platform.sirius.ui.preferences; import org.eclipse.core.resources.ProjectScope; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; -import org.polarsys.capella.core.platform.sirius.ui.actions.CapellaActionsActivator; /** * Initialize preferences for capella model validation @@ -23,7 +22,7 @@ public class CapellaValidationPreferencesInitializer extends AbstractPreferencesInitializer { public CapellaValidationPreferencesInitializer() { - super(CapellaActionsActivator.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaValidationPreferencesInitializer.class).getSymbolicName()); } @Override diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesPage.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesPage.java index ba152c9431..5f472010b6 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesPage.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/preferences/CapellaValidationPreferencesPage.java @@ -13,9 +13,8 @@ package org.polarsys.capella.core.platform.sirius.ui.preferences; import org.eclipse.jface.preference.BooleanFieldEditor; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractDefaultPreferencePage; -import org.polarsys.capella.core.platform.sirius.ui.actions.CapellaActionsActivator; /** * This class represents a preference page that is contributed to the Preferences dialog. By subclassing FieldEditorPreferencePage, we can use the @@ -33,7 +32,7 @@ public class CapellaValidationPreferencesPage extends AbstractDefaultPreferenceP public static final String PROPERTY_PAGE_ID = "org.polarsys.capella.core.platform.sirius.ui.actions.preferences.CapellaValidationPreferences"; //$NON-NLS-1$ public CapellaValidationPreferencesPage() { - super(CapellaActionsActivator.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaValidationPreferencesPage.class).getSymbolicName()); setDescription(Messages.ModelValidationPreferencePage_Description); } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/session/CapellaSessionHelper.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/session/CapellaSessionHelper.java index 446c928653..9660911afd 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/session/CapellaSessionHelper.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.actions/src/org/polarsys/capella/core/platform/sirius/ui/session/CapellaSessionHelper.java @@ -48,6 +48,7 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.helpers.TransactionHelper; @@ -64,7 +65,6 @@ import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; import org.polarsys.capella.core.platform.sirius.ui.actions.CapellaActionsActivator; -import org.polarsys.capella.core.preferences.Activator; import org.polarsys.kitalpha.emde.xmi.UnknownEObject; /** @@ -357,7 +357,7 @@ public static IStatus handleLoadingErrors(Exception loadingException) { if (errorMsg != null) { //Due to org.eclipse.ui.statushandlers.WorkbenchStatusDialogManager performing modification of //displayed exception message, status message must be different of the exception message - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, errorMsg, new RuntimeException(exception)); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(CapellaSessionHelper.class).getSymbolicName(), errorMsg, new RuntimeException(exception)); } return Status.OK_STATUS; } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/CapellaNavigatorPlugin.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/CapellaNavigatorPlugin.java index b29456f2ea..3e32ca26ce 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/CapellaNavigatorPlugin.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/CapellaNavigatorPlugin.java @@ -14,7 +14,6 @@ package org.polarsys.capella.core.platform.sirius.ui.navigator; import org.osgi.framework.BundleContext; - import org.polarsys.capella.common.ui.services.AbstractUIActivator; import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.platform.sirius.ui.navigator.preferences.CapellaNavigatorPreferencesInitializer; @@ -24,11 +23,6 @@ */ public class CapellaNavigatorPlugin extends AbstractUIActivator { - /* - * - */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.ui.navigator"; //$NON-NLS-1$ - // The shared instance. private static CapellaNavigatorPlugin __plugin; diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/actions/ShowInDiagramAction.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/actions/ShowInDiagramAction.java index e92146b3da..6b8165c01b 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/actions/ShowInDiagramAction.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/actions/ShowInDiagramAction.java @@ -43,12 +43,12 @@ import org.eclipse.ui.IViewPart; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.BaseSelectionListenerAction; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.core.data.cs.Component; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaAdapterHelper; import org.polarsys.capella.core.model.helpers.ComponentExt; -import org.polarsys.capella.core.platform.sirius.ui.navigator.CapellaNavigatorPlugin; import org.polarsys.capella.core.sirius.analysis.DiagramServices; /** @@ -87,7 +87,7 @@ public IStatus runWithStatus() { Set viewsFromEditor = getViewsFromEditor(activeEditor, semanticElements); if (viewsFromEditor.isEmpty()) { - return new Status(IStatus.INFO, CapellaNavigatorPlugin.PLUGIN_ID, + return new Status(IStatus.INFO, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.ShowInDiagramAction_UnknownElement_Message); } @@ -99,7 +99,7 @@ public IStatus runWithStatus() { // return a status containing the reason DDiagramElement diagramElement = viewsFromEditor.iterator().next(); String message = getUnavailableElementMessage(diagramElement); - return new Status(IStatus.INFO, CapellaNavigatorPlugin.PLUGIN_ID, message); + return new Status(IStatus.INFO, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); } if (activeEditor instanceof DialectEditor) { diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/preferences/CapellaNavigatorPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/preferences/CapellaNavigatorPreferencesInitializer.java index 06ff15ffc4..3ac75332ce 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/preferences/CapellaNavigatorPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.navigator/src/org/polarsys/capella/core/platform/sirius/ui/navigator/preferences/CapellaNavigatorPreferencesInitializer.java @@ -13,9 +13,8 @@ package org.polarsys.capella.core.platform.sirius.ui.navigator.preferences; import org.eclipse.jface.preference.IPreferenceStore; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; -import org.polarsys.capella.core.platform.sirius.ui.navigator.CapellaNavigatorPlugin; import org.polarsys.capella.core.preferences.Activator; /** @@ -25,7 +24,7 @@ public class CapellaNavigatorPreferencesInitializer extends AbstractPreferencesI /** */ public CapellaNavigatorPreferencesInitializer() { - super(CapellaNavigatorPlugin.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaNavigatorPreferencesInitializer.class).getSymbolicName()); } /** diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/META-INF/MANIFEST.MF index 06be5884ed..20292d3b8e 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.platform.sirius.ui.perspective;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.platform.sirius.ui.PerspectivePlugin Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy Export-Package: org.polarsys.capella.core.platform.sirius.ui, diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/src/org/polarsys/capella/core/platform/sirius/ui/PerspectivePlugin.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/src/org/polarsys/capella/core/platform/sirius/ui/PerspectivePlugin.java deleted file mode 100644 index 8a20859d89..0000000000 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.perspective/src/org/polarsys/capella/core/platform/sirius/ui/PerspectivePlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ - -package org.polarsys.capella.core.platform.sirius.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class PerspectivePlugin extends AbstractUIPlugin { - /** - * The shared instance - */ - private static PerspectivePlugin __plugin; - - /* - * - */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.ui.perspective"; //$NON-NLS-1$ - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context_p) throws Exception { - super.start(context_p); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context_p) throws Exception { - super.stop(context_p); - __plugin = null; - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static PerspectivePlugin getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/CapellaProjectActivator.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/CapellaProjectActivator.java index 4d9b091f0a..130de6463c 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/CapellaProjectActivator.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/CapellaProjectActivator.java @@ -30,8 +30,6 @@ public class CapellaProjectActivator extends AbstractUIActivator implements ISta // The shared instance private static CapellaProjectActivator __plugin; - public static final String PLUGIN_ID = "org.polarsys.capella.core.platform.sirius.ui.project"; //$NON-NLS-1$ - private MonitorFileSyncJob monitorFileSyncJob = new MonitorFileSyncJob(); /** diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/NewProjectWizard.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/NewProjectWizard.java index 84f1d3417c..52ec6f261c 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/NewProjectWizard.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/NewProjectWizard.java @@ -49,7 +49,7 @@ import org.polarsys.capella.core.platform.sirius.ui.project.operations.ProjectSessionCreationHelper; import org.polarsys.capella.core.platform.sirius.ui.project.operations.SessionCreationHelper; import org.polarsys.capella.core.preferences.configuration.project.nature.ConfigurationProjectNature; -import org.polarsys.capella.core.preferences.configuration.project.ui.wizards.ReferecedConfigurationProjectSelectionPage; +import org.polarsys.capella.core.preferences.configuration.project.ui.wizards.ReferencedConfigurationProjectSelectionPage; import org.polarsys.capella.core.sirius.ui.actions.OpenSessionAction; /** @@ -74,7 +74,7 @@ public class NewProjectWizard extends BasicNewResourceWizard { private WizardPage viewpointWizardPage; - private ReferecedConfigurationProjectSelectionPage referencedConfigurationProjectPage; + private ReferencedConfigurationProjectSelectionPage referencedConfigurationProjectPage; /** * Constructs the wizard allowing to initialize a new Capella project. @@ -105,7 +105,7 @@ public void addPages() { */ protected void createReferencedConfigurationProjectsPage() { referencedConfigurationProjectPage = - new ReferecedConfigurationProjectSelectionPage(Messages.getString("NewModelWizard.title"), new String[] { ConfigurationProjectNature.NATURE_ID }); + new ReferencedConfigurationProjectSelectionPage(Messages.getString("NewModelWizard.title"), new String[] { ConfigurationProjectNature.NATURE_ID }); addPage(referencedConfigurationProjectPage); } diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/WizardNewProjectCreationPage.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/WizardNewProjectCreationPage.java index d987d532fa..e9b26738b7 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/WizardNewProjectCreationPage.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/WizardNewProjectCreationPage.java @@ -46,7 +46,7 @@ import org.polarsys.capella.core.model.handler.command.CapellaResourceNamingHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaProjectHelper.ProjectApproach; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.platform.sirius.ui.project.internal.ProjectContentsLocationArea.IErrorMessageReporter; /** @@ -204,7 +204,7 @@ protected void createProjectApproachGroup(Composite parent) { } selectedButton.setSelection(true); - boolean isReuseOfComponentsAllowed = CapellaModelPreferencesPlugin.getDefault().isReuseOfComponentsAllowed(); + boolean isReuseOfComponentsAllowed = PreferencesHelper.isReuseOfComponentsAllowed(); radioRC.setEnabled(isReuseOfComponentsAllowed); radioSC.setEnabled(isReuseOfComponentsAllowed); radioBox.setEnabled(isReuseOfComponentsAllowed); diff --git a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/preferences/PreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/preferences/PreferencesInitializer.java index 648f1f4816..7caac91d58 100644 --- a/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/preferences/PreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.platform.sirius.ui.project/src/org/polarsys/capella/core/platform/sirius/ui/project/internal/preferences/PreferencesInitializer.java @@ -13,8 +13,8 @@ package org.polarsys.capella.core.platform.sirius.ui.project.internal.preferences; import org.eclipse.jface.preference.IPreferenceStore; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; -import org.polarsys.capella.core.platform.sirius.ui.project.CapellaProjectActivator; import org.polarsys.capella.core.preferences.Activator; /** @@ -25,7 +25,7 @@ public class PreferencesInitializer extends AbstractPreferencesInitializer { * @param pluginID_p */ public PreferencesInitializer() { - super(CapellaProjectActivator.PLUGIN_ID); + super(FrameworkUtil.getBundle(PreferencesInitializer.class).getSymbolicName()); } /** diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/META-INF/MANIFEST.MF index 9a3d183004..eba093b9bd 100644 --- a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/META-INF/MANIFEST.MF @@ -15,8 +15,6 @@ Export-Package: org.polarsys.capella.core.preferences.configuration.project, org.polarsys.capella.core.preferences.configuration.project.actions, org.polarsys.capella.core.preferences.configuration.project.nature, org.polarsys.capella.core.preferences.configuration.project.ui.wizards, - org.polarsys.capella.core.preferences.project.configuration.project, - org.polarsys.capella.core.preferences.trasferers -Bundle-Activator: org.polarsys.capella.core.preferences.project.configuration.project.ConfigurationPlugin + org.polarsys.capella.core.preferences.transferers Bundle-ActivationPolicy: lazy Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ProjectWizard.java b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ProjectWizard.java index 18ddc2004b..e2e18189b9 100644 --- a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ProjectWizard.java +++ b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ProjectWizard.java @@ -33,10 +33,12 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.preferences.configuration.project.nature.ConfigurationProjectNature; -import org.polarsys.capella.core.preferences.configuration.project.ui.wizards.ReferecedConfigurationProjectSelectionPage; -import org.polarsys.capella.core.preferences.project.configuration.project.ConfigurationPlugin; +import org.polarsys.capella.core.preferences.configuration.project.ui.wizards.ReferencedConfigurationProjectSelectionPage; +import org.polarsys.capella.core.preferences.project.configuration.utils.Utils; /** * @@ -46,6 +48,8 @@ public class ProjectWizard extends BasicNewResourceWizard { private static final int STEP_TICK_COUNT = 100; private static final String CAPELLA_PROJECT_NATURE_ID = "org.polarsys.capella.project.nature"; + + public static final String PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG = "config_project_wizard.gif"; //$NON-NLS-1$ // Reuse of the new project page provided by the platform UI dialogs. protected WizardProjectCreationPage _localProjectDescriptionPage; @@ -53,7 +57,7 @@ public class ProjectWizard extends BasicNewResourceWizard { // The New Model wizard page. protected NewModelWizardPage _modelPage; - private ReferecedConfigurationProjectSelectionPage referencersProjectsPage; + private ReferencedConfigurationProjectSelectionPage referencersProjectsPage; public static ProjectScope projectScope; @@ -74,8 +78,8 @@ public void addPages() { protected void createReferencersProjectsPages() { referencersProjectsPage = - new ReferecedConfigurationProjectSelectionPage("Capella Configuration Project", "Referencers Capella Project", - ConfigurationPlugin.getImageDescriptor(ConfigurationPlugin.PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG), + new ReferencedConfigurationProjectSelectionPage("Capella Configuration Project", "Referencers Capella Project", + Utils.getImageDescriptor(PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG), new String[] { CAPELLA_PROJECT_NATURE_ID }); addPage(referencersProjectsPage); @@ -108,7 +112,7 @@ protected ProjectContentsLocationArea handleDefaultProjectLocation(Composite par mainPage.setInitialProjectName(null); mainPage.setDescription("Create a new project configuration"); //$NON-NLS-1$ mainPage.setTitle("Capella Configuration Project"); //$NON-NLS-1$ - mainPage.setImageDescriptor(ConfigurationPlugin.getWizadrConfigurationProjectIcon()); + mainPage.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Utils.ICONS_PATH + PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG)); return mainPage; } diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferecedConfigurationProjectSelectionPage.java b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferencedConfigurationProjectSelectionPage.java similarity index 89% rename from core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferecedConfigurationProjectSelectionPage.java rename to core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferencedConfigurationProjectSelectionPage.java index 8b0c91ae76..6aac56330f 100644 --- a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferecedConfigurationProjectSelectionPage.java +++ b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/configuration/project/ui/wizards/ReferencedConfigurationProjectSelectionPage.java @@ -28,8 +28,10 @@ import org.eclipse.jface.viewers.CheckboxCellEditor; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ColumnViewerToolTipSupport; +import org.eclipse.jface.viewers.DecorationOverlayIcon; import org.eclipse.jface.viewers.IBaseLabelProvider; import org.eclipse.jface.viewers.ICellModifier; +import org.eclipse.jface.viewers.IDecoration; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; @@ -54,13 +56,14 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.ide.IDE.SharedImages; import org.polarsys.capella.core.preferences.configuration.project.ConfigurationProject; +import org.polarsys.capella.core.preferences.configuration.project.ProjectWizard; import org.polarsys.capella.core.preferences.configuration.project.nature.ConfigurationProjectNature; -import org.polarsys.capella.core.preferences.project.configuration.project.ConfigurationPlugin; +import org.polarsys.capella.core.preferences.project.configuration.utils.Utils; /** * A class which to show swt widgets with available viewpoints. */ -public final class ReferecedConfigurationProjectSelectionPage extends WizardPage { +public final class ReferencedConfigurationProjectSelectionPage extends WizardPage { /* * @@ -79,16 +82,16 @@ public final class ReferecedConfigurationProjectSelectionPage extends WizardPage /** * @param pageName_p */ - public ReferecedConfigurationProjectSelectionPage(String pageName_p, String[] projectsNaturesIds) { - this(pageName_p, "Referenced Capella Configuration Project", ConfigurationPlugin - .getImageDescriptor(ConfigurationPlugin.PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG), projectsNaturesIds); + public ReferencedConfigurationProjectSelectionPage(String pageName_p, String[] projectsNaturesIds) { + this(pageName_p, "Referenced Capella Configuration Project", Utils + .getImageDescriptor(ProjectWizard.PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG), projectsNaturesIds); initilizeSelectedProject(projectsNaturesIds); } /** * @param pageName_p */ - public ReferecedConfigurationProjectSelectionPage(String pageName_p, String title, ImageDescriptor imageDescriptor_p, String[] all) { + public ReferencedConfigurationProjectSelectionPage(String pageName_p, String title, ImageDescriptor imageDescriptor_p, String[] all) { super(pageName_p, title, imageDescriptor_p); initilizeSelectedProject(all); this.labelProvider = new WizardTableLabelProvider(); @@ -312,14 +315,16 @@ private Image getOtherProjectIcon() { IWorkbench workbench = PlatformUI.getWorkbench(); ISharedImages sharedImages = workbench.getSharedImages(); Image image = sharedImages.getImage(SharedImages.IMG_OBJ_PROJECT); - image = ConfigurationPlugin.getOverlayedDescriptor(image, "capella_8x8.png").createImage(); + final ImageDescriptor decoratorDescriptor = Utils.getImageDescriptor("capella_8x8.png"); + image = new DecorationOverlayIcon(image, decoratorDescriptor, IDecoration.TOP_RIGHT).createImage(); return image; } private Image getConfigurationProjectIcon() { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); Image image = sharedImages.getImage(SharedImages.IMG_OBJ_PROJECT); - image = ConfigurationPlugin.getOverlayedDescriptor(image, "config_8x8.gif").createImage(); + final ImageDescriptor decoratorDescriptor = Utils.getImageDescriptor("config_8x8.gif"); + image = new DecorationOverlayIcon(image, decoratorDescriptor, IDecoration.TOP_RIGHT).createImage(); return image; } @@ -334,9 +339,9 @@ public Image getImage(final Object element) { case 0: if (element instanceof ConfigurationProject) { final ConfigurationProject vp = (ConfigurationProject) element; - image = ConfigurationPlugin.getImageDescriptor("disabled_checkbox.gif").createImage(); + image = Utils.getImageDescriptor("disabled_checkbox.gif").createImage(); if (vp.getIsSelected()) { - image = ConfigurationPlugin.getImageDescriptor("enabled_checkbox.gif").createImage(); + image = Utils.getImageDescriptor("enabled_checkbox.gif").createImage(); } } break; diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/project/ConfigurationPlugin.java b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/project/ConfigurationPlugin.java deleted file mode 100644 index a8550551b9..0000000000 --- a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/project/ConfigurationPlugin.java +++ /dev/null @@ -1,104 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.preferences.project.configuration.project; - -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.DecorationOverlayIcon; -import org.eclipse.jface.viewers.IDecoration; -import org.eclipse.swt.graphics.Image; -import org.osgi.framework.BundleContext; - -public class ConfigurationPlugin extends Plugin { - - private static ConfigurationPlugin plugin; - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.preferences.project.configuration";//$NON-NLS-1$ - - private static final String ICONS = "icons/"; //$NON-NLS-1$ - - public static final String PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG = "config_project_wizard.gif"; //$NON-NLS-1$ - - /** - * The constructor - */ - public ConfigurationPlugin() { - super(); - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static ConfigurationPlugin getDefault() { - return plugin; - } - - /** - *

- * Returns an {@link ImageDescriptor}whose path, relative to the plugin directory's icons/ directory, is imageFile. If the image - * descriptor cannot be created, either because the file does not exist or because of an internal error, then the result is the Eclipse default - * "missing image" descriptor. - *

- *

- * Note that the file specified must not have any leading "." or path separators "/" or "\". It is strictly relative to the icons/ directory. - * @param imageFile the name of the image file to retrieve - * @return the corresponding image descriptor - */ - public static ImageDescriptor getImageDescriptor(String imageFile) { - URL fullPath = FileLocator.find(getDefault().getBundle(), new Path(ICONS + imageFile), null); - if (fullPath != null) { - return ImageDescriptor.createFromURL(fullPath); - } - - return ImageDescriptor.getMissingImageDescriptor(); - } - - public static ImageDescriptor getWizadrConfigurationProjectIcon() { - - return getImageDescriptor(ConfigurationPlugin.PROJECT_WIZARD_CONFIGURATION_FOLDER_IMG); - } - - /** - * @param baseImage - * @param decoratorPath - * @return - */ - public static ImageDescriptor getOverlayedDescriptor(final Image baseImage, final String decoratorPath) { - final ImageDescriptor decoratorDescriptor = ConfigurationPlugin.getImageDescriptor(decoratorPath); - return new DecorationOverlayIcon(baseImage, decoratorDescriptor, IDecoration.TOP_RIGHT); - } -} diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/utils/Utils.java b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/utils/Utils.java new file mode 100644 index 0000000000..a4815871b7 --- /dev/null +++ b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/project/configuration/utils/Utils.java @@ -0,0 +1,37 @@ +package org.polarsys.capella.core.preferences.project.configuration.utils; + +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.resource.ImageDescriptor; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; + +public class Utils { + + Utils() {} + + public static final String ICONS_PATH = "icons/"; //$NON-NLS-1$ + + /** + *

+ * Returns an {@link ImageDescriptor}whose path, relative to the plugin directory's icons/ directory, is imageFile. If the image + * descriptor cannot be created, either because the file does not exist or because of an internal error, then the result is the Eclipse default + * "missing image" descriptor. + *

+ *

+ * Note that the file specified must not have any leading "." or path separators "/" or "\". It is strictly relative to the icons/ directory. + * @param imageFile the name of the image file to retrieve + * @return the corresponding image descriptor + */ + public static ImageDescriptor getImageDescriptor(String imageFile) { + Bundle bundle = FrameworkUtil.getBundle(Utils.class); + URL fullPath = FileLocator.find(bundle, new Path(ICONS_PATH + imageFile), null); + if (fullPath != null) { + return ImageDescriptor.createFromURL(fullPath); + } + + return ImageDescriptor.getMissingImageDescriptor(); + } +} diff --git a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/trasferers/WizardPreferencesTransfererExportPage.java b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/transferers/WizardPreferencesTransfererExportPage.java similarity index 99% rename from core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/trasferers/WizardPreferencesTransfererExportPage.java rename to core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/transferers/WizardPreferencesTransfererExportPage.java index 9b06905b6f..3be039d012 100644 --- a/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/trasferers/WizardPreferencesTransfererExportPage.java +++ b/core/plugins/org.polarsys.capella.core.preferences.project.configuration/src/org/polarsys/capella/core/preferences/transferers/WizardPreferencesTransfererExportPage.java @@ -10,7 +10,7 @@ * Contributors: * Thales - initial API and implementation *******************************************************************************/ -package org.polarsys.capella.core.preferences.trasferers; +package org.polarsys.capella.core.preferences.transferers; import java.io.File; import java.io.FileOutputStream; diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/CommandsPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/CommandsPreferencesInitializer.java index 59f01058fb..e49842c655 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/CommandsPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/CommandsPreferencesInitializer.java @@ -21,10 +21,9 @@ import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.IItemDescriptor; import org.polarsys.capella.core.commands.preferences.service.PreferencesItemsRegistry; -import org.polarsys.capella.core.preferences.Activator; /** */ @@ -38,7 +37,7 @@ public void initializeDefaultPreferences() { Collection constraints = PreferencesItemsRegistry.getInstance().getAllDescriptors(); - IEclipsePreferences eclipsePreferenceNode = new DefaultScope().getNode(Activator.PLUGIN_ID); + IEclipsePreferences eclipsePreferenceNode = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); for (IItemDescriptor capellaPreferenceNode : constraints) { eclipsePreferenceNode.put(capellaPreferenceNode.getId(), String.valueOf(capellaPreferenceNode.isEnabledByDefault())); diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/preferences/ConfigurabilityPreferences.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/preferences/ConfigurabilityPreferences.java index 6808775a0e..174f584055 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/preferences/ConfigurabilityPreferences.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/preferences/ConfigurabilityPreferences.java @@ -15,20 +15,20 @@ import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.prefs.BackingStoreException; import org.polarsys.capella.core.commands.preferences.properties.PreferencesHandler; import org.polarsys.capella.core.commands.preferences.service.IItemDescriptor; import org.polarsys.capella.core.commands.preferences.service.PreferencesItemsRegistry; -import org.polarsys.capella.core.preferences.Activator; /** * Preferences manager for the commands plug-in. */ public class ConfigurabilityPreferences { - private static final IEclipsePreferences defaultScopPref = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); + private static final IEclipsePreferences defaultScopPref = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(ConfigurabilityPreferences.class).getSymbolicName()); - private static final IEclipsePreferences instanceScopPrefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + private static final IEclipsePreferences instanceScopPrefs = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(ConfigurabilityPreferences.class).getSymbolicName()); /** * Not instantiable, as all features are static. @@ -43,7 +43,7 @@ private ConfigurabilityPreferences() { public static void save() { try { - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).flush(); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(ConfigurabilityPreferences.class).getSymbolicName()).flush(); instanceScopPrefs.flush(); } catch (BackingStoreException exception) { diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/CapellaCommandsPreferencesPropertyTester.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/CapellaCommandsPreferencesPropertyTester.java index 728c708015..b844f9e765 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/CapellaCommandsPreferencesPropertyTester.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/CapellaCommandsPreferencesPropertyTester.java @@ -15,9 +15,9 @@ import org.eclipse.core.expressions.PropertyTester; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.eclipse.core.runtime.preferences.InstanceScope; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.IItemDescriptor; import org.polarsys.capella.core.commands.preferences.service.PreferencesItemsRegistry; -import org.polarsys.capella.core.preferences.Activator; public class CapellaCommandsPreferencesPropertyTester extends PropertyTester { @@ -42,7 +42,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe || CAPELLA_CMD_MODELING_PREFERENCES_PROPERTY.equals(property)) { IItemDescriptor itemDescriptor = PreferencesItemsRegistry.getInstance().getDescriptor((String) expectedValue); boolean defaultValue = itemDescriptor != null ? itemDescriptor.isEnabledByDefault() : true; - IEclipsePreferences commandsPreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + IEclipsePreferences commandsPreferences = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); return commandsPreferences.getBoolean((String) expectedValue, defaultValue); } return false; diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/PreferencesHandler.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/PreferencesHandler.java index 77bade0fe3..9c32611ce0 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/PreferencesHandler.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/properties/PreferencesHandler.java @@ -40,6 +40,7 @@ import org.eclipse.ui.handlers.IHandlerActivation; import org.eclipse.ui.handlers.IHandlerService; import org.eclipse.ui.menus.UIElement; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.IItemDescriptor; import org.polarsys.capella.core.commands.preferences.service.PreferencesItemsRegistry; import org.polarsys.capella.core.preferences.Activator; @@ -87,7 +88,7 @@ private void registerHandlerActivations(List activations) { } protected IEclipsePreferences getPreferences() { - return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + return InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); } private List getRegisteredHandlerActivations(IHandlerService service, String commandId) { diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/AbstractItemDescriptor.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/AbstractItemDescriptor.java index 9aaa7dac0b..97063712a7 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/AbstractItemDescriptor.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/AbstractItemDescriptor.java @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.internalization.l10n.CustomPreferencesMessages; import org.polarsys.capella.core.commands.preferences.internalization.l10n.CustomPreferencesStatusCodes; import org.polarsys.capella.core.commands.preferences.model.CategoryPreferences; @@ -228,7 +228,7 @@ protected void assertNotNull(Object value, String missingItem) if (value == null) { CoreException ce = new CoreException( new Status( IStatus.ERROR, - Activator.PLUGIN_ID, + FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CustomPreferencesStatusCodes.ITEM_NOT_INITED,Activator.getMessage(ITEM_INCOMPLETE, missingItem), null)); diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/PropertyStore.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/PropertyStore.java index 9cd2684144..803174f176 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/PropertyStore.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/PropertyStore.java @@ -28,6 +28,7 @@ import org.eclipse.jface.preference.PreferenceStore; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.config.registry.ReportManagerRegistry; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; import org.polarsys.capella.core.preferences.Activator; @@ -77,12 +78,12 @@ public PropertyStore(IResource _resource, IPreferenceStore _workbenchStore) { Activator.getDefault().setPropertyStore((IResource) _resource, this); scope = new ProjectScope((IProject) resource); - scope.getNode(Activator.PLUGIN_ID).addPreferenceChangeListener(this); + scope.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).addPreferenceChangeListener(this); initilizeGuestListeners(); } public void dispose() { - scope.getNode(Activator.PLUGIN_ID).removePreferenceChangeListener(this); + scope.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).removePreferenceChangeListener(this); } /** @@ -124,9 +125,9 @@ public void save() throws IOException { try { // to bypass other capella modeller preference page if ((resource instanceof IProject) && !isCanceled) { - resource.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, USEPROJECTSETTINGS), TRUE); // idk if its useful + resource.setPersistentProperty(new QualifiedName(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), USEPROJECTSETTINGS), TRUE); // idk if its useful writeProperties(); - scope.getNode(Activator.PLUGIN_ID).flush(); + scope.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).flush(); } } catch (Exception exception) { @@ -139,7 +140,7 @@ public void save() throws IOException { */ private void writeProperties() throws IOException { for (String name : preferenceNames()) { - scope.getNode(Activator.PLUGIN_ID).put(name, getString(name)); + scope.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).put(name, getString(name)); setProperty(name, getString(name)); } } @@ -155,8 +156,8 @@ private void writeProperties() throws IOException { */ private void setProperty(String name, String value) throws IOException { try { - scope.getNode(Activator.PLUGIN_ID).put(name, value); - resource.setPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, name), value); + scope.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).put(name, value); + resource.setPersistentProperty(new QualifiedName(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), name), value); } catch (CoreException e) { throw new IOException("PropertyStore.Cannot_write_resource_property" + name, e); //$NON-NLS-1$ } @@ -326,7 +327,7 @@ private synchronized void insertValue(String name) { * @throws CoreException */ private String getProperty(String name) throws CoreException { - return resource.getPersistentProperty(new QualifiedName(Activator.PLUGIN_ID, name)); + return resource.getPersistentProperty(new QualifiedName(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), name)); } /*** Misc ***/ diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/ScopedCapellaPreferencesStore.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/ScopedCapellaPreferencesStore.java index 03d35315d2..83038775ef 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/ScopedCapellaPreferencesStore.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/service/ScopedCapellaPreferencesStore.java @@ -31,6 +31,7 @@ import org.eclipse.core.runtime.preferences.IScopeContext; import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.ui.preferences.ScopedPreferenceStore; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.prefs.BackingStoreException; import org.polarsys.capella.common.tools.report.config.registry.ReportManagerRegistry; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; @@ -68,7 +69,7 @@ private ScopedCapellaPreferencesStore(String pluginId) { public static ScopedCapellaPreferencesStore getInstance(String pluginID_p) { if (instance == null) { // 1953: We share the same preference store. we don't want use the first one loaded. - instance = new ScopedCapellaPreferencesStore(Activator.PLUGIN_ID); + instance = new ScopedCapellaPreferencesStore(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); } return instance; } @@ -88,8 +89,8 @@ public void firePropertyChangeEvent(String name, Object oldValue, Object newValu protected static void putBoolean(IProject project, String optionName, boolean value) { String key = project != null ? project.getName() + PREFERENCE_SEPARATOR + optionName : optionName; - IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); - IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); + IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); + IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); String instanceValue = Platform.getPreferencesService().get(optionName, null, new IEclipsePreferences[] { instanceNode }); @@ -115,8 +116,8 @@ protected static void putBoolean(IProject project, String optionName, boolean va protected static void putInt(IProject project, String optionName, int value) { String key = project != null ? project.getName() + PREFERENCE_SEPARATOR + optionName : optionName; - IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); - IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); + IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); + IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); String instanceValue = Platform.getPreferencesService().get(optionName, null, new IEclipsePreferences[] { instanceNode }); @@ -143,8 +144,8 @@ protected static void putString(IProject project, String optionName, String valu String key = project != null ? project.getName() + PREFERENCE_SEPARATOR + optionName : optionName; - IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); - IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); + IEclipsePreferences instanceNode = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); + IEclipsePreferences defaultNode = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(ScopedCapellaPreferencesStore.class).getSymbolicName()); String instanceValue = Platform.getPreferencesService().get(optionName, null, new IEclipsePreferences[] { instanceNode }); @@ -360,16 +361,16 @@ public void setValue(String name, boolean value) { if (PreferencesHelper.hasConfigurationProject(project)) { IProject configuration = PreferencesHelper.getReferencedProjectConfiguration(project); if (getDefaultBoolean(name) == value) { - new ProjectScope(configuration).getNode(Activator.PLUGIN_ID).remove(name); + new ProjectScope(configuration).getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).remove(name); } else { - new ProjectScope(configuration).getNode(Activator.PLUGIN_ID).putBoolean(name, value); + new ProjectScope(configuration).getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).putBoolean(name, value); } } } if (getDefaultBoolean(name) == value) { - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).remove(name); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).remove(name); } else { - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).putBoolean(name, value); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).putBoolean(name, value); } } @@ -384,25 +385,25 @@ public void setValue(String name, String value) { IProject configuration = PreferencesHelper.getReferencedProjectConfiguration(project); if (getDefaultString(name) == value) { - new ProjectScope(configuration).getNode(Activator.PLUGIN_ID).remove(name); + new ProjectScope(configuration).getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).remove(name); } else { - new ProjectScope(configuration).getNode(Activator.PLUGIN_ID).put(name, value); + new ProjectScope(configuration).getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).put(name, value); } } } if (getDefaultString(name) == value) { - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).remove(name); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).remove(name); } else { - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).put(name, value); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).put(name, value); } } public void saveForExport() { try { - IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID); - IEclipsePreferences instancePreferences = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + IEclipsePreferences defaultPreferences = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); + IEclipsePreferences instancePreferences = InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); Collection instanceKeys = Arrays.asList(instancePreferences.keys()); for (String name: defaultPreferences.keys()) { if (!instanceKeys.contains(name)) { @@ -460,7 +461,7 @@ public boolean contains(String name) { contexts = new IScopeContext[] { InstanceScope.INSTANCE, DefaultScope.INSTANCE }; } - contains = service.getString(Activator.PLUGIN_ID, key, null, contexts) != null; + contains = service.getString(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), key, null, contexts) != null; return contains; } diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/CapellaPreferencesService.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/CapellaPreferencesService.java index 62f89eaf9b..f42c5385db 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/CapellaPreferencesService.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/CapellaPreferencesService.java @@ -28,10 +28,10 @@ import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.emf.validation.preferences.EMFModelValidationPreferences; import org.eclipse.swt.widgets.Display; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; import org.polarsys.capella.common.tools.report.config.registry.ReportManagerRegistry; import org.polarsys.capella.common.tools.report.util.IReportManagerDefaultComponents; -import org.polarsys.capella.core.preferences.Activator; public class CapellaPreferencesService { @@ -170,7 +170,7 @@ private IEclipsePreferences convertFromProperties(Properties properties) { } current.put(key, value); - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).put(key, value); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).put(key, value); // new DefaultScope().getNode(Activator.PLUGIN_ID).put(key, value); } diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/PreferencesHelper.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/PreferencesHelper.java index 88208529a8..a2d3a32bd9 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/PreferencesHelper.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/PreferencesHelper.java @@ -53,6 +53,7 @@ import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.preferences.ScopedPreferenceStore; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; import org.polarsys.capella.common.helpers.EcoreUtil2; @@ -63,7 +64,6 @@ import org.polarsys.capella.core.data.capellamodeller.Project; import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; import org.polarsys.capella.core.model.handler.helpers.CapellaAdapterHelper; -import org.polarsys.capella.core.preferences.Activator; public class PreferencesHelper { private PreferencesHelper() { @@ -252,19 +252,19 @@ public static ScopedPreferenceStore getProjectScopeOld(IProject targetProject) { IScopeContext scope = targetProject != null ? ScopedCapellaPreferencesStore.getProjectScope(targetProject) : null; try { if (scope != null) { - IEclipsePreferences node = scope.getNode(Activator.PLUGIN_ID); + IEclipsePreferences node = scope.getNode(FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); node.flush(); ScopedCapellaPreferencesStore.getProjectContexts().put(targetProject.getProject(), scope); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } } catch (Exception exception) { StringBuilder loggerMessage = new StringBuilder("Activator.getProjectScope(..) _ "); //$NON-NLS-1$ __logger.error(loggerMessage.toString(), exception); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } - return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(InstanceScope.INSTANCE, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } @@ -277,16 +277,16 @@ public static ScopedPreferenceStore getProjectScope(IProject targetProject) { try { if (scope != null) { ScopedCapellaPreferencesStore.getProjectContexts().put(targetProject.getProject(), scope); - return ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID); + return ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } } catch (Exception exception) { StringBuilder loggerMessage = new StringBuilder("Activator.getProjectScope(..) _ "); //$NON-NLS-1$ __logger.error(loggerMessage.toString(), exception); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } - return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(InstanceScope.INSTANCE, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } @@ -298,19 +298,19 @@ public static ScopedPreferenceStore getDefaultProjectScope(IProject targetProjec IScopeContext scope = targetProject != null ? ScopedCapellaPreferencesStore.getProjectScope(targetProject) : null; try { if (scope != null) { - IEclipsePreferences node = scope.getNode(Activator.PLUGIN_ID); + IEclipsePreferences node = scope.getNode(FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); node.flush(); ScopedCapellaPreferencesStore.getProjectContexts().put(targetProject.getProject(), scope); - return ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID); + return ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } } catch (Exception exception) { StringBuilder loggerMessage = new StringBuilder("Activator.getProjectScope(..) _ "); //$NON-NLS-1$ __logger.error(loggerMessage.toString(), exception); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } - return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(InstanceScope.INSTANCE, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } @@ -322,19 +322,19 @@ public static ScopedPreferenceStore getDefaultProjectScopeOld(IProject targetPro IScopeContext scope = targetProject != null ? ScopedCapellaPreferencesStore.getProjectScope(targetProject) : null; try { if (scope != null) { - IEclipsePreferences node = scope.getNode(Activator.PLUGIN_ID); + IEclipsePreferences node = scope.getNode(FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); node.flush(); ScopedCapellaPreferencesStore.getProjectContexts().put(targetProject.getProject(), scope); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } } catch (Exception exception) { StringBuilder loggerMessage = new StringBuilder("Activator.getProjectScope(..) _ "); //$NON-NLS-1$ __logger.error(loggerMessage.toString(), exception); - return new ScopedPreferenceStore(scope, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(scope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } - return new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID); + return new ScopedPreferenceStore(InstanceScope.INSTANCE, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName()); } @@ -350,7 +350,7 @@ public static List getAllPreferencesStores() { if (targetProject.isOpen() && targetProject.isAccessible() && (CapellaResourceHelper.isCapellaProject(targetProject))) { IScopeContext projectScope = ScopedCapellaPreferencesStore.getProjectScope(targetProject); - scopes.add(new ScopedPreferenceStore(projectScope, Activator.PLUGIN_ID)); + scopes.add(new ScopedPreferenceStore(projectScope, FrameworkUtil.getBundle(PreferencesHelper.class).getSymbolicName())); } } catch (Exception exception) { StringBuilder loggerMessage = new StringBuilder("PreferencesHelper.getAllStores(..) _ "); //$NON-NLS-1$ diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/UserProfileDescriptor.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/UserProfileDescriptor.java index 785aa2933f..1e3e4fa296 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/UserProfileDescriptor.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/commands/preferences/util/UserProfileDescriptor.java @@ -13,11 +13,10 @@ package org.polarsys.capella.core.commands.preferences.util; import org.eclipse.core.runtime.CoreException; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.preferences.ConfigurabilityPreferences; import org.polarsys.capella.core.commands.preferences.service.AbstractItemDescriptor; import org.polarsys.capella.core.commands.preferences.service.PreferencesItemsRegistry; -import org.polarsys.capella.core.preferences.Activator; import org.polarsys.capella.core.preferences.commands.exceptions.ItemExistsException; /** @@ -32,8 +31,8 @@ public class UserProfileDescriptor extends AbstractItemDescriptor implements IUs public UserProfileDescriptor(String userProfileModeId,String userProfileModeName) { try { - assertNotNull(userProfileModeId, Activator.PLUGIN_ID); - assertNotNull(userProfileModeName, Activator.PLUGIN_ID); + assertNotNull(userProfileModeId, getPluginId()); + assertNotNull(userProfileModeName, getPluginId()); PreferencesItemsRegistry.getInstance().registerUserProfile(this); @@ -77,7 +76,7 @@ public String getId() { */ @Override public String getPluginId() { - return Activator.PLUGIN_ID; + return FrameworkUtil.getBundle(this.getClass()).getSymbolicName(); } /** diff --git a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/preferences/Activator.java b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/preferences/Activator.java index 9e8167ab6d..08845c3d80 100644 --- a/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/preferences/Activator.java +++ b/core/plugins/org.polarsys.capella.core.preferences/src/org/polarsys/capella/core/preferences/Activator.java @@ -42,6 +42,7 @@ import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.preferences.ScopedPreferenceStore; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.osgi.service.event.Event; import org.polarsys.capella.core.commands.preferences.internalization.l10n.CustomPreferencesMessages; import org.polarsys.capella.core.commands.preferences.model.CategoryPreferences; @@ -89,9 +90,6 @@ public class Activator extends AbstractUIPlugin { */ public static final String PREFERENCES_PROVIDERS_EXT_P_NAME = "capellaPreferences"; //$NON-NLS-1$ - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.preferences"; //$NON-NLS-1$ - // The shared instance private static Activator plugin; @@ -128,14 +126,14 @@ public void start(BundleContext context) throws Exception { @Override public void handleEvent(Event event) { - ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID).saveForExport(); + ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).saveForExport(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (IProject project : projects) { if (PreferencesHelper.hasConfigurationProject(project)) { try { IProject configProject = PreferencesHelper.getReferencedProjectConfiguration(project); - new ProjectScope(configProject).getNode(Activator.PLUGIN_ID).flush(); + new ProjectScope(configProject).getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()).flush(); configProject.refreshLocal(IResource.DEPTH_INFINITE, null); project.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (Exception exception) { @@ -157,7 +155,7 @@ public void handleEvent(Event event) { public IPreferenceStore getPreferenceStore() { // Create the preference store lazily. if (preferenceStore == null) { - preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, Activator.PLUGIN_ID); + preferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); } return preferenceStore; } @@ -202,7 +200,7 @@ public void removeExtension(IExtension extension, Object[] objects) { extensionTracker.registerHandler(extensionHandler, null); - IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, + IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Activator.PREFERENCES_PROVIDERS_EXT_P_NAME); IExtensionTracker extTracker = Activator.getExtensionTracker(); if (extTracker != null) { @@ -235,7 +233,7 @@ public static IExtensionTracker getExtensionTracker() { public void loadCategories() { if (Platform.isRunning()) { - IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, + IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Activator.PREFERENCES_PROVIDERS_EXT_P_NAME); IExtensionTracker extTracker = Activator.getExtensionTracker(); diff --git a/core/plugins/org.polarsys.capella.core.projection.exchanges/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.projection.exchanges/META-INF/MANIFEST.MF index e7270a50c4..d40d7876bc 100644 --- a/core/plugins/org.polarsys.capella.core.projection.exchanges/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.projection.exchanges/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.projection.exchanges;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.projection.exchanges.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.tiger, diff --git a/core/plugins/org.polarsys.capella.core.projection.exchanges/src/org/polarsys/capella/core/projection/exchanges/Activator.java b/core/plugins/org.polarsys.capella.core.projection.exchanges/src/org/polarsys/capella/core/projection/exchanges/Activator.java deleted file mode 100644 index 0d1cb89b53..0000000000 --- a/core/plugins/org.polarsys.capella.core.projection.exchanges/src/org/polarsys/capella/core/projection/exchanges/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.projection.exchanges; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.projection.exchanges"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - //Empty bloc - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.projection.interfaces/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.projection.interfaces/META-INF/MANIFEST.MF index dc09139f96..2087f4f6e8 100644 --- a/core/plugins/org.polarsys.capella.core.projection.interfaces/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.projection.interfaces/META-INF/MANIFEST.MF @@ -12,5 +12,4 @@ Require-Bundle: org.polarsys.capella.core.projection.common, org.polarsys.capella.core.transition.system.topdown Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.core.projection.interfaces.InterfaceGenerationActivator Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/InterfaceGenerationActivator.java b/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/InterfaceGenerationActivator.java deleted file mode 100644 index 893426e88a..0000000000 --- a/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/InterfaceGenerationActivator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.projection.interfaces; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class InterfaceGenerationActivator extends Plugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.projection.interfaces"; //$NON-NLS-1$ - - // The shared instance - private static InterfaceGenerationActivator plugin; - - /** - * The constructor - */ - public InterfaceGenerationActivator() { - // - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static InterfaceGenerationActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/validation/DWF_I_23_GenerateInterfacesValidator.java b/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/validation/DWF_I_23_GenerateInterfacesValidator.java index 128929e659..6777039823 100644 --- a/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/validation/DWF_I_23_GenerateInterfacesValidator.java +++ b/core/plugins/org.polarsys.capella.core.projection.interfaces/src/org/polarsys/capella/core/projection/interfaces/validation/DWF_I_23_GenerateInterfacesValidator.java @@ -20,13 +20,15 @@ import java.util.Map; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.AbstractModelConstraint; import org.eclipse.emf.validation.IValidationContext; import org.eclipse.emf.validation.internal.service.AbstractValidationContext; import org.eclipse.emf.validation.model.ConstraintStatus; import org.eclipse.emf.validation.model.IModelConstraint; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EObjectLabelProviderHelper; import org.polarsys.capella.core.data.cs.Interface; import org.polarsys.capella.core.data.fa.ComponentExchange; @@ -34,7 +36,6 @@ import org.polarsys.capella.core.data.fa.FunctionalExchange; import org.polarsys.capella.core.data.information.ExchangeItem; import org.polarsys.capella.core.projection.interfaces.InterfaceGeneration; -import org.polarsys.capella.core.projection.interfaces.InterfaceGenerationActivator; import org.polarsys.capella.core.projection.interfaces.InterfaceGenerationPreferences; import org.polarsys.capella.core.projection.interfaces.generateInterfaces.InterfaceGenerationResult; @@ -98,8 +99,8 @@ private Collection getAlreadyCheckedInterfaces(IValidationContext ctx } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { if (!loggedWorkaroundError){ loggedWorkaroundError = true; - InterfaceGenerationActivator.getDefault().getLog().log(new Status(IStatus.ERROR, InterfaceGenerationActivator.PLUGIN_ID, - "Cannot use cache for rule DWF_I_23. Some results for this rule may appear multiple times.", e)); //$NON-NLS-1$ + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error("Cannot use cache for rule DWF_I_23. Some results for this rule may appear multiple times.", e); //$NON-NLS-1$ } } finally { if (f != null) { diff --git a/core/plugins/org.polarsys.capella.core.projection.scenario/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.projection.scenario/META-INF/MANIFEST.MF index b0900fa3e3..ecbea42ce1 100644 --- a/core/plugins/org.polarsys.capella.core.projection.scenario/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.projection.scenario/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.projection.scenario;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.projection.scenario.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.tiger, diff --git a/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/Activator.java b/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/Activator.java deleted file mode 100644 index d6d8e18fb0..0000000000 --- a/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.projection.scenario; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.projection.df2is"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - //Empty bloc - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/uml2/rules/Rule_StateFragment.java b/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/uml2/rules/Rule_StateFragment.java index d8217fb0d9..8291f15518 100644 --- a/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/uml2/rules/Rule_StateFragment.java +++ b/core/plugins/org.polarsys.capella.core.projection.scenario/src/org/polarsys/capella/core/projection/scenario/uml2/rules/Rule_StateFragment.java @@ -20,11 +20,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.information.AbstractInstance; import org.polarsys.capella.core.data.interaction.InteractionPackage; import org.polarsys.capella.core.data.interaction.StateFragment; import org.polarsys.capella.core.projection.common.context.IContext; -import org.polarsys.capella.core.projection.scenario.Activator; import org.polarsys.capella.core.projection.scenario.common.rules.Rule_CapellaElement; import org.polarsys.capella.core.projection.scenario.helpers.IScenarioHelper; import org.polarsys.capella.core.tiger.ITransfo; @@ -46,7 +46,7 @@ public IStatus transformRequired(EObject element_p, IContext context_p) { StateFragment source = (StateFragment) element_p; List relatedElements = IScenarioHelper.getInstance(context_p).getTargetRelatedElements(source, context_p); if (relatedElements.isEmpty()) { - return new Status(IStatus.WARNING, Activator.PLUGIN_ID, "State Fragment is not transitioned"); + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "State Fragment is not transitioned"); } return super.transformRequired(element_p, context_p); } diff --git a/core/plugins/org.polarsys.capella.core.re.project/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.re.project/META-INF/MANIFEST.MF index 01c76ff909..c7400b47fe 100644 --- a/core/plugins/org.polarsys.capella.core.re.project/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.re.project/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.re.project;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.re.project.ReProjectActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.osgi, org.eclipse.jface, diff --git a/core/plugins/org.polarsys.capella.core.re.project/src/org/polarsys/capella/core/re/project/ReProjectActivator.java b/core/plugins/org.polarsys.capella.core.re.project/src/org/polarsys/capella/core/re/project/ReProjectActivator.java deleted file mode 100644 index a7023aeace..0000000000 --- a/core/plugins/org.polarsys.capella.core.re.project/src/org/polarsys/capella/core/re/project/ReProjectActivator.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.re.project; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class ReProjectActivator implements BundleActivator { - - public static final String PLUGIN_ID = "org.polarsys.capella.core.re.project"; //$NON-NLS-1$ - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - ReProjectActivator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - ReProjectActivator.context = null; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/META-INF/MANIFEST.MF index 1fecd116ba..07e7ab9127 100644 --- a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.re.ui.quickfix;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.re.ui.quickfix.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, @@ -15,5 +14,4 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-ActivationPolicy: lazy Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.polarsys.capella.core.re.ui.quickfix, - org.polarsys.capella.core.re.ui.quickfix.resolver +Export-Package: org.polarsys.capella.core.re.ui.quickfix.resolver diff --git a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/Activator.java b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/Activator.java deleted file mode 100644 index d9538780ca..0000000000 --- a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/Activator.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.re.ui.quickfix; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIActivator { - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_04_Resolver.java b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_04_Resolver.java index 7f7cb32664..f5b7023f4e 100644 --- a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_04_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_04_Resolver.java @@ -20,13 +20,13 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.re.CatalogElement; import org.polarsys.capella.common.re.CatalogElementKind; import org.polarsys.capella.common.re.CatalogElementLink; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class DCON_04_Resolver extends AbstractCapellaMarkerResolution { @@ -64,7 +64,7 @@ protected void deleteMarker(IMarker marker) { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(AbstractCapellaMarkerResolution.class).getSymbolicName(), exception.getMessage(), exception)); } } } diff --git a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_06_Resolver.java b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_06_Resolver.java index 96ff75d637..1225fe3ada 100644 --- a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_06_Resolver.java +++ b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/DCON_06_Resolver.java @@ -20,12 +20,12 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.re.CatalogElement; import org.polarsys.capella.common.re.CatalogElementKind; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; public class DCON_06_Resolver extends AbstractCapellaMarkerResolution { @@ -60,7 +60,7 @@ protected void deleteMarker(IMarker marker) { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(AbstractCapellaMarkerResolution.class).getSymbolicName(), exception.getMessage(), exception)); } } } diff --git a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/I_43_Replace.java b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/I_43_Replace.java index 0e1677a58e..cee80882ea 100644 --- a/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/I_43_Replace.java +++ b/core/plugins/org.polarsys.capella.core.re.ui.quickfix/src/org/polarsys/capella/core/re/ui/quickfix/resolver/I_43_Replace.java @@ -15,16 +15,11 @@ import java.util.List; import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; -import org.eclipse.ui.statushandlers.StatusManager; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.re.CatalogElementLink; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** diff --git a/core/plugins/org.polarsys.capella.core.re.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.re.ui/META-INF/MANIFEST.MF index 1836039dfd..5a5ab5df57 100644 --- a/core/plugins/org.polarsys.capella.core.re.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.re.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.re.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.re.ui.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.ui.toolkit, @@ -25,8 +24,7 @@ Require-Bundle: org.eclipse.ui, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.re.ui, - org.polarsys.capella.core.re.ui.copyformat, +Export-Package: org.polarsys.capella.core.re.ui.copyformat, org.polarsys.capella.core.re.ui.handlers, org.polarsys.capella.core.re.ui.propertyTester, org.polarsys.capella.core.re.ui.renderers, diff --git a/core/plugins/org.polarsys.capella.core.re.ui/src/org/polarsys/capella/core/re/ui/Activator.java b/core/plugins/org.polarsys.capella.core.re.ui/src/org/polarsys/capella/core/re/ui/Activator.java deleted file mode 100644 index d0fa129e19..0000000000 --- a/core/plugins/org.polarsys.capella.core.re.ui/src/org/polarsys/capella/core/re/ui/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.re.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.re.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/META-INF/MANIFEST.MF index 210aba1633..a34dc593b6 100644 --- a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.re.updateconnections.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.re.updateconnections.ui.UpdateConnectionsUIActivator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.common.flexibility.properties, diff --git a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/UpdateConnectionsUIActivator.java b/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/UpdateConnectionsUIActivator.java deleted file mode 100644 index 06fdbd7a07..0000000000 --- a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/UpdateConnectionsUIActivator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.re.updateconnections.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class UpdateConnectionsUIActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.re.updatelinks"; //$NON-NLS-1$ - - // The shared instance - private static UpdateConnectionsUIActivator plugin; - - /** - * The constructor - */ - public UpdateConnectionsUIActivator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 UpdateConnectionsUIActivator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/properties/CatalogElementSelection.java b/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/properties/CatalogElementSelection.java index 98888c92ca..ebd8a24835 100644 --- a/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/properties/CatalogElementSelection.java +++ b/core/plugins/org.polarsys.capella.core.re.updateconnections.ui/src/org/polarsys/capella/core/re/updateconnections/ui/properties/CatalogElementSelection.java @@ -17,13 +17,13 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.property.AbstractProperty; import org.polarsys.capella.common.flexibility.properties.schema.IEditableProperty; import org.polarsys.capella.common.flexibility.properties.schema.IProperty; import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext; import org.polarsys.capella.common.flexibility.properties.schema.IRestraintProperty; import org.polarsys.capella.common.re.CatalogElement; -import org.polarsys.capella.core.re.updateconnections.ui.UpdateConnectionsUIActivator; /** * Select one of all available catalog elements. @@ -76,7 +76,7 @@ public IStatus validate(Object newValue, IPropertyContext context) { for (IProperty property : context.getProperties().getAllItems()) { if (property instanceof CatalogElementSelection && !this.equals(property)) { if (value.equals(context.getCurrentValue(property))) { - return new Status(IStatus.ERROR, UpdateConnectionsUIActivator.PLUGIN_ID, "Selected RPLs must be different"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Selected RPLs must be different"); } } } diff --git a/core/plugins/org.polarsys.capella.core.re.validation/src/org/polarsys/capella/core/re/validation/design/consistency/DCON_02_Rpl2RecConformanceConstraint.java b/core/plugins/org.polarsys.capella.core.re.validation/src/org/polarsys/capella/core/re/validation/design/consistency/DCON_02_Rpl2RecConformanceConstraint.java index 10c33b8198..13dfc49a4f 100644 --- a/core/plugins/org.polarsys.capella.core.re.validation/src/org/polarsys/capella/core/re/validation/design/consistency/DCON_02_Rpl2RecConformanceConstraint.java +++ b/core/plugins/org.polarsys.capella.core.re.validation/src/org/polarsys/capella/core/re/validation/design/consistency/DCON_02_Rpl2RecConformanceConstraint.java @@ -25,6 +25,7 @@ import org.eclipse.emf.validation.model.ConstraintStatus; import org.eclipse.emf.validation.service.ConstraintRegistry; import org.eclipse.emf.validation.service.IConstraintDescriptor; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EObjectExt; import org.polarsys.capella.common.re.Activator; import org.polarsys.capella.common.re.CatalogElement; @@ -43,7 +44,7 @@ public IStatus validate(IValidationContext ctx) { if (catalogElement.getKind() == CatalogElementKind.RPL) { CatalogElement rec = catalogElement.getOrigin(); if (rec == null || rec.eIsProxy()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Your RPL is invalid (no REC), please validate your model."); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(Activator.class).getSymbolicName(), "Your RPL is invalid (no REC), please validate your model."); } // if rec is valid return validateRPL(ctx, catalogElement); diff --git a/core/plugins/org.polarsys.capella.core.re/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.re/META-INF/MANIFEST.MF index 887579812e..62233dd750 100644 --- a/core/plugins/org.polarsys.capella.core.re/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.re/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.re;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.re.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.commands, @@ -20,7 +19,6 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Export-Package: - org.polarsys.capella.core.re, org.polarsys.capella.core.re.activities, org.polarsys.capella.core.re.commands, org.polarsys.capella.core.re.delete, diff --git a/core/plugins/org.polarsys.capella.core.re/src/org/polarsys/capella/core/re/Activator.java b/core/plugins/org.polarsys.capella.core.re/src/org/polarsys/capella/core/re/Activator.java deleted file mode 100644 index 01e309d5c8..0000000000 --- a/core/plugins/org.polarsys.capella.core.re/src/org/polarsys/capella/core/re/Activator.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.re; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.semantic.queries/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.semantic.queries/META-INF/MANIFEST.MF index 0c21a01aa8..9e2b042fe0 100644 --- a/core/plugins/org.polarsys.capella.core.semantic.queries/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.semantic.queries/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.semantic.queries;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.semantic.queries.Activator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.model.handler, org.polarsys.capella.core.model.helpers, @@ -12,8 +11,7 @@ Require-Bundle: org.polarsys.capella.core.model.handler, org.eclipse.sirius.table, org.polarsys.capella.core.sirius.analysis Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.semantic.queries, - org.polarsys.capella.core.semantic.queries.basic.queries, +Export-Package: org.polarsys.capella.core.semantic.queries.basic.queries, org.polarsys.capella.core.semantic.queries.basic.queries.utils, org.polarsys.capella.core.semantic.queries.sirius.annotation, org.polarsys.capella.core.semantic.queries.sirius.annotation.eoi, diff --git a/core/plugins/org.polarsys.capella.core.semantic.queries/src/org/polarsys/capella/core/semantic/queries/Activator.java b/core/plugins/org.polarsys.capella.core.semantic.queries/src/org/polarsys/capella/core/semantic/queries/Activator.java deleted file mode 100644 index 8bdc1158bd..0000000000 --- a/core/plugins/org.polarsys.capella.core.semantic.queries/src/org/polarsys/capella/core/semantic/queries/Activator.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.semantic.queries; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.semantic.queries"; //$NON-NLS-1$ - - /** - * The constructor - */ - public Activator() { - // do nothing - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - } -} diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.sirius.analysis/META-INF/MANIFEST.MF index e1126b22be..2405f68fb3 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/META-INF/MANIFEST.MF @@ -53,7 +53,8 @@ Require-Bundle: org.eclipse.core.expressions, org.apache.batik.transcoder;bundle-version="1.14.0", org.apache.batik.dom;bundle-version="1.14.0", org.apache.batik.bridge;bundle-version="1.14.0", - org.polarsys.kitalpha.sirius.rotativeimage;bundle-version="6.0.0" + org.polarsys.kitalpha.sirius.rotativeimage;bundle-version="6.0.0", + org.polarsys.capella.core.model.preferences Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CapellaServices.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CapellaServices.java index eadd377771..866d1503f5 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CapellaServices.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CapellaServices.java @@ -183,7 +183,7 @@ import org.polarsys.capella.core.model.helpers.FunctionalChainExt; import org.polarsys.capella.core.model.helpers.PartExt; import org.polarsys.capella.core.model.helpers.ScenarioExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.platform.sirius.ui.commands.CapellaDeleteCommand; import org.polarsys.capella.core.sirius.analysis.tool.StringUtil; @@ -2436,7 +2436,7 @@ public boolean isGeneralizable(final EObject context, EObject source, EObject ta if (source instanceof Component) { Component sourceComp = (Component) source; if (!sourceComp.isActor() - && !CapellaModelPreferencesPlugin.getDefault().isComponentNonActorInheritanceAllowed()) { + && !PreferencesHelper.isComponentNonActorInheritanceAllowed()) { return false; } if (target instanceof Component) { @@ -2547,7 +2547,7 @@ public boolean isLinkedWithInternalControlNode(Pin pin) { * return the 'Allow Multiple Inheritance' preference value */ private boolean isMultipleInheritanceAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed(); + return PreferencesHelper.isMultipleInheritanceAllowed(); } public boolean isNull(EObject current) { diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CsServices.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CsServices.java index 7b7421a02b..5466aa0685 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CsServices.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/CsServices.java @@ -208,7 +208,7 @@ import org.polarsys.capella.core.model.helpers.PhysicalLinkCategoryExt; import org.polarsys.capella.core.model.helpers.PortExt; import org.polarsys.capella.core.model.helpers.SystemEngineeringExt; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.model.utils.CapellaLayerCheckingExt; import org.polarsys.capella.core.sirius.analysis.constants.IFilterNameConstants; import org.polarsys.capella.core.sirius.analysis.constants.MappingConstantsHelper; @@ -1634,7 +1634,7 @@ public boolean isGeneralizableForReConnect(final EObject context, EObject newSou return superTargetsContainsSource; } - if (!CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed()) { + if (!PreferencesHelper.isMultipleInheritanceAllowed()) { if (CapellaServices.getService().getSuperClassifiers(newSourceClazz, generalization).size() == 1) { return true; } @@ -1656,7 +1656,7 @@ public boolean isGeneralizableForReConnect(final EObject context, EObject newSou // check to avoid inheritance cycle boolean existCycle = !CapellaServices.getService().getSuperClassifiers(sourceClass).contains(targetClass) && !CapellaServices.getService().getSuperClassifiers(targetClass).contains(sourceClass); - if (!CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed()) { + if (!PreferencesHelper.isMultipleInheritanceAllowed()) { if (existCycle) { if (CapellaServices.getService().getSuperClassifiers(sourceClass).size() == 1) { return true; @@ -1744,7 +1744,7 @@ public boolean isGeneralizableForReConnectOld(final EObject context, EObject sou } if (subSourcesConatinsTarget) { - return CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed() && superTargetsContainsSource; + return PreferencesHelper.isMultipleInheritanceAllowed() && superTargetsContainsSource; } return notExistCycle; @@ -1763,7 +1763,7 @@ public boolean isGeneralizableForReConnectOld(final EObject context, EObject sou // check to avoid inheritance cycle boolean existCycle = !CapellaServices.getService().getSuperClassifiers(sourceClass).contains(targetClass) && !CapellaServices.getService().getSuperClassifiers(targetClass).contains(sourceClass); - if (!CapellaModelPreferencesPlugin.getDefault().isMultipleInheritanceAllowed()) { + if (!PreferencesHelper.isMultipleInheritanceAllowed()) { if (existCycle) { if (CapellaServices.getService().getSuperClassifiers(sourceClass).size() == 1) { return true; @@ -1794,7 +1794,7 @@ public boolean isGeneralizableForReConnectOld(final EObject context, EObject sou */ public boolean preGeneralization(EObject generalization, EObject preSource) { if (preSource instanceof Component && !((Component) preSource).isActor()) { - return CapellaModelPreferencesPlugin.getDefault().isComponentNonActorInheritanceAllowed(); + return PreferencesHelper.isComponentNonActorInheritanceAllowed(); } return true; } @@ -1843,7 +1843,7 @@ public boolean canReconnectGeneralization(EObject generalization, EObject subObj if ((source instanceof Component) && (target instanceof Component)) { if (!(((Component) source).isActor() && ((Component) target).isActor()) - && !CapellaModelPreferencesPlugin.getDefault().isComponentNonActorInheritanceAllowed()) { + && !PreferencesHelper.isComponentNonActorInheritanceAllowed()) { return false; } diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/PhysicalServices.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/PhysicalServices.java index 8f61bf39c0..f12cea9c21 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/PhysicalServices.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/PhysicalServices.java @@ -60,7 +60,6 @@ import org.polarsys.capella.core.business.queries.IBusinessQuery; import org.polarsys.capella.core.business.queries.capellacore.BusinessQueriesProvider; import org.polarsys.capella.core.commands.preferences.service.ScopedCapellaPreferencesStore; -import org.polarsys.capella.core.commands.preferences.util.PreferencesHelper; import org.polarsys.capella.core.data.capellacore.CapellaElement; import org.polarsys.capella.core.data.cs.AbstractDeploymentLink; import org.polarsys.capella.core.data.cs.AbstractPathInvolvedElement; @@ -101,7 +100,7 @@ import org.polarsys.capella.core.model.helpers.graph.PhysicalPathInternalLinksGraph.InternalLinkEdge; import org.polarsys.capella.core.model.helpers.graph.PhysicalPathInvolvementGraph; import org.polarsys.capella.core.model.helpers.graph.PhysicalPathInvolvementGraph.InvolvementEdge; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.sirius.analysis.cache.DEdgeIconCache; import org.polarsys.capella.core.sirius.analysis.cache.PhysicalPathCache; import org.polarsys.capella.core.sirius.analysis.constants.MappingConstantsHelper; @@ -126,7 +125,7 @@ public static PhysicalServices getService() { private static final String INVALID_PHYSICAL_PATH_LABEL = "invalid"; //$NON-NLS-1$ public boolean isMultipleDeploymentAllowed() { - return CapellaModelPreferencesPlugin.getDefault().isMultipleDeploymentAllowed(); + return PreferencesHelper.isMultipleDeploymentAllowed(); } /** @@ -1160,7 +1159,7 @@ public String getPhysicalPathLabel(PhysicalPath path, DDiagram diagram) { String label = EObjectExt.getText(path); boolean isComplete = isCompletePhysicalPath(path, diagram); - IProject project = PreferencesHelper.getProject(path); + IProject project = org.polarsys.capella.core.commands.preferences.util.PreferencesHelper.getProject(path); boolean displayIncompleteLabel = !isComplete && ScopedCapellaPreferencesStore .getBoolean(DiagramProcessChainPathPreferencePage.NAME_PREF_DISPLAY_INCOMPLETE_IN_PHYSICAL_PATH_LABEL, project); boolean isValid = PhysicalPathExt.isPhysicalPathValid(path); diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/StateMachineServices.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/StateMachineServices.java index 00e8a0ad43..d647a7c1be 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/StateMachineServices.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/StateMachineServices.java @@ -75,7 +75,7 @@ import org.polarsys.capella.core.model.helpers.ComponentExt; import org.polarsys.capella.core.model.helpers.StateExt; import org.polarsys.capella.core.model.helpers.move.MoveHelper; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.sirius.analysis.constants.MappingConstantsHelper; import org.polarsys.capella.core.sirius.analysis.showhide.AbstractShowHide.DiagramContext; import org.polarsys.capella.core.sirius.analysis.showhide.ShowHideSMStateMode; @@ -737,7 +737,7 @@ private boolean isUndoublonLink(DSemanticDecorator sourceElement, DSemanticDecor public boolean canCreateMode(EObject context, EObject containerView) { Region testedRegion = getRegionFromView(containerView); if (testedRegion != null) { - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { return MoveHelper.getInstance().canMoveModeState(CapellacommonFactory.eINSTANCE.createMode(), testedRegion); } //If there is a State, then can't create a Mode @@ -809,7 +809,7 @@ private Region getRegionFromView(EObject containerView) { public boolean canCreateState(EObject context, EObject containerView) { Region testedRegion = getRegionFromView(containerView); if (testedRegion != null) { - if (!CapellaModelPreferencesPlugin.getDefault().isMixedModeStateAllowed()) { + if (!PreferencesHelper.isMixedModeStateAllowed()) { return MoveHelper.getInstance().canMoveModeState(CapellacommonFactory.eINSTANCE.createState(), testedRegion); } diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/activator/SiriusViewActivator.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/activator/SiriusViewActivator.java index a3f3592ff3..7786e546e4 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/activator/SiriusViewActivator.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/activator/SiriusViewActivator.java @@ -29,6 +29,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.sirius.analysis.helpers.DDiagramHelper; import org.polarsys.capella.core.sirius.analysis.preferences.DiagramPreferenceInitializer; import org.polarsys.capella.core.sirius.analysis.preferences.TitleBlockPreferencesInitializer; @@ -36,7 +37,7 @@ public class SiriusViewActivator extends AbstractUIPlugin { - public static final String ID = "org.polarsys.capella.core.sirius.analysis"; //$NON-NLS-1$ + public static final String ID = FrameworkUtil.getBundle(SiriusViewActivator.class).getSymbolicName(); //$NON-NLS-1$ private static SiriusViewActivator instance; diff --git a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/preferences/TitleBlockPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/preferences/TitleBlockPreferencesInitializer.java index 19de35b955..a5345c2d5a 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/preferences/TitleBlockPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.sirius.analysis/src/org/polarsys/capella/core/sirius/analysis/preferences/TitleBlockPreferencesInitializer.java @@ -13,6 +13,7 @@ package org.polarsys.capella.core.sirius.analysis.preferences; import org.eclipse.jface.preference.IPreferenceStore; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; import org.polarsys.capella.core.commands.preferences.service.ScopedCapellaPreferencesStore; import org.polarsys.capella.core.platform.sirius.ui.actions.CapellaActionsActivator; @@ -20,12 +21,12 @@ public class TitleBlockPreferencesInitializer extends AbstractPreferencesInitializer { public TitleBlockPreferencesInitializer() { - super(CapellaActionsActivator.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaActionsActivator.class).getSymbolicName()); } @Override public void initializeDefaultPreferences() { - IPreferenceStore preferenceStore = ScopedCapellaPreferencesStore.getInstance(CapellaActionsActivator.PLUGIN_ID); + IPreferenceStore preferenceStore = ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(CapellaActionsActivator.class).getSymbolicName()); preferenceStore.setDefault(TitleBlockPreferencePage.COLUMNS_NUMBER_PREFERENCE_STORE, 2); preferenceStore.setDefault(TitleBlockPreferencePage.LINES_NUMBER_PREFERENCE_STORE, 2); preferenceStore.setDefault(TitleBlockPreferencePage.TABLE_CONTENT_PREFERENCE_STORE, TitleBlockPreferencePage.DEFAULT_TABLE); diff --git a/core/plugins/org.polarsys.capella.core.sirius.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.sirius.ui/META-INF/MANIFEST.MF index a00a5bfd12..bc14d664d5 100644 --- a/core/plugins/org.polarsys.capella.core.sirius.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.sirius.ui/META-INF/MANIFEST.MF @@ -49,5 +49,4 @@ Export-Package: org.polarsys.capella.core.sirius.ui, org.polarsys.capella.core.sirius.ui.wizard Bundle-ActivationPolicy: lazy Bundle-Activator: org.polarsys.capella.core.sirius.ui.SiriusUIPlugin -Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.tiger/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.tiger/META-INF/MANIFEST.MF index 3b47295e58..ed459bf756 100644 --- a/core/plugins/org.polarsys.capella.core.tiger/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.tiger/META-INF/MANIFEST.MF @@ -26,7 +26,6 @@ Export-Package: org.polarsys.capella.core.tiger; org.polarsys.capella.core.data.la, org.eclipse.emf.ecore", org.polarsys.capella.core.tiger.impl -Bundle-Activator: org.polarsys.capella.core.tiger.Activator Bundle-ActivationPolicy: lazy Eclipse-BuddyPolicy: registered Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/Activator.java b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/Activator.java deleted file mode 100644 index e363fc5a77..0000000000 --- a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.tiger; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.tiger"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - // - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoEngine.java b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoEngine.java index 9cbab9b3e2..77896d8975 100644 --- a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoEngine.java +++ b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoEngine.java @@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.osgi.util.NLS; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.helpers.modellingcore.utils.HoldingResourceFilter; import org.polarsys.capella.common.data.modellingcore.AbstractTrace; import org.polarsys.capella.common.helpers.EObjectExt; @@ -39,7 +40,6 @@ import org.polarsys.capella.core.data.capellacommon.GenericTrace; import org.polarsys.capella.core.data.capellacore.CapellaElement; import org.polarsys.capella.core.model.handler.helpers.HoldingResourceHelper; -import org.polarsys.capella.core.tiger.Activator; import org.polarsys.capella.core.tiger.IFinalizer; import org.polarsys.capella.core.tiger.ITransfo; import org.polarsys.capella.core.tiger.ITransfoEngine; @@ -292,7 +292,7 @@ public void execute(ITransfo transfo) throws TransfoException { */ public void preExecute(ITransfo transfo) throws CoreException, Exception { IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] elements = registry.getConfigurationElementsFor(Activator.PLUGIN_ID); + IConfigurationElement[] elements = registry.getConfigurationElementsFor(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); for (final IConfigurationElement element : elements) { if (TRANSFO_EXTENSION.equals(element.getName())) { ITransfoEngineExecuteExt extension = (ITransfoEngineExecuteExt) element.createExecutableExtension("class"); //$NON-NLS-1$ @@ -314,7 +314,7 @@ public void postExecute(ITransfo transfo) { try { IExtensionRegistry registry = Platform.getExtensionRegistry(); - IConfigurationElement[] elements = registry.getConfigurationElementsFor(Activator.PLUGIN_ID); + IConfigurationElement[] elements = registry.getConfigurationElementsFor(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); for (final IConfigurationElement element : elements) { if (TRANSFO_EXTENSION.equals(element.getName())) { ITransfoEngineExecuteExt extension = (ITransfoEngineExecuteExt) element.createExecutableExtension("class"); //$NON-NLS-1$ diff --git a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleBase.java b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleBase.java index 05f97820fc..7824f6ed06 100644 --- a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleBase.java +++ b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleBase.java @@ -24,7 +24,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.osgi.framework.Bundle; -import org.polarsys.capella.core.tiger.Activator; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.tiger.ITransfo; import org.polarsys.capella.core.tiger.ITransfoRule; import org.polarsys.capella.core.tiger.ITransfoRuleBase; @@ -175,7 +175,7 @@ public void loadRule(Class ruleClass) { */ public void loadRules(String rulePkgName, String[] classNames) throws ClassNotFoundException { - Bundle bundle = Activator.getDefault().getBundle(); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); for (String className : classNames) { Class class_ = bundle.loadClass(rulePkgName + "." + className); //$NON-NLS-1$ loadRule(class_); diff --git a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleLoader.java b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleLoader.java index a814f3eb07..996b734596 100644 --- a/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleLoader.java +++ b/core/plugins/org.polarsys.capella.core.tiger/src/org/polarsys/capella/core/tiger/impl/TransfoRuleLoader.java @@ -25,9 +25,8 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EClass; import org.osgi.framework.Bundle; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.core.tiger.Activator; import org.polarsys.capella.core.tiger.IResolver; /** @@ -278,7 +277,7 @@ public void loadContext(String contextName) { */ private void loadResolvers() { IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry(); - IConfigurationElement[] elementsForPlugin = extensionRegistry.getConfigurationElementsFor(Activator.PLUGIN_ID); + IConfigurationElement[] elementsForPlugin = extensionRegistry.getConfigurationElementsFor(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); TreeSet elements = new TreeSet(new Comparator() { public int compare(IConfigurationElement arg0, IConfigurationElement arg1) { diff --git a/core/plugins/org.polarsys.capella.core.transition.common.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.transition.common.ui/META-INF/MANIFEST.MF index aa5d3f99bb..e515f504fd 100644 --- a/core/plugins/org.polarsys.capella.core.transition.common.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.transition.common.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.transition.common.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.common.ui.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -17,9 +16,7 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.preferences, org.polarsys.capella.common.ui Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.transition.common.ui, - org.polarsys.capella.core.transition.common.ui.actions, - org.polarsys.capella.core.transition.common.ui.commands, +Export-Package: org.polarsys.capella.core.transition.common.ui.commands, org.polarsys.capella.core.transition.common.ui.dialogs, org.polarsys.capella.core.transition.common.ui.handlers.merge, org.polarsys.capella.core.transition.common.ui.handlers.options, diff --git a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/Activator.java b/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/Activator.java deleted file mode 100644 index a367bbde3f..0000000000 --- a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/Activator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.transition.common.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.common.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/DiffComparisonViewer.java b/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/DiffComparisonViewer.java index 937badd9b4..35fd2baf0d 100644 --- a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/DiffComparisonViewer.java +++ b/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/DiffComparisonViewer.java @@ -45,8 +45,8 @@ import org.eclipse.ui.IActionBars; import org.eclipse.ui.IWorkbenchPartSite; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.toolkit.viewers.menu.ModalContextMenuExtender; -import org.polarsys.capella.core.transition.common.ui.Activator; public class DiffComparisonViewer extends ComparisonViewer { @@ -147,7 +147,7 @@ protected Collection getExpandedElements(EMFDiffNode node) { } protected ImageDescriptor getImageDescriptor(String key) { - ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/ctool16/" + key); + ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/ctool16/" + key); return desc; } diff --git a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/MergeCategoryManager.java b/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/MergeCategoryManager.java index 71b356fcbb..c1700fa315 100644 --- a/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/MergeCategoryManager.java +++ b/core/plugins/org.polarsys.capella.core.transition.common.ui/src/org/polarsys/capella/core/transition/common/ui/handlers/merge/MergeCategoryManager.java @@ -19,8 +19,8 @@ import org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategory; import org.eclipse.emf.diffmerge.ui.viewers.IDifferenceCategorySet; import org.eclipse.emf.diffmerge.ui.viewers.categories.DifferenceCategorySet; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.ScopedCapellaPreferencesStore; -import org.polarsys.capella.core.preferences.Activator; import org.polarsys.capella.core.transition.common.constants.ITransitionConstants; import org.polarsys.capella.core.transition.common.handlers.merge.ICategoryItem; import org.polarsys.capella.core.transition.common.handlers.merge.ICategorySet; @@ -111,7 +111,7 @@ public void initializeFromPreferences() { Object purposeValue = context.get(ITransitionConstants.TRANSPOSER_PURPOSE); if (purposeValue instanceof String) { String purpose = (String) purposeValue; - ScopedCapellaPreferencesStore scps = ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID); + ScopedCapellaPreferencesStore scps = ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); for (IDifferenceCategory category : getCategories()) { String isActiveKey = getIsActiveKey(purpose, category); @@ -137,7 +137,7 @@ public void saveToPreferences() { if (purposeValue instanceof String) { String purpose = (String) purposeValue; - ScopedCapellaPreferencesStore scps = ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID); + ScopedCapellaPreferencesStore scps = ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); for (IDifferenceCategory category : this.getCategories()) { String isActiveKey = getIsActiveKey(purpose, category); diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.transition.diagram.ui/META-INF/MANIFEST.MF index 9638733f83..f73fa2a6e8 100644 --- a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.transition.diagram.ui/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.transition.diagram.ui;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.diagram.ui.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/Activator.java b/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/Activator.java deleted file mode 100644 index 0f04440397..0000000000 --- a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/Activator.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.transition.diagram.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.diagram.ui"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - //Do nothing - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/handlers/AbstractRunnableHandler.java b/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/handlers/AbstractRunnableHandler.java index 27cd0bf730..2355ddfdf4 100644 --- a/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/handlers/AbstractRunnableHandler.java +++ b/core/plugins/org.polarsys.capella.core.transition.diagram.ui/src/org/polarsys/capella/core/transition/diagram/ui/handlers/AbstractRunnableHandler.java @@ -18,8 +18,8 @@ import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PlatformUI; import org.polarsys.capella.common.ui.services.commands.AbstractUiHandler; -import org.polarsys.capella.core.transition.diagram.ui.Activator; /** * @@ -51,7 +51,7 @@ protected IRunnableWithProgress createRunnable(ExecutionEvent event_p) { protected Shell getActiveShell(ExecutionEvent event_p) { IWorkbenchPart part = (IWorkbenchPart) getVariableValue(event_p, ACTIVE_PART_VARIABLE); if (part == null) { - return Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(); + return PlatformUI.getWorkbench().getDisplay().getActiveShell(); } return part.getSite().getShell(); } diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.transition.diagram/META-INF/MANIFEST.MF index f9c5368951..38a9cb8609 100644 --- a/core/plugins/org.polarsys.capella.core.transition.diagram/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.transition.diagram/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.transition.diagram;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.diagram.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, @@ -22,11 +21,11 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.platform.sirius.ui.actions, org.polarsys.capella.core.projection.common;visibility:=reexport, org.polarsys.capella.core.sirius.analysis, - org.polarsys.capella.core.transition.system;visibility:=reexport + org.polarsys.capella.core.transition.system;visibility:=reexport, + org.eclipse.ui.workbench Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.transition.diagram, - org.polarsys.capella.core.transition.diagram.commands, +Export-Package: org.polarsys.capella.core.transition.diagram.commands, org.polarsys.capella.core.transition.diagram.constants, org.polarsys.capella.core.transition.diagram.handlers, org.polarsys.capella.core.transition.diagram.helpers diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/Activator.java b/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/Activator.java deleted file mode 100644 index 7cc217c2c7..0000000000 --- a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.transition.diagram; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.diagram"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/AbstractProcessingCommands.java b/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/AbstractProcessingCommands.java index 1c37ed9087..e06e2038eb 100644 --- a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/AbstractProcessingCommands.java +++ b/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/AbstractProcessingCommands.java @@ -17,12 +17,12 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.sirius.business.api.session.Session; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.utils.RunnableWithBooleanResult; import org.polarsys.capella.core.transition.common.context.TransitionContext; -import org.polarsys.capella.core.transition.diagram.Activator; import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext; /** @@ -63,7 +63,7 @@ public String getName() { */ @Override public void commandRolledBack() { - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, getName()); + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), getName()); } public void run() { @@ -75,7 +75,7 @@ public void run() { if (exception_p.getMessage() != null) { message += ": " + exception_p.getMessage(); } - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, exception_p); + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message, exception_p); } } }); @@ -85,7 +85,7 @@ public void run() { if (exception_p.getMessage() != null) { message += ": " + exception_p.getMessage(); } - result[0] = new Status(IStatus.ERROR, Activator.PLUGIN_ID, message, exception_p); + result[0] = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message, exception_p); } return result[0]; } diff --git a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/DiagramTransitionRunnable.java b/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/DiagramTransitionRunnable.java index 931ee1a5f3..ccbe056a91 100644 --- a/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/DiagramTransitionRunnable.java +++ b/core/plugins/org.polarsys.capella.core.transition.diagram/src/org/polarsys/capella/core/transition/diagram/commands/DiagramTransitionRunnable.java @@ -12,8 +12,6 @@ *******************************************************************************/ package org.polarsys.capella.core.transition.diagram.commands; -import static org.polarsys.capella.core.data.helpers.cache.ModelCache.getCache; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -82,6 +80,9 @@ import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.AbstractType; import org.polarsys.capella.common.data.modellingcore.TraceableElement; import org.polarsys.capella.common.helpers.EObjectExt; @@ -91,19 +92,15 @@ import org.polarsys.capella.core.data.cs.BlockArchitecture; import org.polarsys.capella.core.data.cs.Component; import org.polarsys.capella.core.data.cs.Part; -import org.polarsys.capella.core.data.pa.PhysicalArchitecture; import org.polarsys.capella.core.diagram.helpers.DiagramHelper; import org.polarsys.capella.core.model.handler.helpers.RepresentationHelper; import org.polarsys.capella.core.model.helpers.BlockArchitectureExt; -import org.polarsys.capella.core.model.helpers.ComponentExt; import org.polarsys.capella.core.sirius.analysis.CapellaServices; import org.polarsys.capella.core.sirius.analysis.DDiagramContents; import org.polarsys.capella.core.sirius.analysis.DiagramServices; import org.polarsys.capella.core.sirius.analysis.ShapeUtil; import org.polarsys.capella.core.sirius.analysis.tool.HashMapSet; import org.polarsys.capella.core.transition.common.constants.ITransitionConstants; -import org.polarsys.capella.core.transition.diagram.Activator; -import org.polarsys.capella.core.transition.diagram.commands.DiagramTransitionRunnable.ExtendedViewRefactorHelper; import org.polarsys.capella.core.transition.diagram.handlers.DiagramDescriptionHelper; import org.polarsys.capella.core.transition.diagram.helpers.TraceabilityHelper; import org.polarsys.kitalpha.transposer.rules.handler.rules.api.IContext; @@ -236,20 +233,20 @@ protected IStatus proceedDiagram(final DRepresentation diagram, final IProgressM final IContext context = getContext(); if (!(diagram instanceof DSemanticDecorator)) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Invalid source diagram"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Invalid source diagram"); } context.put(SOURCE_DIAGRAM, diagram); // Retrieve semantic target of diagram final EObject sourceSemantic = ((DSemanticDecorator) diagram).getTarget(); if ((sourceSemantic == null) || sourceSemantic.eIsProxy()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Diagram with invalid semantic target"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Diagram with invalid semantic target"); } // Retrieve the current session final Session session = DiagramHelper.getService().getSession(diagram); if (session == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot retrieve session from the given diagram"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Cannot retrieve session from the given diagram"); } context.put(ITransitionConstants.TRANSITION_SOURCE_EDITING_DOMAIN, session.getTransactionalEditingDomain()); @@ -258,7 +255,7 @@ protected IStatus proceedDiagram(final DRepresentation diagram, final IProgressM // Retrieve the current description final RepresentationDescription description = DiagramHelper.getService().getDescription(diagram); if ((description == null) || description.eIsProxy()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Invalid source diagram (maybe a missing viewpoint)"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Invalid source diagram (maybe a missing viewpoint)"); } context.put(SOURCE_DESCRIPTION, description); @@ -353,9 +350,9 @@ public void run() { DRepresentation targetDiagram = (DRepresentation) getContext().get(TARGET_DIAGRAM); if (targetDiagram == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Invalid target diagram"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Invalid target diagram"); } - return new Status(IStatus.OK, Activator.PLUGIN_ID, NLS.bind("Diagram initialized - {0}", diagramName)); + return new Status(IStatus.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind("Diagram initialized - {0}", diagramName)); } /** @@ -391,7 +388,7 @@ protected IStatus retrieveTargetDiagram(DRepresentation diagram, Session session description); } if ((allocatingDescription == null) || allocatingDescription.eIsProxy()) { - return (new Status(IStatus.ERROR, Activator.PLUGIN_ID, + return (new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), NLS.bind("Diagram ''{0}'' is not yet supported by diagram initialization", EObjectExt.getText(diagram)))); } context.put(TARGET_DESCRIPTION, allocatingDescription); @@ -401,7 +398,7 @@ protected IStatus retrieveTargetDiagram(DRepresentation diagram, Session session targetSemantic = getTargetSemantic(sourceSemantic, description, allocatingDescription); } if (targetSemantic == null) { - return (new Status(IStatus.ERROR, Activator.PLUGIN_ID, + return (new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "No semantic element has been found to put the created diagram")); } @@ -414,7 +411,7 @@ protected IStatus retrieveTargetDiagram(DRepresentation diagram, Session session } if (targetDiagram == null) { - return (new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot create the target diagram")); + return (new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Cannot create the target diagram")); } return Status.OK_STATUS; } @@ -423,7 +420,7 @@ protected IStatus retrieveTargetDiagram(DRepresentation diagram, Session session * @return */ protected Shell getShell() { - return Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(); + return PlatformUI.getWorkbench().getDisplay().getActiveShell(); } /** @@ -457,7 +454,7 @@ private IStatus rollbackDiagram(final DRepresentation diagram) { // Retrieve the current session final Session session = DiagramHelper.getService().getSession(diagram); if (session == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Cannot retrieve session from the given diagram"); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Cannot retrieve session from the given diagram"); } IStatus status = runCommand(session, NLS.bind("{0} - {1} (2/2)", getName(), EObjectExt.getText(diagram)), diff --git a/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/Activator.java b/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/Activator.java index d25cd8f979..d54730b70d 100644 --- a/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/Activator.java +++ b/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/Activator.java @@ -22,9 +22,6 @@ */ public class Activator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.topdown.ui"; //$NON-NLS-1$ - // The shared instance private static Activator plugin; diff --git a/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/preferences/TopDownPreferenceInitializer.java b/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/preferences/TopDownPreferenceInitializer.java index 9a5e4139c1..bfae2ae1f4 100644 --- a/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/preferences/TopDownPreferenceInitializer.java +++ b/core/plugins/org.polarsys.capella.core.transition.system.topdown.ui/src/org/polarsys/capella/core/transition/system/topdown/ui/preferences/TopDownPreferenceInitializer.java @@ -12,6 +12,7 @@ *******************************************************************************/ package org.polarsys.capella.core.transition.system.topdown.ui.preferences; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.flexibility.properties.loader.PropertiesLoader; import org.polarsys.capella.common.flexibility.properties.property.IDefaultValueProperty; import org.polarsys.capella.common.flexibility.properties.property.PropertyContext; @@ -20,14 +21,13 @@ import org.polarsys.capella.common.flexibility.properties.schema.IPropertyContext; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; import org.polarsys.capella.core.commands.preferences.service.ScopedCapellaPreferencesStore; -import org.polarsys.capella.core.preferences.Activator; import org.polarsys.capella.core.transition.system.topdown.constants.ITopDownConstants; public class TopDownPreferenceInitializer extends AbstractPreferencesInitializer { /** */ public TopDownPreferenceInitializer() { - super(org.polarsys.capella.core.transition.system.topdown.ui.Activator.PLUGIN_ID); + super(FrameworkUtil.getBundle(TopDownPreferenceInitializer.class).getSymbolicName()); } /** @@ -42,6 +42,6 @@ public void initializeDefaultPreferences() { ((IDefaultValueProperty) property).initializeDefaultValue(context); } } - ScopedCapellaPreferencesStore.getInstance(Activator.PLUGIN_ID).save(); + ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(org.polarsys.capella.core.preferences.Activator.class).getSymbolicName()).save(); } } diff --git a/core/plugins/org.polarsys.capella.core.transition.system.topdown/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.transition.system.topdown/META-INF/MANIFEST.MF index 8c3ec13a4b..39694715ca 100644 --- a/core/plugins/org.polarsys.capella.core.transition.system.topdown/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.transition.system.topdown/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.transition.system.topdown;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.system.topdown.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -13,8 +12,7 @@ Require-Bundle: org.eclipse.ui, org.eclipse.emf.diffmerge.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.transition.system.topdown, - org.polarsys.capella.core.transition.system.topdown.activities, +Export-Package: org.polarsys.capella.core.transition.system.topdown.activities, org.polarsys.capella.core.transition.system.topdown.commands, org.polarsys.capella.core.transition.system.topdown.constants, org.polarsys.capella.core.transition.system.topdown.handlers.attachment, diff --git a/core/plugins/org.polarsys.capella.core.transition.system.topdown/src/org/polarsys/capella/core/transition/system/topdown/Activator.java b/core/plugins/org.polarsys.capella.core.transition.system.topdown/src/org/polarsys/capella/core/transition/system/topdown/Activator.java deleted file mode 100644 index 20cc1e363b..0000000000 --- a/core/plugins/org.polarsys.capella.core.transition.system.topdown/src/org/polarsys/capella/core/transition/system/topdown/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.transition.system.topdown; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.topdown"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.transition.system.ui/src/org/polarsys/capella/core/transition/system/ui/Activator.java b/core/plugins/org.polarsys.capella.core.transition.system.ui/src/org/polarsys/capella/core/transition/system/ui/Activator.java index cc8725e483..31f6cc9661 100644 --- a/core/plugins/org.polarsys.capella.core.transition.system.ui/src/org/polarsys/capella/core/transition/system/ui/Activator.java +++ b/core/plugins/org.polarsys.capella.core.transition.system.ui/src/org/polarsys/capella/core/transition/system/ui/Activator.java @@ -22,9 +22,6 @@ */ public class Activator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.system.ui"; //$NON-NLS-1$ - // The shared instance private static Activator plugin; diff --git a/core/plugins/org.polarsys.capella.core.transition.system/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.transition.system/META-INF/MANIFEST.MF index 647f71a5a7..29dd3dc368 100644 --- a/core/plugins/org.polarsys.capella.core.transition.system/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.transition.system/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.transition.system;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.transition.system.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, @@ -19,8 +18,7 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.common.libraries Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.core.transition.system, - org.polarsys.capella.core.transition.system.activities, +Export-Package: org.polarsys.capella.core.transition.system.activities, org.polarsys.capella.core.transition.system.constants, org.polarsys.capella.core.transition.system.domain, org.polarsys.capella.core.transition.system.handlers.attachment, diff --git a/core/plugins/org.polarsys.capella.core.transition.system/src/org/polarsys/capella/core/transition/system/Activator.java b/core/plugins/org.polarsys.capella.core.transition.system/src/org/polarsys/capella/core/transition/system/Activator.java deleted file mode 100644 index cdd42bdb12..0000000000 --- a/core/plugins/org.polarsys.capella.core.transition.system/src/org/polarsys/capella/core/transition/system/Activator.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ - -package org.polarsys.capella.core.transition.system; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.transition.system"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - 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; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerActivator.java b/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerActivator.java index e94926bd6d..2ad5404283 100644 --- a/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerActivator.java +++ b/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerActivator.java @@ -15,13 +15,12 @@ import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; +import org.osgi.framework.FrameworkUtil; /** * The activator class controls the plug-in life cycle. */ public class FastLinkerActivator extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.fastlinker"; //$NON-NLS-1$ // The shared instance private static FastLinkerActivator plugin; /** @@ -58,8 +57,8 @@ public FastLinkerManager getFastLinkerManager() { @SuppressWarnings("nls") protected void initializeImageRegistry(ImageRegistry imageRegistry) { // Enabled icons. - imageRegistry.put(IMG_PIN, imageDescriptorFromPlugin(PLUGIN_ID, "icons/elcl16/pin.gif")); - imageRegistry.put(IMG_CLEAR, imageDescriptorFromPlugin(PLUGIN_ID, "icons/elcl16/clear.gif")); + imageRegistry.put(IMG_PIN, imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/elcl16/pin.gif")); + imageRegistry.put(IMG_CLEAR, imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/elcl16/clear.gif")); } /* diff --git a/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerManager.java b/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerManager.java index bcd0050f11..0721a23cbe 100644 --- a/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerManager.java +++ b/core/plugins/org.polarsys.capella.core.ui.fastlinker/src/org/polarsys/capella/core/ui/fastlinker/FastLinkerManager.java @@ -27,6 +27,7 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.ModelElement; import org.polarsys.capella.common.tools.report.appenders.reportlogview.LightMarkerRegistry; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerView; @@ -276,7 +277,7 @@ public FastLinkerView showFastLinkerView() { .getDefault() .getLog() .log(new Status(IStatus.ERROR, - FastLinkerActivator.PLUGIN_ID, exception + FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception .getLocalizedMessage(), exception)); return null; } @@ -423,7 +424,7 @@ public void showCommandExecutedMessage( MarkerViewPlugin .getDefault() .getLog() - .log(new Status(IStatus.ERROR, MarkerViewPlugin.PLUGIN_ID, + .log(new Status(IStatus.ERROR, FrameworkUtil.getBundle(MarkerViewPlugin.class).getSymbolicName(), exception.getLocalizedMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.ui.metric/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.metric/META-INF/MANIFEST.MF index 74f7b26cb6..2f81c88841 100644 --- a/core/plugins/org.polarsys.capella.core.ui.metric/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.metric/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.ui.metric;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.ui.metric.MetricActivator Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: com.google.guava, diff --git a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/MetricActivator.java b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/MetricActivator.java deleted file mode 100644 index a25427b8d6..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/MetricActivator.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.metric; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class MetricActivator extends AbstractUIActivator { - /** - * The singleton instance. - */ - private static MetricActivator __plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context_p) throws Exception { - super.start(context_p); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context_p) throws Exception { - __plugin = null; - super.stop(context_p); - } - - /** - * Returns the singleton instance - * @return - */ - public static MetricActivator getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/MetricAction.java b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/MetricAction.java index 65852f0732..ebf4684764 100644 --- a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/MetricAction.java +++ b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/MetricAction.java @@ -29,6 +29,8 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.BaseSelectionListenerAction; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; import org.polarsys.capella.common.mdsofa.common.constant.ICommonConstants; @@ -46,7 +48,6 @@ import org.polarsys.capella.core.model.handler.helpers.HoldingResourceHelper; import org.polarsys.capella.core.sirius.ui.helper.SessionHelper; import org.polarsys.capella.core.ui.metric.IImageKeys; -import org.polarsys.capella.core.ui.metric.MetricActivator; import org.polarsys.capella.core.ui.metric.MetricMessages; import org.polarsys.capella.core.ui.metric.core.DefaultFilter; import org.polarsys.capella.core.ui.metric.core.Metric; @@ -61,7 +62,8 @@ public class MetricAction extends BaseSelectionListenerAction { public MetricAction() { super(MetricMessages.metricAction_lbl); - setImageDescriptor(MetricActivator.getDefault().getImageDescriptor(IImageKeys.IMG_METRICS)); + final String ICONS_PATH = "icons/"; + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + IImageKeys.IMG_METRICS)); } @Override diff --git a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringOverviewAction.java b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringOverviewAction.java index eaf4a92ffe..cac78e3e94 100644 --- a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringOverviewAction.java +++ b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringOverviewAction.java @@ -25,9 +25,10 @@ import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.BaseSelectionListenerAction; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.sirius.ui.helper.SessionHelper; import org.polarsys.capella.core.ui.metric.IImageKeys; -import org.polarsys.capella.core.ui.metric.MetricActivator; import org.polarsys.capella.core.ui.metric.MetricMessages; import org.polarsys.capella.core.ui.metric.dialog.ProgressMonitoringOverviewDialog; import org.polarsys.capella.core.ui.metric.utils.ProgressMonitoringPropagator; @@ -38,7 +39,8 @@ public class ProgressMonitoringOverviewAction extends BaseSelectionListenerActio */ public ProgressMonitoringOverviewAction() { super(MetricMessages.progressMonitoring_overviewAction_lbl); - setImageDescriptor(MetricActivator.getDefault().getImageDescriptor(IImageKeys.IMG_METRICS)); + final String ICONS_PATH = "icons/"; + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + IImageKeys.IMG_METRICS)); } /** diff --git a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringSetAction.java b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringSetAction.java index 9a490b9893..d3d52fc17f 100644 --- a/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringSetAction.java +++ b/core/plugins/org.polarsys.capella.core.ui.metric/src/org/polarsys/capella/core/ui/metric/actions/ProgressMonitoringSetAction.java @@ -36,6 +36,8 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.BaseSelectionListenerAction; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.helpers.TransactionHelper; @@ -43,7 +45,6 @@ import org.polarsys.capella.core.data.capellacore.CapellaElement; import org.polarsys.capella.core.sirius.ui.helper.SessionHelper; import org.polarsys.capella.core.ui.metric.IImageKeys; -import org.polarsys.capella.core.ui.metric.MetricActivator; import org.polarsys.capella.core.ui.metric.MetricMessages; import org.polarsys.capella.core.ui.metric.actions.ProgressSetDialog.PropagateChoice; import org.polarsys.capella.core.ui.metric.utils.ProgressMonitoringPropagator; @@ -59,7 +60,8 @@ public class ProgressMonitoringSetAction extends BaseSelectionListenerAction { */ public ProgressMonitoringSetAction() { super(MetricMessages.progressMonitoring_setAction_lbl); - setImageDescriptor(MetricActivator.getDefault().getImageDescriptor(IImageKeys.IMG_PROGRESS_MONITORING)); + final String ICONS_PATH = "icons/"; + setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), ICONS_PATH + IImageKeys.IMG_PROGRESS_MONITORING)); } diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/META-INF/MANIFEST.MF index 2926682276..a28aeb3d97 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/META-INF/MANIFEST.MF @@ -8,7 +8,5 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin Require-Bundle: org.eclipse.sirius.diagram.ui, org.polarsys.capella.core.ui.properties -Export-Package: org.polarsys.capella.core.ui.properties.descriptions, - org.polarsys.capella.core.ui.properties.descriptions.fields, +Export-Package: org.polarsys.capella.core.ui.properties.descriptions.fields, org.polarsys.capella.core.ui.properties.descriptions.sections -Bundle-Activator: org.polarsys.capella.core.ui.properties.descriptions.CapellaUIPropertiesDescriptionPlugin diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/src/org/polarsys/capella/core/ui/properties/descriptions/CapellaUIPropertiesDescriptionPlugin.java b/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/src/org/polarsys/capella/core/ui/properties/descriptions/CapellaUIPropertiesDescriptionPlugin.java deleted file mode 100644 index cc50132665..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.properties.descriptions/src/org/polarsys/capella/core/ui/properties/descriptions/CapellaUIPropertiesDescriptionPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.properties.descriptions; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - * - * @author Joao Barata - */ -public class CapellaUIPropertiesDescriptionPlugin extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.properties.descriptions"; //$NON-NLS-1$ - - /** - * The shared instance - */ - private static CapellaUIPropertiesDescriptionPlugin __plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - __plugin = null; - super.stop(context); - } - - /** - * @return the shared instance - */ - public static CapellaUIPropertiesDescriptionPlugin getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/META-INF/MANIFEST.MF index 863b168632..2d3c65f832 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/META-INF/MANIFEST.MF @@ -23,4 +23,3 @@ Export-Package: org.polarsys.capella.core.ui.properties.richtext, org.polarsys.capella.core.ui.properties.richtext.navigation, org.polarsys.capella.core.ui.properties.richtext.propertysheet, org.polarsys.capella.core.ui.properties.richtext.sections -Bundle-Activator: org.polarsys.capella.core.ui.properties.richtext.CapellaUIPropertiesRichtextPlugin diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaMDERichTextConstants.java b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaMDERichTextConstants.java index d737f1d30b..acc8544bb7 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaMDERichTextConstants.java +++ b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaMDERichTextConstants.java @@ -14,6 +14,7 @@ import java.net.URL; +import org.osgi.framework.FrameworkUtil; import org.polarsys.kitalpha.richtext.common.util.MDERichTextHelper; public class CapellaMDERichTextConstants { @@ -22,14 +23,14 @@ public class CapellaMDERichTextConstants { public static final String PASTE_AS_LINK_LABEL = "Paste as Link (Ctrl + Shift + V)"; - public static final URL PASTE_AS_LINK_ICON = MDERichTextHelper.getURL(CapellaUIPropertiesRichtextPlugin.PLUGIN_ID, + public static final URL PASTE_AS_LINK_ICON = MDERichTextHelper.getURL(FrameworkUtil.getBundle(CapellaMDERichTextConstants.class).getSymbolicName(), "icons/full/obj16/paste_as_link.gif"); public static final String OPEN_IN_EDITOR_KEY = "OpenInEditor"; public static final String OPEN_IN_EDITOR_LABEL = "Open in Editor"; - public static final URL OPEN_IN_EDITOR_ICON = MDERichTextHelper.getURL(CapellaUIPropertiesRichtextPlugin.PLUGIN_ID, + public static final URL OPEN_IN_EDITOR_ICON = MDERichTextHelper.getURL(FrameworkUtil.getBundle(CapellaMDERichTextConstants.class).getSymbolicName(), "icons/full/obj16/open_in_editor.gif"); diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaUIPropertiesRichtextPlugin.java b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaUIPropertiesRichtextPlugin.java deleted file mode 100644 index 60ce806b05..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/CapellaUIPropertiesRichtextPlugin.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.properties.richtext; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - * - * @author Joao Barata - */ -public class CapellaUIPropertiesRichtextPlugin extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.properties.richtext"; //$NON-NLS-1$ - - /** - * The shared instance - */ - private static CapellaUIPropertiesRichtextPlugin __plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - __plugin = null; - super.stop(context); - } - - /** - * @return the shared instance - */ - public static CapellaUIPropertiesRichtextPlugin getDefault() { - return __plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/fields/ElementDescriptionGroup.java b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/fields/ElementDescriptionGroup.java index f25d90bb17..c7e4dce4f1 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/fields/ElementDescriptionGroup.java +++ b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/fields/ElementDescriptionGroup.java @@ -34,6 +34,7 @@ import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.views.properties.tabbed.ISection; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.ef.command.ICommand; @@ -41,7 +42,6 @@ import org.polarsys.capella.core.model.handler.provider.CapellaReadOnlyHelper; import org.polarsys.capella.core.model.handler.provider.IReadOnlySectionHandler; import org.polarsys.capella.core.ui.properties.helpers.NotificationHelper; -import org.polarsys.capella.core.ui.properties.richtext.CapellaUIPropertiesRichtextPlugin; import org.polarsys.capella.core.ui.properties.richtext.RichtextManager; import org.polarsys.kitalpha.richtext.common.intf.MDERichTextWidget; import org.polarsys.kitalpha.richtext.common.intf.SaveStrategy; @@ -53,10 +53,10 @@ */ public abstract class ElementDescriptionGroup { - private static final String FAMILY_DEFERRED_REFRESH = CapellaUIPropertiesRichtextPlugin.PLUGIN_ID + private static final String FAMILY_DEFERRED_REFRESH = FrameworkUtil.getBundle(ElementDescriptionGroup.class).getSymbolicName() + ".refreshJobFamily"; - private static final String FAMILY_LOAD_DATA_REFRESH = CapellaUIPropertiesRichtextPlugin.PLUGIN_ID + private static final String FAMILY_LOAD_DATA_REFRESH = FrameworkUtil.getBundle(ElementDescriptionGroup.class).getSymbolicName() + ".loadDataJobFamily"; /** diff --git a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/handlers/OpenInEditorHandler.java b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/handlers/OpenInEditorHandler.java index 514fead10e..4b2a27ae93 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/handlers/OpenInEditorHandler.java +++ b/core/plugins/org.polarsys.capella.core.ui.properties.richtext/src/org/polarsys/capella/core/ui/properties/richtext/handlers/OpenInEditorHandler.java @@ -12,14 +12,14 @@ *******************************************************************************/ package org.polarsys.capella.core.ui.properties.richtext.handlers; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import org.polarsys.capella.core.ui.properties.richtext.CapellaUIPropertiesRichtextPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.ui.properties.richtext.editor.CapellaMDERichTextEditor; import org.polarsys.kitalpha.richtext.common.intf.MDERichTextWidget; import org.polarsys.kitalpha.richtext.nebula.widget.toolbar.MDERichTextToolbarItemHandler; @@ -39,8 +39,8 @@ public void execute(MDERichTextWidget richText) { try { activePage.openEditor(input, CapellaMDERichTextEditor.ID); } catch (PartInitException e) { - Status status = new Status(IStatus.ERROR, CapellaUIPropertiesRichtextPlugin.PLUGIN_ID, e.getMessage(), e); - CapellaUIPropertiesRichtextPlugin.getDefault().getLog().log(status); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(e.getMessage(), e); } } diff --git a/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/CapellaUIPropertiesPlugin.java b/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/CapellaUIPropertiesPlugin.java index 34e3b3d951..dea23982cf 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/CapellaUIPropertiesPlugin.java +++ b/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/CapellaUIPropertiesPlugin.java @@ -28,9 +28,6 @@ * The activator class controls the plug-in life cycle */ public class CapellaUIPropertiesPlugin extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.properties"; //$NON-NLS-1$ /** * Properties contributor ID. */ diff --git a/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/preferences/CapellaUIPropertiesPreferencesInitializer.java b/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/preferences/CapellaUIPropertiesPreferencesInitializer.java index b323d9629f..b93ebe384f 100644 --- a/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/preferences/CapellaUIPropertiesPreferencesInitializer.java +++ b/core/plugins/org.polarsys.capella.core.ui.properties/src/org/polarsys/capella/core/ui/properties/preferences/CapellaUIPropertiesPreferencesInitializer.java @@ -13,9 +13,8 @@ package org.polarsys.capella.core.ui.properties.preferences; import org.eclipse.core.resources.ProjectScope; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.service.AbstractPreferencesInitializer; -import org.polarsys.capella.core.ui.properties.CapellaUIPropertiesPlugin; /** */ @@ -25,7 +24,7 @@ public class CapellaUIPropertiesPreferencesInitializer extends AbstractPreferenc * Default constructor. */ public CapellaUIPropertiesPreferencesInitializer() { - super(CapellaUIPropertiesPlugin.PLUGIN_ID); + super(FrameworkUtil.getBundle(CapellaUIPropertiesPreferencesInitializer.class).getSymbolicName()); } /** diff --git a/core/plugins/org.polarsys.capella.core.ui.reportlog/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.reportlog/META-INF/MANIFEST.MF index de5aaaa4c3..9d469c1d78 100644 --- a/core/plugins/org.polarsys.capella.core.ui.reportlog/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.reportlog/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.ui.reportlog;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.ui.reportlog.ReportLogActivator Bundle-Vendor: %providerName Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/InformationViewSessionListener.java b/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/InformationViewSessionListener.java index 31f11f0e5a..5c50a7dbee 100644 --- a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/InformationViewSessionListener.java +++ b/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/InformationViewSessionListener.java @@ -19,12 +19,14 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionListener; import org.eclipse.sirius.business.api.session.SessionManagerListener; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.LightMarkerRegistry; /** @@ -50,7 +52,8 @@ public void notify(Session updated_p, int notification_p) { try { marker.delete(); } catch (CoreException exception) { - ReportLogActivator.getDefault().log(IStatus.ERROR, exception.getMessage(), exception); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(exception.getMessage(), exception); } } } diff --git a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/LogDataHandler.java b/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/LogDataHandler.java index f8cb3b53aa..32595aff4c 100644 --- a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/LogDataHandler.java +++ b/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/LogDataHandler.java @@ -15,11 +15,12 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.jface.dialogs.IInputValidator; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.ui.PlatformUI; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; public class LogDataHandler extends AbstractHandler { @@ -42,8 +43,8 @@ public String isValid(String newText) { d.open(); if (d.getReturnCode() == InputDialog.OK) { String value = d.getValue(); - IStatus status = new Status(IStatus.INFO, ReportLogActivator.getDefault().getPluginId(), value); - ReportLogActivator.getDefault().getLog().log(status); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).info(value); } return null; } diff --git a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/ReportLogActivator.java b/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/ReportLogActivator.java deleted file mode 100644 index d9a33d38c6..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.reportlog/src/org/polarsys/capella/core/ui/reportlog/ReportLogActivator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.reportlog; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class ReportLogActivator extends AbstractUIActivator { - // The shared instance - private static ReportLogActivator __plugin; - - /** - * The constructor - */ - public ReportLogActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - __plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static ReportLogActivator getDefault() { - return __plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.ui.resources/src/org/polarsys/capella/core/ui/resources/CapellaUIResourcesPlugin.java b/core/plugins/org.polarsys.capella.core.ui.resources/src/org/polarsys/capella/core/ui/resources/CapellaUIResourcesPlugin.java index a0e26f6170..fe32210295 100644 --- a/core/plugins/org.polarsys.capella.core.ui.resources/src/org/polarsys/capella/core/ui/resources/CapellaUIResourcesPlugin.java +++ b/core/plugins/org.polarsys.capella.core.ui.resources/src/org/polarsys/capella/core/ui/resources/CapellaUIResourcesPlugin.java @@ -41,9 +41,6 @@ */ public class CapellaUIResourcesPlugin extends AbstractUIActivator { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.resources"; //$NON-NLS-1$ - // The shared instance private static CapellaUIResourcesPlugin __plugin; diff --git a/core/plugins/org.polarsys.capella.core.ui.search/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.search/META-INF/MANIFEST.MF index f9290c3388..44b4c51fd0 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.search/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.ui.search;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.ui.search.Activator Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin @@ -21,7 +20,7 @@ Require-Bundle: org.eclipse.search, org.eclipse.sirius.ext.base, org.eclipse.gmf.runtime.diagram.ui, org.polarsys.kitalpha.ad.services, - org.apache.commons.lang + org.apache.commons.lang, + org.eclipse.ui.workbench Export-Package: org.polarsys.capella.core.ui.search - diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/AbstractCapellaHistory.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/AbstractCapellaHistory.java index e9276b933e..13ed6b07fa 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/AbstractCapellaHistory.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/AbstractCapellaHistory.java @@ -17,6 +17,8 @@ import org.eclipse.core.resources.IProject; import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.ui.PlatformUI; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.ui.search.searchfor.SearchForItemCache; import org.polarsys.capella.core.ui.search.searchfor.item.SearchForAttributeItem; import org.polarsys.capella.core.ui.search.searchfor.item.SearchForClassItem; @@ -121,7 +123,7 @@ public void appendSearchSettings(CapellaSearchSettings capellaSearchSettings) { } private IDialogSettings getDialogSettingsForCapellaSearch() { - IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings(); + IDialogSettings dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(this.getClass())).getDialogSettings(); IDialogSettings section = dialogSettings.getSection(SECTION_SEARCH); if (section == null) { section = dialogSettings.addNewSection(SECTION_SEARCH); diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/Activator.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/Activator.java deleted file mode 100644 index 832a7c3655..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/Activator.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.search; - -import org.eclipse.sirius.common.ui.tools.api.plugin.AbstractUIActivator; -import org.osgi.framework.BundleContext; - -public class Activator extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.search"; - - // The shared instance - private static Activator plugin = new Activator(); - - @Override - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - } - - public static Activator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaReplaceQuery.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaReplaceQuery.java index 94faac6421..dc66f70498 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaReplaceQuery.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaReplaceQuery.java @@ -23,91 +23,93 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; import org.eclipse.emf.ecore.EObject; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.ui.search.match.SearchMatch; public class CapellaReplaceQuery { - private final CapellaSearchSettings capellaSearchSettings; + private final CapellaSearchSettings capellaSearchSettings; - Set replacedElements = new HashSet<>(); - Set replacedProjects = new HashSet<>(); - int replacedOccurrenceCount = 0; + Set replacedElements = new HashSet<>(); - public CapellaReplaceQuery(CapellaSearchSettings capellaSearchSettings) { - this.capellaSearchSettings = capellaSearchSettings; - } + Set replacedProjects = new HashSet<>(); - public IStatus run(IProgressMonitor monitor, Set allMatches, String replacement) { - replacedElements = new HashSet<>(); - replacedProjects = new HashSet<>(); - replacedOccurrenceCount = 0; - if (replacement == null) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - CapellaSearchConstants.CapellaReplaceQuery_Validation_Replacement_Null); + int replacedOccurrenceCount = 0; + + public CapellaReplaceQuery(CapellaSearchSettings capellaSearchSettings) { + this.capellaSearchSettings = capellaSearchSettings; } - try { - Pattern searchPattern = capellaSearchSettings.createPattern(); - Set matches = getMinimalSearchMatches(allMatches); - - int countTotalOccurrences = matches.size(); - SubMonitor subMonitor = SubMonitor.convert(monitor, countTotalOccurrences); - subMonitor.setTaskName(String.format(CapellaSearchConstants.ReplaceJob_Title, replacement)); - - for (SearchMatch match : matches) { - int countOccurrences = 1; - String projectName = match.getProject().getName(); - subMonitor.subTask(String.format(CapellaSearchConstants.ReplaceJob_SubTitle, countOccurrences, projectName)); - replace(match, searchPattern, replacement); - subMonitor.split(countOccurrences); - - } - return Status.OK_STATUS; - } catch (Exception e) { - String message = e.getMessage(); - if (e instanceof PatternSyntaxException) { - message = String.format(CapellaSearchConstants.CapellaSearchQuery_Search_Pattern_Not_Validated_Message, - ((PatternSyntaxException) e).getPattern(), ((PatternSyntaxException) e).getDescription()); - } - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message); + + public IStatus run(IProgressMonitor monitor, Set allMatches, String replacement) { + replacedElements = new HashSet<>(); + replacedProjects = new HashSet<>(); + replacedOccurrenceCount = 0; + if (replacement == null) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CapellaSearchConstants.CapellaReplaceQuery_Validation_Replacement_Null); + } + try { + Pattern searchPattern = capellaSearchSettings.createPattern(); + Set matches = getMinimalSearchMatches(allMatches); + + int countTotalOccurrences = matches.size(); + SubMonitor subMonitor = SubMonitor.convert(monitor, countTotalOccurrences); + subMonitor.setTaskName(String.format(CapellaSearchConstants.ReplaceJob_Title, replacement)); + + for (SearchMatch match : matches) { + int countOccurrences = 1; + String projectName = match.getProject().getName(); + subMonitor.subTask(String.format(CapellaSearchConstants.ReplaceJob_SubTitle, countOccurrences, projectName)); + replace(match, searchPattern, replacement); + subMonitor.split(countOccurrences); + + } + return Status.OK_STATUS; + } catch (Exception e) { + String message = e.getMessage(); + if (e instanceof PatternSyntaxException) { + message = String.format(CapellaSearchConstants.CapellaSearchQuery_Search_Pattern_Not_Validated_Message, ((PatternSyntaxException) e).getPattern(), + ((PatternSyntaxException) e).getDescription()); + } + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); + } } - } - - public void replace(SearchMatch capellaMatch, Pattern searchPattern, String replacement) { - boolean replaced = capellaMatch.replace(searchPattern, replacement); - if (replaced) { - replacedProjects.add(capellaMatch.getProject()); - replacedElements.add((EObject) capellaMatch.getElement()); - replacedOccurrenceCount += capellaMatch.getChildren().isEmpty() ? 1 : capellaMatch.getChildren().size(); + + public void replace(SearchMatch capellaMatch, Pattern searchPattern, String replacement) { + boolean replaced = capellaMatch.replace(searchPattern, replacement); + if (replaced) { + replacedProjects.add(capellaMatch.getProject()); + replacedElements.add((EObject) capellaMatch.getElement()); + replacedOccurrenceCount += capellaMatch.getChildren().isEmpty() ? 1 : capellaMatch.getChildren().size(); + } } - } - - public int getReplacedOccurrenceCount() { - return replacedOccurrenceCount; - } - - public int getReplacedElementCount() { - return replacedElements.size(); - } - - public int getReplacedProjectCount() { - return replacedProjects.size(); - } - - /** - * Returns the minimal search matches required to fully perform all the replacements. The original matches might - * contain both parent and children matches, but replacing in the parent already replaced in the children matches. - * - * @param allMatches - * all the matches. - * @return the minimal search matches required to fully perform all the replacements. - */ - private Set getMinimalSearchMatches(Set allMatches) { - Set minimalMatches = new HashSet<>(allMatches); - - for (SearchMatch originalMatch : allMatches) { - minimalMatches.removeAll(originalMatch.getChildren()); + + public int getReplacedOccurrenceCount() { + return replacedOccurrenceCount; } - return minimalMatches; - } + public int getReplacedElementCount() { + return replacedElements.size(); + } + + public int getReplacedProjectCount() { + return replacedProjects.size(); + } + + /** + * Returns the minimal search matches required to fully perform all the replacements. The original matches might + * contain both parent and children matches, but replacing in the parent already replaced in the children matches. + * + * @param allMatches + * all the matches. + * @return the minimal search matches required to fully perform all the replacements. + */ + private Set getMinimalSearchMatches(Set allMatches) { + Set minimalMatches = new HashSet<>(allMatches); + + for (SearchMatch originalMatch : allMatches) { + minimalMatches.removeAll(originalMatch.getChildren()); + } + + return minimalMatches; + } } diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchQuery.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchQuery.java index 835523fbf1..9bcc9fef15 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchQuery.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchQuery.java @@ -38,6 +38,7 @@ import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.commands.preferences.util.PreferencesHelper; import org.polarsys.capella.core.platform.sirius.ui.navigator.viewer.CapellaNavigatorContentProvider; import org.polarsys.capella.core.ui.search.match.LineSearchMatchChild; @@ -50,233 +51,231 @@ public class CapellaSearchQuery implements ISearchQuery { - private final CapellaSearchResult capellaSearchResult = new CapellaSearchResult(this); - private final CapellaSearchSettings capellaSearchSettings; - - private final ITreeContentProvider contentProvider = new CapellaNavigatorContentProvider() { - // Extend the search scope to include note from diagram - @Override - public Object[] getChildren(Object element) { - if (element instanceof DRepresentationDescriptor - && ((DRepresentationDescriptor) element).isLoadedRepresentation()) { - DRepresentation representation = ((DRepresentationDescriptor) element).getRepresentation(); - if (representation instanceof DDiagram) { - List notes = new ArrayList<>(); - DDiagramGraphicalQuery query = new DDiagramGraphicalQuery((DDiagram) representation); - Option gmfDiagram = query.getAssociatedGMFDiagram(); - if (gmfDiagram.some()) { - for (Object child : gmfDiagram.get().getChildren()) { - if (child instanceof Shape && ViewType.NOTE.equals(((Shape) child).getType())) { - notes.add((Shape) child); - } + private final CapellaSearchResult capellaSearchResult = new CapellaSearchResult(this); + + private final CapellaSearchSettings capellaSearchSettings; + + private final ITreeContentProvider contentProvider = new CapellaNavigatorContentProvider() { + // Extend the search scope to include note from diagram + @Override + public Object[] getChildren(Object element) { + if (element instanceof DRepresentationDescriptor && ((DRepresentationDescriptor) element).isLoadedRepresentation()) { + DRepresentation representation = ((DRepresentationDescriptor) element).getRepresentation(); + if (representation instanceof DDiagram) { + List notes = new ArrayList<>(); + DDiagramGraphicalQuery query = new DDiagramGraphicalQuery((DDiagram) representation); + Option gmfDiagram = query.getAssociatedGMFDiagram(); + if (gmfDiagram.some()) { + for (Object child : gmfDiagram.get().getChildren()) { + if (child instanceof Shape && ViewType.NOTE.equals(((Shape) child).getType())) { + notes.add((Shape) child); + } + } + } + return notes.toArray(); + } } - } - return notes.toArray(); + return super.getChildren(element); } - } - return super.getChildren(element); + }; + + public CapellaSearchQuery(CapellaSearchSettings capellaSearchSettings) { + this.capellaSearchSettings = capellaSearchSettings; } - }; - - public CapellaSearchQuery(CapellaSearchSettings capellaSearchSettings) { - this.capellaSearchSettings = capellaSearchSettings; - } - - @Override - public IStatus run(IProgressMonitor monitor) { - capellaSearchResult.removeAll(); - try { - Pattern pattern = capellaSearchSettings.createPattern(); - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - Set selectedObjects = capellaSearchSettings.getObjectsToSearch(); - - SubMonitor subMonitor = SubMonitor.convert(monitor, selectedObjects.size()); - subMonitor - .setTaskName(String.format(CapellaSearchConstants.SearchJob_Title, capellaSearchSettings.getTextPattern())); - for (Object selectedObj : selectedObjects) { - IProject project = null; - if (selectedObj instanceof IProject) { - subMonitor - .subTask(String.format(CapellaSearchConstants.SearchJob_SubTitle, ((IProject) selectedObj).getName())); - project = workspaceRoot.getProject(((IProject) selectedObj).getName()); - } else if (selectedObj instanceof EObject) { - project = PreferencesHelper.getProject((EObject) selectedObj); - } - // search the pattern in the projects - if (project != null) { - search(pattern, selectedObj, project); - subMonitor.split(1); + + @Override + public IStatus run(IProgressMonitor monitor) { + capellaSearchResult.removeAll(); + try { + Pattern pattern = capellaSearchSettings.createPattern(); + IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); + Set selectedObjects = capellaSearchSettings.getObjectsToSearch(); + + SubMonitor subMonitor = SubMonitor.convert(monitor, selectedObjects.size()); + subMonitor.setTaskName(String.format(CapellaSearchConstants.SearchJob_Title, capellaSearchSettings.getTextPattern())); + for (Object selectedObj : selectedObjects) { + IProject project = null; + if (selectedObj instanceof IProject) { + subMonitor.subTask(String.format(CapellaSearchConstants.SearchJob_SubTitle, ((IProject) selectedObj).getName())); + project = workspaceRoot.getProject(((IProject) selectedObj).getName()); + } else if (selectedObj instanceof EObject) { + project = PreferencesHelper.getProject((EObject) selectedObj); + } + // search the pattern in the projects + if (project != null) { + search(pattern, selectedObj, project); + subMonitor.split(1); + } + } + return Status.OK_STATUS; + } catch (PatternSyntaxException e) { + String message = String.format(CapellaSearchConstants.CapellaSearchQuery_Search_Pattern_Not_Validated_Message, e.getPattern(), e.getDescription()); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); + } catch (Exception e) { + String message = e.getMessage(); + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); } - } - return Status.OK_STATUS; - } catch (PatternSyntaxException e) { - String message = String.format(CapellaSearchConstants.CapellaSearchQuery_Search_Pattern_Not_Validated_Message, - e.getPattern(), e.getDescription()); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message); - } catch (Exception e) { - String message = e.getMessage(); - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message); } - } - - /** - * - * @param pattern - * @param element - * the entry point to launch the search - * @param project - */ - private void search(Pattern pattern, Object element, IProject project) { - if (element instanceof EObject) { - EObject eObj = (EObject) element; - - Set searchClassItems = capellaSearchSettings.getSearchClassItems(); - for (Object searchClassItem : searchClassItems) { - if (searchClassItem instanceof SearchForClassItem && ((SearchForClassItem) searchClassItem).covers(eObj)) { - - if (searchClassItem instanceof SearchForNoteItem) { - searchForAttribute(pattern, project, eObj, (SearchForNoteItem) searchClassItem); - } else { - Set searchAttributeItems = capellaSearchSettings.getSearchAttributeItems(); - for (Object searchAttributeItem : searchAttributeItems) { - if (searchAttributeItem instanceof SearchForAttributeItem) { - searchForAttribute(pattern, project, eObj, (SearchForAttributeItem) searchAttributeItem); - } - } - } + /** + * + * @param pattern + * @param element + * the entry point to launch the search + * @param project + */ + private void search(Pattern pattern, Object element, IProject project) { + if (element instanceof EObject) { + EObject eObj = (EObject) element; + + Set searchClassItems = capellaSearchSettings.getSearchClassItems(); + for (Object searchClassItem : searchClassItems) { + if (searchClassItem instanceof SearchForClassItem && ((SearchForClassItem) searchClassItem).covers(eObj)) { + + if (searchClassItem instanceof SearchForNoteItem) { + searchForAttribute(pattern, project, eObj, (SearchForNoteItem) searchClassItem); + } else { + Set searchAttributeItems = capellaSearchSettings.getSearchAttributeItems(); + for (Object searchAttributeItem : searchAttributeItems) { + if (searchAttributeItem instanceof SearchForAttributeItem) { + searchForAttribute(pattern, project, eObj, (SearchForAttributeItem) searchAttributeItem); + } + } + + } + } + } } - } - } - Object[] children = contentProvider.getChildren(element); - for (int i = 0; i < children.length; i++) { - // search recursively in all the elements in the project tree - search(pattern, children[i], project); + Object[] children = contentProvider.getChildren(element); + for (int i = 0; i < children.length; i++) { + // search recursively in all the elements in the project tree + search(pattern, children[i], project); + } } - } - protected void searchForAttribute(Pattern pattern, IProject project, EObject inputObject, - SearchForAttributeItem attributeItem) { - - Object searchAttribute = attributeItem.getAttributeFor(inputObject); - if (searchAttribute != null) { - Object searchData = attributeItem.getRelevantSearchData(inputObject); - - if (searchData instanceof String) { - String searchText = (String) searchData; - String[] searchTextLines = searchText.split("\n"); + protected void searchForAttribute(Pattern pattern, IProject project, EObject inputObject, SearchForAttributeItem attributeItem) { - if (searchTextLines.length == 1) { - if (isMatchOccurrences(pattern, searchText)) { - SearchMatch result = new SearchMatch(inputObject, searchText, project, searchAttribute); - capellaSearchResult.addMatch(result); - capellaSearchResult.getTreeData().addElement(inputObject); - } - } else { - SearchMatch parentSearchMatch = new SearchMatch(inputObject, null, project, searchAttribute); - boolean matched = false; - for (int number = 0; number < searchTextLines.length; number++) { - String searchTextLine = searchTextLines[number]; - - if (isMatchOccurrences(pattern, searchTextLine)) { - LineSearchMatchChild childSearchMatch = new LineSearchMatchChild(inputObject, searchTextLine, project, - parentSearchMatch, number); - - parentSearchMatch.getChildren().add(childSearchMatch); - capellaSearchResult.addMatch(childSearchMatch); - matched = true; - } - } + Object searchAttribute = attributeItem.getAttributeFor(inputObject); + if (searchAttribute == null) { + return; + } - if (matched) { - capellaSearchResult.addMatch(parentSearchMatch); - capellaSearchResult.getTreeData().addElement(inputObject); - } + Object searchData = attributeItem.getRelevantSearchData(inputObject); + if (searchData instanceof String) { + searchForAttributeInStringSearchData(pattern, project, inputObject, searchAttribute, searchData); } - } + else if (searchData instanceof List) { + searchForAttributeInListSearchData(pattern, project, inputObject, searchAttribute, searchData); + } + } - else if (searchData instanceof List) { + private void searchForAttributeInListSearchData(Pattern pattern, IProject project, EObject inputObject, Object searchAttribute, Object searchData) { List searchDataList = ((List) searchData); SearchMatch parentSearchMatch = new SearchMatch(inputObject, null, project, searchAttribute); boolean matched = false; for (int index = 0; index < searchDataList.size(); index++) { - Object searchElement = searchDataList.get(index); - - if (searchElement instanceof String) { - String searchText = (String) searchDataList.get(index); + Object searchElement = searchDataList.get(index); - if (isMatchOccurrences(pattern, searchText)) { - ListElementSearchMatchChild childSearchMatch = new ListElementSearchMatchChild(inputObject, searchText, - project, parentSearchMatch, index); - parentSearchMatch.getChildren().add(childSearchMatch); - capellaSearchResult.addMatch(childSearchMatch); - matched = true; + if (searchElement instanceof String && isMatchOccurrences(pattern, (String) searchElement)) { + ListElementSearchMatchChild childSearchMatch = new ListElementSearchMatchChild(inputObject, (String) searchElement, project, parentSearchMatch, index); + parentSearchMatch.getChildren().add(childSearchMatch); + capellaSearchResult.addMatch(childSearchMatch); + matched = true; } - } } if (matched) { - capellaSearchResult.addMatch(parentSearchMatch); - capellaSearchResult.getTreeData().addElement(inputObject); + capellaSearchResult.addMatch(parentSearchMatch); + capellaSearchResult.getTreeData().addElement(inputObject); } - } } - } - - protected void searchForAttribute(Pattern pattern, IProject project, EObject eObj, SearchForNoteItem searchNoteItem) { - Object searchData = searchNoteItem.getRelevantSearchData(eObj); - - if (searchData instanceof String) { - String textToSearch = (String) searchData; - EAttribute shapeDescriptionAttribute = searchNoteItem.getContentAttribute(); - if (isMatchOccurrences(pattern, textToSearch)) { - SearchMatch result = new SearchMatch(eObj, textToSearch, project, shapeDescriptionAttribute); - capellaSearchResult.addMatch(result); - // use tree data if we want to display the result as a tree - capellaSearchResult.getTreeData().addElement(eObj); - } + + private void searchForAttributeInStringSearchData(Pattern pattern, IProject project, EObject inputObject, Object searchAttribute, Object searchData) { + String searchText = (String) searchData; + String[] searchTextLines = searchText.split("\n"); + + if (searchTextLines.length == 1) { + if (isMatchOccurrences(pattern, searchText)) { + SearchMatch result = new SearchMatch(inputObject, searchText, project, searchAttribute); + capellaSearchResult.addMatch(result); + capellaSearchResult.getTreeData().addElement(inputObject); + } + } else { + SearchMatch parentSearchMatch = new SearchMatch(inputObject, null, project, searchAttribute); + boolean matched = false; + for (int number = 0; number < searchTextLines.length; number++) { + String searchTextLine = searchTextLines[number]; + + if (isMatchOccurrences(pattern, searchTextLine)) { + LineSearchMatchChild childSearchMatch = new LineSearchMatchChild(inputObject, searchTextLine, project, parentSearchMatch, number); + + parentSearchMatch.getChildren().add(childSearchMatch); + capellaSearchResult.addMatch(childSearchMatch); + matched = true; + } + } + + if (matched) { + capellaSearchResult.addMatch(parentSearchMatch); + capellaSearchResult.getTreeData().addElement(inputObject); + } + } } - } - - private boolean isMatchOccurrences(Pattern pattern, String text) { - if (text != null && !text.isEmpty()) { - Matcher matcher = pattern.matcher(text); - try { - if (matcher.find()) { - return true; + + protected void searchForAttribute(Pattern pattern, IProject project, EObject eObj, SearchForNoteItem searchNoteItem) { + Object searchData = searchNoteItem.getRelevantSearchData(eObj); + + if (searchData instanceof String) { + String textToSearch = (String) searchData; + EAttribute shapeDescriptionAttribute = searchNoteItem.getContentAttribute(); + if (isMatchOccurrences(pattern, textToSearch)) { + SearchMatch result = new SearchMatch(eObj, textToSearch, project, shapeDescriptionAttribute); + capellaSearchResult.addMatch(result); + // use tree data if we want to display the result as a tree + capellaSearchResult.getTreeData().addElement(eObj); + } } - } catch (Exception e) { - System.err.println(e); - } } - return false; - } + private boolean isMatchOccurrences(Pattern pattern, String text) { + if (text != null && !text.isEmpty()) { + Matcher matcher = pattern.matcher(text); + try { + if (matcher.find()) { + return true; + } + } catch (Exception e) { + System.err.println(e); + } + } - @Override - public String getLabel() { - return capellaSearchSettings.getTextPattern(); - } + return false; + } - @Override - public boolean canRerun() { - return true; - } + @Override + public String getLabel() { + return capellaSearchSettings.getTextPattern(); + } - @Override - public boolean canRunInBackground() { - return true; - } + @Override + public boolean canRerun() { + return true; + } - @Override - public CapellaSearchResult getSearchResult() { - return capellaSearchResult; - } + @Override + public boolean canRunInBackground() { + return true; + } + + @Override + public CapellaSearchResult getSearchResult() { + return capellaSearchResult; + } - public CapellaSearchSettings getCapellaSearchSettings() { - return capellaSearchSettings; - } + public CapellaSearchSettings getCapellaSearchSettings() { + return capellaSearchSettings; + } } diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchSettings.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchSettings.java index 67d5aab16a..f1955ac3c4 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchSettings.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/CapellaSearchSettings.java @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.search.internal.core.text.PatternConstructor; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.ui.search.searchfor.item.SearchForNoteItem; /* @@ -30,214 +31,216 @@ */ @SuppressWarnings("restriction") public class CapellaSearchSettings { - private boolean isCaseSensitive = false; - private boolean isRegExSearch = false; - private boolean isWholeWord = false; - private String textPattern = null; - private String replaceTextPattern = null; - private Set objectsToSearch = new HashSet<>(); - private Set searchAttributeItems = new HashSet<>(); - private Set searchMetaClassItems = new HashSet<>(); - private boolean abstractChecked = true; - private boolean nonSemanticChecked = true; - private int scope; - - public void addObjectToSearch(Object objectToSearch) { - objectsToSearch.add(objectToSearch); - } - - public Set getObjectsToSearch() { - return Collections.unmodifiableSet(objectsToSearch); - } - - public boolean containProject(String name) { - return objectsToSearch.contains(name); - } - - public void clearProjects() { - objectsToSearch.clear(); - } - - public boolean isCaseSensitive() { - return isCaseSensitive; - } - - public void setCaseSensitive(boolean isCaseSensitive) { - this.isCaseSensitive = isCaseSensitive; - } - - public boolean isRegExSearch() { - return isRegExSearch; - } - - public void setRegExSearch(boolean isRegExSearch) { - this.isRegExSearch = isRegExSearch; - } - - public boolean isWholeWord() { - return isWholeWord; - } - - public void setWholeWord(boolean isWholeWord) { - this.isWholeWord = isWholeWord; - } - - public String getTextPattern() { - return textPattern; - } - - public void setTextPattern(String textPattern) { - this.textPattern = textPattern; - } + private boolean isCaseSensitive = false; - public String getReplaceTextPattern() { - return replaceTextPattern; - } + private boolean isRegExSearch = false; - public void setReplaceTextPattern(String replaceTextPattern) { - this.replaceTextPattern = replaceTextPattern; - } + private boolean isWholeWord = false; - public Set getSearchAttributeItems() { - return searchAttributeItems; - } + private String textPattern = null; - public void setSearchAttributeItems(Set searchAttributeItems) { - this.searchAttributeItems = searchAttributeItems; - } + private String replaceTextPattern = null; - public Set getSearchClassItems() { - return searchMetaClassItems; - } + private Set objectsToSearch = new HashSet<>(); - public void setSearchClassItems(Set searchClassItems) { - this.searchMetaClassItems = searchClassItems; - } + private Set searchAttributeItems = new HashSet<>(); - public void setAbstractChecked(boolean abstractChecked) { - this.abstractChecked = abstractChecked; - } + private Set searchMetaClassItems = new HashSet<>(); - public void setNonSemanticChecked(boolean nonSemanticChecked) { - this.nonSemanticChecked = nonSemanticChecked; - } + private boolean abstractChecked = true; - public boolean isAbstractChecked() { - return abstractChecked; - } + private boolean nonSemanticChecked = true; - public boolean isNonSemanticChecked() { - return nonSemanticChecked; - } + private int scope; - public void setScope(int scope) { - this.scope = scope; - } + public void addObjectToSearch(Object objectToSearch) { + objectsToSearch.add(objectToSearch); + } - public int getScope() { - return this.scope; - } + public Set getObjectsToSearch() { + return Collections.unmodifiableSet(objectsToSearch); + } - // method used to check the search settings (that we entered text, selected at least one mettaclass or attribute etc) - public IStatus validate() { - if (textPattern == null || textPattern.isEmpty()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - CapellaSearchConstants.CapellaSearchPage_Validation_Message_Pattern_Empty); + public boolean containProject(String name) { + return objectsToSearch.contains(name); } - if (isRegExSearch) { - if (isWholeWord) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - CapellaSearchConstants.CapellaSearchPage_Validation_Message_Whole_Word_Same_Time_Regex); - } + public void clearProjects() { + objectsToSearch.clear(); + } - try { - CapellaSearchSettings.createPattern(textPattern, isCaseSensitive, isRegExSearch, isWholeWord); - } catch (PatternSyntaxException e) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getDescription()); - } + public boolean isCaseSensitive() { + return isCaseSensitive; } - if (searchMetaClassItems.isEmpty()) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - CapellaSearchConstants.CapellaSearchPage_Validation_Message_SearchMetaClass_Selection); + public void setCaseSensitive(boolean isCaseSensitive) { + this.isCaseSensitive = isCaseSensitive; } - if (searchAttributeItems.isEmpty() - && !searchMetaClassItems.stream().anyMatch(SearchForNoteItem.class::isInstance)) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - CapellaSearchConstants.CapellaSearchPage_Validation_Message_SearchAttribute_Selection); + public boolean isRegExSearch() { + return isRegExSearch; } - return Status.OK_STATUS; - } + public void setRegExSearch(boolean isRegExSearch) { + this.isRegExSearch = isRegExSearch; + } - public static Pattern createPattern(String textPattern, boolean isCaseSensitive, boolean isRegExSearch, - boolean isWholeWord) { - return PatternConstructor.createPattern(textPattern, isRegExSearch, true, isCaseSensitive, isWholeWord); - } + public boolean isWholeWord() { + return isWholeWord; + } - public Pattern createPattern() { - return createPattern(textPattern, isCaseSensitive, isRegExSearch, isWholeWord); - } + public void setWholeWord(boolean isWholeWord) { + this.isWholeWord = isWholeWord; + } - @Override - public boolean equals(Object arg0) { - if (arg0 == this) { - return true; + public String getTextPattern() { + return textPattern; } - if (!(arg0 instanceof CapellaSearchSettings)) { - return false; + public void setTextPattern(String textPattern) { + this.textPattern = textPattern; } - CapellaSearchSettings that = (CapellaSearchSettings) arg0; + public String getReplaceTextPattern() { + return replaceTextPattern; + } - if (this.isCaseSensitive != that.isCaseSensitive) { - return false; + public void setReplaceTextPattern(String replaceTextPattern) { + this.replaceTextPattern = replaceTextPattern; } - if (this.isRegExSearch != that.isRegExSearch) { - return false; + public Set getSearchAttributeItems() { + return searchAttributeItems; } - if (this.textPattern == null ? that.textPattern != null : !this.textPattern.equals(that.textPattern)) { - return false; + public void setSearchAttributeItems(Set searchAttributeItems) { + this.searchAttributeItems = searchAttributeItems; } - if (this.searchAttributeItems == null ? that.searchAttributeItems != null - : !this.searchAttributeItems.equals(that.searchAttributeItems)) { - return false; + public Set getSearchClassItems() { + return searchMetaClassItems; } - if (this.searchMetaClassItems == null ? that.searchMetaClassItems != null - : !this.searchMetaClassItems.equals(that.searchMetaClassItems)) { - return false; + public void setSearchClassItems(Set searchClassItems) { + this.searchMetaClassItems = searchClassItems; } - if (this.objectsToSearch == null ? that.objectsToSearch != null - : !this.objectsToSearch.equals(that.objectsToSearch)) { - return false; + public void setAbstractChecked(boolean abstractChecked) { + this.abstractChecked = abstractChecked; } - if (this.scope != that.scope) { - return false; + public void setNonSemanticChecked(boolean nonSemanticChecked) { + this.nonSemanticChecked = nonSemanticChecked; } - return true; - } + public boolean isAbstractChecked() { + return abstractChecked; + } - @Override - public int hashCode() { - int hashCode = 3; - hashCode += 7 * hashCode + (isCaseSensitive ? 1 : 0); - hashCode += 7 * hashCode + (isRegExSearch ? 1 : 0); - hashCode += 7 * hashCode + (textPattern == null ? 0 : textPattern.hashCode()); - hashCode += 7 * hashCode + (replaceTextPattern == null ? 0 : replaceTextPattern.hashCode()); - hashCode += 7 * hashCode + searchAttributeItems.hashCode(); - hashCode += 7 * hashCode + searchMetaClassItems.hashCode(); - hashCode += 7 * hashCode + objectsToSearch.hashCode(); - hashCode += 7 * hashCode + scope; - return hashCode; - } + public boolean isNonSemanticChecked() { + return nonSemanticChecked; + } + + public void setScope(int scope) { + this.scope = scope; + } + + public int getScope() { + return this.scope; + } + + // method used to check the search settings (that we entered text, selected at least one mettaclass or attribute + // etc) + public IStatus validate() { + if (textPattern == null || textPattern.isEmpty()) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CapellaSearchConstants.CapellaSearchPage_Validation_Message_Pattern_Empty); + } + + if (isRegExSearch) { + if (isWholeWord) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CapellaSearchConstants.CapellaSearchPage_Validation_Message_Whole_Word_Same_Time_Regex); + } + + try { + CapellaSearchSettings.createPattern(textPattern, isCaseSensitive, isRegExSearch, isWholeWord); + } catch (PatternSyntaxException e) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), e.getDescription()); + } + } + + if (searchMetaClassItems.isEmpty()) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CapellaSearchConstants.CapellaSearchPage_Validation_Message_SearchMetaClass_Selection); + } + + if (searchAttributeItems.isEmpty() && searchMetaClassItems.stream().noneMatch(SearchForNoteItem.class::isInstance)) { + return new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), CapellaSearchConstants.CapellaSearchPage_Validation_Message_SearchAttribute_Selection); + } + + return Status.OK_STATUS; + } + + public static Pattern createPattern(String textPattern, boolean isCaseSensitive, boolean isRegExSearch, boolean isWholeWord) { + return PatternConstructor.createPattern(textPattern, isRegExSearch, true, isCaseSensitive, isWholeWord); + } + + public Pattern createPattern() { + return createPattern(textPattern, isCaseSensitive, isRegExSearch, isWholeWord); + } + + @Override + public boolean equals(Object arg0) { + if (arg0 == this) { + return true; + } + + if (!(arg0 instanceof CapellaSearchSettings)) { + return false; + } + + CapellaSearchSettings that = (CapellaSearchSettings) arg0; + + if (this.isCaseSensitive != that.isCaseSensitive) { + return false; + } + + if (this.isRegExSearch != that.isRegExSearch) { + return false; + } + + if (this.textPattern == null ? that.textPattern != null : !this.textPattern.equals(that.textPattern)) { + return false; + } + + if (this.searchAttributeItems == null ? that.searchAttributeItems != null : !this.searchAttributeItems.equals(that.searchAttributeItems)) { + return false; + } + + if (this.searchMetaClassItems == null ? that.searchMetaClassItems != null : !this.searchMetaClassItems.equals(that.searchMetaClassItems)) { + return false; + } + + if (this.objectsToSearch == null ? that.objectsToSearch != null : !this.objectsToSearch.equals(that.objectsToSearch)) { + return false; + } + + if (this.scope != that.scope) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 3; + hashCode += 7 * hashCode + (isCaseSensitive ? 1 : 0); + hashCode += 7 * hashCode + (isRegExSearch ? 1 : 0); + hashCode += 7 * hashCode + (textPattern == null ? 0 : textPattern.hashCode()); + hashCode += 7 * hashCode + (replaceTextPattern == null ? 0 : replaceTextPattern.hashCode()); + hashCode += 7 * hashCode + searchAttributeItems.hashCode(); + hashCode += 7 * hashCode + searchMetaClassItems.hashCode(); + hashCode += 7 * hashCode + objectsToSearch.hashCode(); + hashCode += 7 * hashCode + scope; + return hashCode; + } } diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/CapellaSearchResult.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/CapellaSearchResult.java index c9d9614cd9..935b516b3d 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/CapellaSearchResult.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/CapellaSearchResult.java @@ -31,9 +31,10 @@ import org.eclipse.search.ui.text.MatchFilter; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.viewpoint.DRepresentationDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.toolkit.viewers.data.TreeData; import org.polarsys.capella.core.model.handler.helpers.RepresentationHelper; -import org.polarsys.capella.core.ui.search.Activator; import org.polarsys.capella.core.ui.search.CapellaSearchConstants; import org.polarsys.capella.core.ui.search.CapellaSearchQuery; import org.polarsys.capella.core.ui.search.match.SearchMatch; @@ -99,7 +100,7 @@ public String getTooltip() { @Override public ImageDescriptor getImageDescriptor() { - return Activator.getDefault().getImageDescriptor("search.gif"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/search.gif"); } @Override diff --git a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/providers/label/CapellaSearchResultLabelProvider.java b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/providers/label/CapellaSearchResultLabelProvider.java index dd19adcef3..2ed4254105 100644 --- a/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/providers/label/CapellaSearchResultLabelProvider.java +++ b/core/plugins/org.polarsys.capella.core.ui.search/src/org/polarsys/capella/core/ui/search/result/providers/label/CapellaSearchResultLabelProvider.java @@ -24,8 +24,9 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.ui.navigator.INavigatorContentService; import org.eclipse.ui.navigator.NavigatorContentServiceFactory; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.platform.sirius.ui.navigator.view.CapellaCommonNavigator; -import org.polarsys.capella.core.ui.search.Activator; import org.polarsys.capella.core.ui.search.CapellaSearchConstants; import org.polarsys.capella.core.ui.search.match.SearchMatch; import org.polarsys.capella.core.ui.search.match.SearchMatchChild; @@ -68,7 +69,7 @@ public Image getImage(Object element) { if (element instanceof SearchMatchChild) { return null; } else if (element instanceof SearchMatch) { - return Activator.getDefault().getImage("line_match.png"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/line_match.png").createImage(); } else if (element instanceof Shape && ViewType.NOTE.equals(((Shape) element).getType())) { return ExtendedImageRegistry.INSTANCE .getImage(DiagramUIPlugin.getInstance().getBundle().getEntry("icons/note.gif")); diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/META-INF/MANIFEST.MF index 23fce58a79..0edba08c9a 100644 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.ui.semantic.browser.sirius;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.ui.semantic.browser.sirius.Activator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.core.ui.semantic.browser;visibility:=reexport, org.polarsys.capella.core.services;visibility:=reexport, @@ -17,8 +16,7 @@ Require-Bundle: org.polarsys.capella.core.ui.semantic.browser;visibility:=reexpo Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.ui.semantic.browser.sirius, - org.polarsys.capella.core.ui.semantic.browser.sirius.actions, +Export-Package: org.polarsys.capella.core.ui.semantic.browser.sirius.actions, org.polarsys.capella.core.ui.semantic.browser.sirius.handlers, org.polarsys.capella.core.ui.semantic.browser.sirius.helpers, org.polarsys.capella.core.ui.semantic.browser.sirius.view diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/Activator.java b/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/Activator.java deleted file mode 100644 index 477b3cb5b9..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/Activator.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.semantic.browser.sirius; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIActivator { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.semantic.browser.sirius"; //$NON-NLS-1$ - - // The shared instance - private static Activator __plugin; - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - __plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } -} diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/META-INF/MANIFEST.MF index 93cda2c748..dcf6beafa9 100644 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.ui.semantic.browser;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.ui.semantic.browser.CapellaBrowserActivator Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-ActivationPolicy: lazy @@ -19,3 +18,4 @@ Export-Package: org.polarsys.capella.core.ui.semantic.browser, org.polarsys.capella.core.ui.semantic.browser.model, org.polarsys.capella.core.ui.semantic.browser.view Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-Activator: org.polarsys.capella.core.ui.semantic.browser.CapellaBrowserActivator diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/plugin.xml b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/plugin.xml index 2e522a0235..deb93067ae 100644 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/plugin.xml +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/plugin.xml @@ -59,5 +59,11 @@ name="%contextName" parentId="org.eclipse.ui.contexts.window"> + + + + diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/CapellaBrowserActivator.java b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/CapellaBrowserActivator.java index d00fb63d84..43bb63b18d 100644 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/CapellaBrowserActivator.java +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/CapellaBrowserActivator.java @@ -12,9 +12,9 @@ *******************************************************************************/ package org.polarsys.capella.core.ui.semantic.browser; -import org.eclipse.core.runtime.preferences.DefaultScope; import org.osgi.framework.BundleContext; import org.polarsys.capella.common.ui.services.AbstractUIActivator; +import org.polarsys.capella.core.ui.semantic.browser.preferences.PreferenceInitializer; /** * The activator class controls the plug-in life cycle @@ -30,10 +30,8 @@ public class CapellaBrowserActivator extends AbstractUIActivator { public void start(BundleContext context) throws Exception { super.start(context); __plugin = this; - - // enable semantic browser synchronization by default - DefaultScope.INSTANCE.getNode(getPluginId()).putBoolean(CapellaBrowserPreferences.PREFS_DISABLE_SEMANTIC_BROWSER_SYNC_ON_STARTUP, false); -} + new PreferenceInitializer(); + } /** * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/preferences/PreferenceInitializer.java b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/preferences/PreferenceInitializer.java new file mode 100644 index 0000000000..c7a3859ac7 --- /dev/null +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/preferences/PreferenceInitializer.java @@ -0,0 +1,21 @@ +package org.polarsys.capella.core.ui.semantic.browser.preferences; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.eclipse.core.runtime.preferences.DefaultScope; +import org.osgi.framework.FrameworkUtil; +import org.polarsys.capella.core.ui.semantic.browser.CapellaBrowserPreferences; + +public class PreferenceInitializer extends AbstractPreferenceInitializer { + + private String bundleName; + + public PreferenceInitializer() { + bundleName = FrameworkUtil.getBundle(this.getClass()).getSymbolicName(); + } + + @Override + public void initializeDefaultPreferences() { + DefaultScope.INSTANCE.getNode(bundleName).putBoolean(CapellaBrowserPreferences.PREFS_DISABLE_SEMANTIC_BROWSER_SYNC_ON_STARTUP, false); + } + +} diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/view/SemanticBrowserView.java b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/view/SemanticBrowserView.java index 644ce255e2..52671936dd 100644 --- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/view/SemanticBrowserView.java +++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser/src/org/polarsys/capella/core/ui/semantic/browser/view/SemanticBrowserView.java @@ -88,6 +88,7 @@ import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage; import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EObjectLabelProviderHelper; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.common.tools.report.EmbeddedMessage; @@ -616,7 +617,7 @@ public TreeViewer getCurrentViewer() { * @return */ private IDialogSettings getDialogSettingsSection() { - IDialogSettings dialogSettings = CapellaBrowserActivator.getDefault().getDialogSettings(); + IDialogSettings dialogSettings = PlatformUI.getDialogSettingsProvider(FrameworkUtil.getBundle(this.getClass())).getDialogSettings(); String sectionName = getClass().getName(); // Get the dialog setting for this view. IDialogSettings section = dialogSettings.getSection(sectionName); diff --git a/core/plugins/org.polarsys.capella.core.ui.toolkit/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.ui.toolkit/META-INF/MANIFEST.MF index 0439d5cd90..641ff70b07 100644 --- a/core/plugins/org.polarsys.capella.core.ui.toolkit/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.ui.toolkit/META-INF/MANIFEST.MF @@ -20,5 +20,4 @@ Export-Package: org.polarsys.capella.core.ui.toolkit, org.polarsys.capella.core.ui.toolkit.viewers Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Bundle-Activator: org.polarsys.capella.core.ui.toolkit.Activator Bundle-Localization: plugin diff --git a/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/Activator.java b/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/Activator.java deleted file mode 100644 index b85ddc3aa8..0000000000 --- a/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.ui.toolkit; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -public class Activator extends AbstractUIActivator { - /** The plug-in ID */ - public static final String PLUGIN_ID = "org.polarsys.capella.core.ui.toolkit"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - // Do nothing. - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context_p) throws Exception { - super.start(context_p); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context_p) throws Exception { - plugin = null; - super.stop(context_p); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/decomposition/DecompositionLabelProvider.java b/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/decomposition/DecompositionLabelProvider.java index 8b041d521b..8d5807d68b 100644 --- a/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/decomposition/DecompositionLabelProvider.java +++ b/core/plugins/org.polarsys.capella.core.ui.toolkit/src/org/polarsys/capella/core/ui/toolkit/decomposition/DecompositionLabelProvider.java @@ -24,6 +24,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.data.modellingcore.AbstractTypedElement; import org.polarsys.capella.common.ui.providers.MDEAdapterFactoryLabelProvider; import org.polarsys.capella.core.data.cs.Interface; @@ -32,7 +33,6 @@ import org.polarsys.capella.core.data.information.communication.provider.CommunicationLinkItemProvider; import org.polarsys.capella.core.data.la.LaFactory; import org.polarsys.capella.core.data.la.LogicalComponent; -import org.polarsys.capella.core.ui.toolkit.Activator; public class DecompositionLabelProvider extends MDEAdapterFactoryLabelProvider implements IBaseLabelProvider, IColorProvider, IFontProvider {// extends ColumnLabelProvider @@ -40,10 +40,10 @@ public class DecompositionLabelProvider extends MDEAdapterFactoryLabelProvider i private Font boldFont = new Font(Display.getCurrent(), "Verdana", 8, SWT.BOLD); //$NON-NLS-1$; private Font normalFont = new Font(Display.getCurrent(), "Verdana", 8, SWT.NONE); //$NON-NLS-1$; - ImageDescriptor implImageDescriptorFromPlugin = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, + ImageDescriptor implImageDescriptorFromPlugin = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.getString("LCDecomp.interface.icon.LCInterfaceImpl")); //$NON-NLS-1$ Image implImage = implImageDescriptorFromPlugin.createImage(); - ImageDescriptor useImageDescriptorFromPlugin = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, + ImageDescriptor useImageDescriptorFromPlugin = AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Messages.getString("LCDecomp.interface.icon.LCInterfaceUse")); //$NON-NLS-1$ Image useImage = useImageDescriptorFromPlugin.createImage(); diff --git a/core/plugins/org.polarsys.capella.core.validation.commandline/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.validation.commandline/META-INF/MANIFEST.MF index 115c7e62a9..1e567a308b 100644 --- a/core/plugins/org.polarsys.capella.core.validation.commandline/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.validation.commandline/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.validation.commandline;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.validation.commandline.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.platform.sirius.ui.actions, diff --git a/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/Activator.java b/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/Activator.java deleted file mode 100644 index 99fb04df5c..0000000000 --- a/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/Activator.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.validation.commandline; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.core.validation.commandline"; //$NON-NLS-1$ - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/ValidationCommandLine.java b/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/ValidationCommandLine.java index 0eb3d3e114..7cc6a21625 100644 --- a/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/ValidationCommandLine.java +++ b/core/plugins/org.polarsys.capella.core.validation.commandline/src/org/polarsys/capella/core/validation/commandline/ValidationCommandLine.java @@ -80,7 +80,7 @@ public void printHelp() { @Override protected IStatus executeWithinWorkbench() { // load the AIRDs - MultiStatus status = new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, Messages.validationStatus, null); + MultiStatus status = new MultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.OK, Messages.validationStatus, null); List airdFiles = getAirdFilesFromInput(); for (IFile file : airdFiles) { URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true); diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/META-INF/MANIFEST.MF b/core/plugins/org.polarsys.capella.core.validation.ui.ide/META-INF/MANIFEST.MF index 6f7240b61c..4f2306d965 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/META-INF/MANIFEST.MF +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.core.validation.ui.ide;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.validation.ui.ide.PluginActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui;visibility:=reexport, org.eclipse.core.runtime, @@ -15,11 +14,11 @@ Require-Bundle: org.eclipse.ui;visibility:=reexport, org.polarsys.capella.common.tools.report.appenders.reportlogview;visibility:=reexport, org.polarsys.capella.core.platform.sirius.ui.navigator, org.eclipse.emf.validation.ui, - org.polarsys.capella.common.re.gen + org.polarsys.capella.common.re.gen, + org.eclipse.osgi Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.core.validation.ui.ide, - org.polarsys.capella.core.validation.ui.ide.internal.quickfix, +Export-Package: org.polarsys.capella.core.validation.ui.ide.internal.quickfix, org.polarsys.capella.core.validation.ui.ide.messages, org.polarsys.capella.core.validation.ui.ide.quickfix diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/PluginActivator.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/PluginActivator.java deleted file mode 100644 index 025fa807d9..0000000000 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/PluginActivator.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.validation.ui.ide; - -import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class PluginActivator extends AbstractUIActivator { - // The shared instance - private static PluginActivator plugin; - - /** - * The constructor - */ - public PluginActivator() { - // Do nothing - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static PluginActivator getDefault() { - return plugin; - } -} diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/internal/quickfix/CapellaQuickFixExtPointUtil.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/internal/quickfix/CapellaQuickFixExtPointUtil.java index 6e38235d3f..39b6e2d9ff 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/internal/quickfix/CapellaQuickFixExtPointUtil.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/internal/quickfix/CapellaQuickFixExtPointUtil.java @@ -18,9 +18,8 @@ import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.quickfix.AbstractCapellaMarkerResolution; /** @@ -89,7 +88,7 @@ static private IConfigurationElement[] getAllContributions() { IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements( - PluginActivator.getDefault().getPluginId(), + FrameworkUtil.getBundle(CapellaQuickFixExtPointUtil.class).getSymbolicName(), ICapellaQuickFixExtPointConstants.EXT_POINT_ID ) ; diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/messages/QuickfixMessages.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/messages/QuickfixMessages.java index 2b26789623..bef4e978ef 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/messages/QuickfixMessages.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/messages/QuickfixMessages.java @@ -13,8 +13,7 @@ package org.polarsys.capella.core.validation.ui.ide.messages; import org.eclipse.osgi.util.NLS; - -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; +import org.osgi.framework.FrameworkUtil; /** * I18n support for this plugin @@ -32,7 +31,7 @@ public class QuickfixMessages extends NLS { static { // initialize resource bundle - NLS.initializeMessages(PluginActivator.getDefault().getPluginId() + ".messages.messages", QuickfixMessages.class); //$NON-NLS-1$ + NLS.initializeMessages(FrameworkUtil.getBundle(QuickfixMessages.class).getSymbolicName() + ".messages.messages", QuickfixMessages.class); //$NON-NLS-1$ } private QuickfixMessages() { diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractCapellaMarkerResolution.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractCapellaMarkerResolution.java index 5611f07c8d..aea8f77f1b 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractCapellaMarkerResolution.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractCapellaMarkerResolution.java @@ -27,9 +27,9 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.MarkerViewHelper; import org.polarsys.capella.common.tools.report.appenders.reportlogview.handler.ReportMarkerResolution; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; import org.polarsys.capella.core.validation.ui.ide.internal.quickfix.MarkerResolutionCache; abstract public class AbstractCapellaMarkerResolution extends ReportMarkerResolution { @@ -182,7 +182,7 @@ protected void deleteMarker(IMarker marker) { marker.delete(); } catch (CoreException exception) { StatusManager.getManager().handle( - new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), exception.getMessage(), exception)); + new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } } diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractDeleteCommandResolver.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractDeleteCommandResolver.java index 76d93ec6b4..f210e89973 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractDeleteCommandResolver.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/AbstractDeleteCommandResolver.java @@ -26,11 +26,11 @@ import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.common.helpers.TransactionHelper; import org.polarsys.capella.core.platform.sirius.ui.commands.CapellaDeleteCommand; -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; /** * Delete Element(s), with confirmation (ok:yes, cancel:no). Also delete the marker. @@ -158,7 +158,7 @@ public void run() { try { marker.delete(); } catch (CoreException exception) { - StatusManager.getManager().handle(new Status(IStatus.ERROR, PluginActivator.getDefault().getPluginId(), + StatusManager.getManager().handle(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), exception.getMessage(), exception)); } } diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/CommandMarkerResolution.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/CommandMarkerResolution.java index 9c748fd2a3..62df7bc3b1 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/CommandMarkerResolution.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/CommandMarkerResolution.java @@ -14,9 +14,9 @@ import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - -import org.polarsys.capella.core.validation.ui.ide.PluginActivator; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.command.ICommand; import org.polarsys.capella.common.helpers.TransactionHelper; @@ -59,7 +59,8 @@ protected void deleteMarker(IMarker marker){ try { marker.delete(); } catch (CoreException e){ - PluginActivator.getDefault().log(IStatus.ERROR, e.getLocalizedMessage(), e); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); + Platform.getLog(bundle).error(e.getLocalizedMessage(), e); } } } diff --git a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/DeleteCommandResolver.java b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/DeleteCommandResolver.java index 04fea01169..a58ce71667 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/DeleteCommandResolver.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui.ide/src/org/polarsys/capella/core/validation/ui/ide/quickfix/DeleteCommandResolver.java @@ -12,6 +12,8 @@ *******************************************************************************/ package org.polarsys.capella.core.validation.ui.ide.quickfix; +import org.osgi.framework.FrameworkUtil; + /** * Delete an Element, with confirmation also delete the marker (ok:yes, cancel:no) */ @@ -32,7 +34,7 @@ public class DeleteCommandResolver extends AbstractDeleteCommandResolver { public DeleteCommandResolver(String resolverLabel, Object elementToDelete) { label = resolverLabel; this.elementToDelete = elementToDelete; - setContributorId(org.polarsys.capella.core.ui.toolkit.Activator.PLUGIN_ID); + setContributorId(FrameworkUtil.getBundle(org.polarsys.capella.core.ui.toolkit.ToolkitPlugin.class).getSymbolicName()); setImgKey(DELETE_ICON_PATH); } diff --git a/core/plugins/org.polarsys.capella.core.validation.ui/src/org/polarsys/capella/core/validation/ui/export/prefs/ExportValidationPreferencePage.java b/core/plugins/org.polarsys.capella.core.validation.ui/src/org/polarsys/capella/core/validation/ui/export/prefs/ExportValidationPreferencePage.java index d9b8a805c5..146ca24ad8 100644 --- a/core/plugins/org.polarsys.capella.core.validation.ui/src/org/polarsys/capella/core/validation/ui/export/prefs/ExportValidationPreferencePage.java +++ b/core/plugins/org.polarsys.capella.core.validation.ui/src/org/polarsys/capella/core/validation/ui/export/prefs/ExportValidationPreferencePage.java @@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Group; import org.eclipse.ui.preferences.ScopedPreferenceStore; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.export.DataExporter; import org.polarsys.capella.common.helpers.export.IExporterProvider; import org.polarsys.capella.core.commands.preferences.service.AbstractDefaultPreferencePage; @@ -48,8 +48,7 @@ public class ExportValidationPreferencePage extends protected IPreferenceStore doGetPreferenceStore() { IPreferenceStore preferences = new ScopedPreferenceStore( - new InstanceScope(), CapellaValidationActivator.getDefault() - .getPluginId()); + new InstanceScope(), FrameworkUtil.getBundle(CapellaValidationActivator.class).getSymbolicName()); return preferences; } diff --git a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/CapellaValidationActivator.java b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/CapellaValidationActivator.java index 7fca0a0395..67ef31a425 100644 --- a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/CapellaValidationActivator.java +++ b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/CapellaValidationActivator.java @@ -12,15 +12,14 @@ *******************************************************************************/ package org.polarsys.capella.core.validation; +import org.eclipse.core.runtime.Plugin; import org.eclipse.emf.validation.service.ConstraintRegistry; import org.osgi.framework.BundleContext; - -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; import org.polarsys.capella.core.validation.filter.CapellaConstraintFilter; /** */ -public class CapellaValidationActivator extends AbstractActivator { +public class CapellaValidationActivator extends Plugin { /** * Singleton instance. */ diff --git a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/export/ExportUtils.java b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/export/ExportUtils.java index 73b8a05f89..a39dee5007 100644 --- a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/export/ExportUtils.java +++ b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/export/ExportUtils.java @@ -23,9 +23,8 @@ import org.eclipse.core.runtime.preferences.InstanceScope; import org.eclipse.emf.validation.model.Category; import org.eclipse.emf.validation.service.IConstraintDescriptor; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.export.DataExporter; -import org.polarsys.capella.core.validation.CapellaValidationActivator; import org.polarsys.capella.core.validation.filter.CapellaConstraintFilter; import org.polarsys.capella.core.validation.prefs.IExportValidationConstants; import org.polarsys.capella.core.validation.utils.ValidationHelper; @@ -61,7 +60,7 @@ public static boolean exportValidationRules(DataExporter dataExporter, List data = new ArrayList<>(); IEclipsePreferences preferences = new InstanceScope() - .getNode(CapellaValidationActivator.getDefault().getPluginId()); + .getNode(FrameworkUtil.getBundle(ExportUtils.class).getSymbolicName()); boolean onlyActiveRules = preferences .getBoolean( diff --git a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/prefs/ExportValidationPreferenceInitializer.java b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/prefs/ExportValidationPreferenceInitializer.java index ca8ff7eb82..ae6fd69cdd 100644 --- a/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/prefs/ExportValidationPreferenceInitializer.java +++ b/core/plugins/org.polarsys.capella.core.validation/src/org/polarsys/capella/core/validation/prefs/ExportValidationPreferenceInitializer.java @@ -15,8 +15,7 @@ import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; import org.eclipse.core.runtime.preferences.DefaultScope; import org.eclipse.core.runtime.preferences.IEclipsePreferences; - -import org.polarsys.capella.core.validation.CapellaValidationActivator; +import org.osgi.framework.FrameworkUtil; /** * Preference initializer for this plugin @@ -31,7 +30,7 @@ public ExportValidationPreferenceInitializer() { public void initializeDefaultPreferences() { - IEclipsePreferences node = new DefaultScope().getNode(CapellaValidationActivator.getDefault().getPluginId()); + IEclipsePreferences node = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(this.getClass()).getSymbolicName()); node.put( IExportValidationConstants.EXPORT_ONLY_CAPELLA_PREF_ID, diff --git a/doc/plugins/org.polarsys.capella.commandline.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.commandline.doc/META-INF/MANIFEST.MF index a076541e79..900854aa21 100644 --- a/doc/plugins/org.polarsys.capella.commandline.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.commandline.doc/META-INF/MANIFEST.MF @@ -3,11 +3,10 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.commandline.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.commandline.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime -Export-Package: org.polarsys.capella.commandline.doc Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin +Export-Package: org.polarsys.capella.commandline.doc diff --git a/doc/plugins/org.polarsys.capella.commandline.doc/build.properties b/doc/plugins/org.polarsys.capella.commandline.doc/build.properties index 1ff3861fbb..7315064f8c 100644 --- a/doc/plugins/org.polarsys.capella.commandline.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.commandline.doc/build.properties @@ -13,6 +13,10 @@ #Properties file for org.polarsys.capella.commandline.doc source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/Activator.java b/doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/Activator.java deleted file mode 100644 index e5a7490e96..0000000000 --- a/doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.commandline.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.commandline.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/core/plugins/org.polarsys.capella.core.data.fa.validation/src/org/polarsys/capella/core/data/fa/validation/FaValidationActivator.java b/doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/CommandLineDoc.java similarity index 67% rename from core/plugins/org.polarsys.capella.core.data.fa.validation/src/org/polarsys/capella/core/data/fa/validation/FaValidationActivator.java rename to doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/CommandLineDoc.java index 57b839880b..1448523016 100644 --- a/core/plugins/org.polarsys.capella.core.data.fa.validation/src/org/polarsys/capella/core/data/fa/validation/FaValidationActivator.java +++ b/doc/plugins/org.polarsys.capella.commandline.doc/src/org/polarsys/capella/commandline/doc/CommandLineDoc.java @@ -6,18 +6,18 @@ * http://www.eclipse.org/legal/epl-2.0 * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * Thales - initial API and implementation *******************************************************************************/ -package org.polarsys.capella.core.data.fa.validation; - -import org.eclipse.core.runtime.Plugin; +package org.polarsys.capella.commandline.doc; /** + * A simple Interface used to retrieve this bundle and the documentation content from external plugins (namely + * core.commandline plugin) */ -public class FaValidationActivator extends Plugin { - - public static String PLUGIN_ID = "org.polarsys.capella.core.data.fa.validation"; //$NON-NLS-1$ +public class CommandLineDoc { + CommandLineDoc() {} + } diff --git a/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/.classpath b/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/.classpath index b862a296d3..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/.classpath @@ -2,6 +2,5 @@ - diff --git a/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/build.properties b/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/build.properties index 88d37ef69c..49552d873d 100644 --- a/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/build.properties @@ -10,8 +10,11 @@ # Contributors: # Thales - initial API and implementation # ============================================================================= -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.developer.doc/.classpath b/doc/plugins/org.polarsys.capella.developer.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.developer.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.developer.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.developer.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.developer.doc/META-INF/MANIFEST.MF index 6db5918043..5bcbb01a0d 100644 --- a/doc/plugins/org.polarsys.capella.developer.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.developer.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.developer.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.developer.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.developer.doc/build.properties b/doc/plugins/org.polarsys.capella.developer.doc/build.properties index 701f7823f0..ee250da4bb 100644 --- a/doc/plugins/org.polarsys.capella.developer.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.developer.doc/build.properties @@ -11,8 +11,12 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.developer.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + reference.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.developer.doc/src/org/polarsys/capella/developer/doc/Activator.java b/doc/plugins/org.polarsys.capella.developer.doc/src/org/polarsys/capella/developer/doc/Activator.java deleted file mode 100644 index 937b2919e1..0000000000 --- a/doc/plugins/org.polarsys.capella.developer.doc/src/org/polarsys/capella/developer/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.developer.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.developer.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.diagrams.doc/.classpath b/doc/plugins/org.polarsys.capella.diagrams.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.diagrams.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.diagrams.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.diagrams.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.diagrams.doc/META-INF/MANIFEST.MF index 0764a4e07a..bf355832ed 100644 --- a/doc/plugins/org.polarsys.capella.diagrams.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.diagrams.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.diagrams.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.diagrams.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.diagrams.doc/build.properties b/doc/plugins/org.polarsys.capella.diagrams.doc/build.properties index 7594da9a92..e8c89232a4 100644 --- a/doc/plugins/org.polarsys.capella.diagrams.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.diagrams.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.diagrams.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.diagrams.doc/src/org/polarsys/capella/diagrams/doc/Activator.java b/doc/plugins/org.polarsys.capella.diagrams.doc/src/org/polarsys/capella/diagrams/doc/Activator.java deleted file mode 100644 index 7f83de2ed0..0000000000 --- a/doc/plugins/org.polarsys.capella.diagrams.doc/src/org/polarsys/capella/diagrams/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.diagrams.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.diagrams.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.diffmerge.doc/.classpath b/doc/plugins/org.polarsys.capella.diffmerge.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.diffmerge.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.diffmerge.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.diffmerge.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.diffmerge.doc/META-INF/MANIFEST.MF index be6d51f9d9..9904167beb 100644 --- a/doc/plugins/org.polarsys.capella.diffmerge.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.diffmerge.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.diffmerge.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.diffmerge.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.diffmerge.doc/build.properties b/doc/plugins/org.polarsys.capella.diffmerge.doc/build.properties index dbb91c70ea..6fa535c229 100644 --- a/doc/plugins/org.polarsys.capella.diffmerge.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.diffmerge.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.diffmerge.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.diffmerge.doc/src/org/polarsys/capella/diffmerge/doc/Activator.java b/doc/plugins/org.polarsys.capella.diffmerge.doc/src/org/polarsys/capella/diffmerge/doc/Activator.java deleted file mode 100644 index 4f19196da4..0000000000 --- a/doc/plugins/org.polarsys.capella.diffmerge.doc/src/org/polarsys/capella/diffmerge/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.diffmerge.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.diffmerge.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.doc/.classpath b/doc/plugins/org.polarsys.capella.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.doc/META-INF/MANIFEST.MF index 517b2cd750..92cf931743 100644 --- a/doc/plugins/org.polarsys.capella.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.doc/build.properties b/doc/plugins/org.polarsys.capella.doc/build.properties index ad3cc17bc6..fc8cace277 100644 --- a/doc/plugins/org.polarsys.capella.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.doc/src/org/polarsys/capella/doc/Activator.java b/doc/plugins/org.polarsys.capella.doc/src/org/polarsys/capella/doc/Activator.java deleted file mode 100644 index e363d939e3..0000000000 --- a/doc/plugins/org.polarsys.capella.doc/src/org/polarsys/capella/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.git.doc/.classpath b/doc/plugins/org.polarsys.capella.git.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.git.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.git.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.git.doc/build.properties b/doc/plugins/org.polarsys.capella.git.doc/build.properties index 35ff109757..0b421f66f8 100644 --- a/doc/plugins/org.polarsys.capella.git.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.git.doc/build.properties @@ -11,8 +11,10 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.gitadapter.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.git.doc/src/org/polarsys/capella/git/doc/Activator.java b/doc/plugins/org.polarsys.capella.git.doc/src/org/polarsys/capella/git/doc/Activator.java deleted file mode 100644 index 89d424fe75..0000000000 --- a/doc/plugins/org.polarsys.capella.git.doc/src/org/polarsys/capella/git/doc/Activator.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.git.doc; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } -} diff --git a/doc/plugins/org.polarsys.capella.glossary.doc/.classpath b/doc/plugins/org.polarsys.capella.glossary.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.glossary.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.glossary.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.glossary.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.glossary.doc/META-INF/MANIFEST.MF index f3954318f0..bee32ecfb7 100644 --- a/doc/plugins/org.polarsys.capella.glossary.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.glossary.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.glossary.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.glossary.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.glossary.doc/build.properties b/doc/plugins/org.polarsys.capella.glossary.doc/build.properties index 7eb837a6c3..0c58e326fb 100644 --- a/doc/plugins/org.polarsys.capella.glossary.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.glossary.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.glossary.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.glossary.doc/src/org/polarsys/capella/glossary/doc/Activator.java b/doc/plugins/org.polarsys.capella.glossary.doc/src/org/polarsys/capella/glossary/doc/Activator.java deleted file mode 100644 index 62e5bbe96a..0000000000 --- a/doc/plugins/org.polarsys.capella.glossary.doc/src/org/polarsys/capella/glossary/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.glossary.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.glossary.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.mylyn.doc/.classpath b/doc/plugins/org.polarsys.capella.mylyn.doc/.classpath index b862a296d3..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.mylyn.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.mylyn.doc/.classpath @@ -2,6 +2,5 @@ - diff --git a/doc/plugins/org.polarsys.capella.mylyn.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.mylyn.doc/META-INF/MANIFEST.MF index d350fff359..c888c46dd2 100644 --- a/doc/plugins/org.polarsys.capella.mylyn.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.mylyn.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.mylyn.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.mylyn.doc.Activator Require-Bundle: org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Automatic-Module-Name: org.polarsys.capella.mylyn.doc diff --git a/doc/plugins/org.polarsys.capella.mylyn.doc/build.properties b/doc/plugins/org.polarsys.capella.mylyn.doc/build.properties index 082c04c046..b1dd892ee7 100644 --- a/doc/plugins/org.polarsys.capella.mylyn.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.mylyn.doc/build.properties @@ -1,5 +1,20 @@ -source.. = src/ +# ============================================================================= +# Copyright (c) 2022THALES GLOBAL SERVICES. +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0 +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Thales - initial API and implementation +# ============================================================================= +#Properties file for org.polarsys.capella.mylyn.doc output.. = bin/ +src.includes = toc.xml,\ + html/,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.mylyn.doc/src/org/polarsys/capella/mylyn/doc/Activator.java b/doc/plugins/org.polarsys.capella.mylyn.doc/src/org/polarsys/capella/mylyn/doc/Activator.java deleted file mode 100644 index 1abb95a7d0..0000000000 --- a/doc/plugins/org.polarsys.capella.mylyn.doc/src/org/polarsys/capella/mylyn/doc/Activator.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.polarsys.capella.mylyn.doc; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/doc/plugins/org.polarsys.capella.preferences.doc/.classpath b/doc/plugins/org.polarsys.capella.preferences.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.preferences.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.preferences.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.preferences.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.preferences.doc/META-INF/MANIFEST.MF index 5a5fa4c917..458fb5da40 100644 --- a/doc/plugins/org.polarsys.capella.preferences.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.preferences.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.preferences.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.preferences.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.preferences.doc/build.properties b/doc/plugins/org.polarsys.capella.preferences.doc/build.properties index 626c7ad0f9..bef02a0f42 100644 --- a/doc/plugins/org.polarsys.capella.preferences.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.preferences.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.preferences.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.preferences.doc/src/org/polarsys/capella/preferences/doc/Activator.java b/doc/plugins/org.polarsys.capella.preferences.doc/src/org/polarsys/capella/preferences/doc/Activator.java deleted file mode 100644 index 5dc8429ecf..0000000000 --- a/doc/plugins/org.polarsys.capella.preferences.doc/src/org/polarsys/capella/preferences/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.preferences.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.preferences.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.properties.doc/.classpath b/doc/plugins/org.polarsys.capella.properties.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.properties.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.properties.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.properties.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.properties.doc/META-INF/MANIFEST.MF index 7785403f24..5d89ae75c3 100644 --- a/doc/plugins/org.polarsys.capella.properties.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.properties.doc/META-INF/MANIFEST.MF @@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.properties.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.properties.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.properties.doc diff --git a/doc/plugins/org.polarsys.capella.properties.doc/build.properties b/doc/plugins/org.polarsys.capella.properties.doc/build.properties index a937b09df3..1ddd407321 100644 --- a/doc/plugins/org.polarsys.capella.properties.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.properties.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.properties.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.properties.doc/src/org/polarsys/capella/properties/doc/Activator.java b/doc/plugins/org.polarsys.capella.properties.doc/src/org/polarsys/capella/properties/doc/Activator.java deleted file mode 100644 index ddb6db4f3b..0000000000 --- a/doc/plugins/org.polarsys.capella.properties.doc/src/org/polarsys/capella/properties/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.properties.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.properties.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.re.doc/.classpath b/doc/plugins/org.polarsys.capella.re.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.re.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.re.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.re.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.re.doc/META-INF/MANIFEST.MF index e57226bd6b..53bf1e2565 100644 --- a/doc/plugins/org.polarsys.capella.re.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.re.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.re.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.re.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.re.doc/build.properties b/doc/plugins/org.polarsys.capella.re.doc/build.properties index e90b7bd598..8ee9ff890c 100644 --- a/doc/plugins/org.polarsys.capella.re.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.re.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.re.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.re.doc/src/org/polarsys/capella/re/doc/Activator.java b/doc/plugins/org.polarsys.capella.re.doc/src/org/polarsys/capella/re/doc/Activator.java deleted file mode 100644 index ecb209cdd1..0000000000 --- a/doc/plugins/org.polarsys.capella.re.doc/src/org/polarsys/capella/re/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.re.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.re.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.th.doc/.classpath b/doc/plugins/org.polarsys.capella.th.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.th.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.th.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.th.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.th.doc/META-INF/MANIFEST.MF index f84b9f5a2b..77016e1988 100644 --- a/doc/plugins/org.polarsys.capella.th.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.th.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.th.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.th.doc.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/doc/plugins/org.polarsys.capella.th.doc/build.properties b/doc/plugins/org.polarsys.capella.th.doc/build.properties index 7036bd8218..f3378746ec 100644 --- a/doc/plugins/org.polarsys.capella.th.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.th.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.th.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.th.doc/src/org/polarsys/capella/th/doc/Activator.java b/doc/plugins/org.polarsys.capella.th.doc/src/org/polarsys/capella/th/doc/Activator.java deleted file mode 100644 index fc25a84cf1..0000000000 --- a/doc/plugins/org.polarsys.capella.th.doc/src/org/polarsys/capella/th/doc/Activator.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.polarsys.capella.th.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.th.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/.classpath b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/META-INF/MANIFEST.MF index 13da706fc2..1586b09fe2 100644 --- a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.tipsandtricks.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.tipsandtricks.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/build.properties b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/build.properties index 6f1004e72e..5af7017a2b 100644 --- a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.tipsandtricks.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/src/org/polarsys/capella/tipsandtricks/doc/Activator.java b/doc/plugins/org.polarsys.capella.tipsandtricks.doc/src/org/polarsys/capella/tipsandtricks/doc/Activator.java deleted file mode 100644 index 54541429cc..0000000000 --- a/doc/plugins/org.polarsys.capella.tipsandtricks.doc/src/org/polarsys/capella/tipsandtricks/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.tipsandtricks.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.tipsandtricks.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.transitions.doc/.classpath b/doc/plugins/org.polarsys.capella.transitions.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.transitions.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.transitions.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.transitions.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.transitions.doc/META-INF/MANIFEST.MF index 1ff01767b4..aebd97efd7 100644 --- a/doc/plugins/org.polarsys.capella.transitions.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.transitions.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.transitions.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.transitions.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.transitions.doc/build.properties b/doc/plugins/org.polarsys.capella.transitions.doc/build.properties index 0adb955959..732e1ba84d 100644 --- a/doc/plugins/org.polarsys.capella.transitions.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.transitions.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.transitions.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.transitions.doc/src/org/polarsys/capella/transitions/doc/Activator.java b/doc/plugins/org.polarsys.capella.transitions.doc/src/org/polarsys/capella/transitions/doc/Activator.java deleted file mode 100644 index 30a9aed811..0000000000 --- a/doc/plugins/org.polarsys.capella.transitions.doc/src/org/polarsys/capella/transitions/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.transitions.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.transitions.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.ui.doc/.classpath b/doc/plugins/org.polarsys.capella.ui.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.ui.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.ui.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.ui.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.ui.doc/META-INF/MANIFEST.MF index 3daed09413..06a3bf34f3 100644 --- a/doc/plugins/org.polarsys.capella.ui.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.ui.doc/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.ui.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.ui.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime diff --git a/doc/plugins/org.polarsys.capella.ui.doc/build.properties b/doc/plugins/org.polarsys.capella.ui.doc/build.properties index 458d72057f..5b7c4b509a 100644 --- a/doc/plugins/org.polarsys.capella.ui.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.ui.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.ui.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.ui.doc/src/org/polarsys/capella/ui/doc/Activator.java b/doc/plugins/org.polarsys.capella.ui.doc/src/org/polarsys/capella/ui/doc/Activator.java deleted file mode 100644 index a869189506..0000000000 --- a/doc/plugins/org.polarsys.capella.ui.doc/src/org/polarsys/capella/ui/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.ui.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.ui.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.validation.doc/.classpath b/doc/plugins/org.polarsys.capella.validation.doc/.classpath index eca7bdba8f..dbc0de13c3 100644 --- a/doc/plugins/org.polarsys.capella.validation.doc/.classpath +++ b/doc/plugins/org.polarsys.capella.validation.doc/.classpath @@ -1,7 +1,6 @@ - - - - - - - + + + + + + diff --git a/doc/plugins/org.polarsys.capella.validation.doc/META-INF/MANIFEST.MF b/doc/plugins/org.polarsys.capella.validation.doc/META-INF/MANIFEST.MF index 8e03d3fa63..e69e2ecaa7 100644 --- a/doc/plugins/org.polarsys.capella.validation.doc/META-INF/MANIFEST.MF +++ b/doc/plugins/org.polarsys.capella.validation.doc/META-INF/MANIFEST.MF @@ -3,11 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.validation.doc;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.validation.doc.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.validation.doc diff --git a/doc/plugins/org.polarsys.capella.validation.doc/build.properties b/doc/plugins/org.polarsys.capella.validation.doc/build.properties index f73497f7c1..73a888c908 100644 --- a/doc/plugins/org.polarsys.capella.validation.doc/build.properties +++ b/doc/plugins/org.polarsys.capella.validation.doc/build.properties @@ -11,8 +11,11 @@ # Thales - initial API and implementation # ============================================================================= #Properties file for org.polarsys.capella.validation.doc -source.. = src/ output.. = bin/ +src.includes = toc.xml,\ + html/,\ + license.txt,\ + build.xml bin.includes = plugin.xml,\ META-INF/,\ .,\ diff --git a/doc/plugins/org.polarsys.capella.validation.doc/src/org/polarsys/capella/validation/doc/Activator.java b/doc/plugins/org.polarsys.capella.validation.doc/src/org/polarsys/capella/validation/doc/Activator.java deleted file mode 100644 index 26a9d07635..0000000000 --- a/doc/plugins/org.polarsys.capella.validation.doc/src/org/polarsys/capella/validation/doc/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.validation.doc; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.validation.doc"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/doc/plugins/org.polarsys.capella.viewpoint.doc/.settings/org.eclipse.core.resources.prefs b/doc/plugins/org.polarsys.capella.viewpoint.doc/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..1d9d9316b6 --- /dev/null +++ b/doc/plugins/org.polarsys.capella.viewpoint.doc/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//html/migration/overview.html=UTF-8 diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/META-INF/MANIFEST.MF b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/META-INF/MANIFEST.MF index 1bc39a8583..4898bd4e4a 100644 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/META-INF/MANIFEST.MF +++ b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.detachment.propertyvalue;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.detachment.propertyvalue.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.kitalpha.model.common.scrutiny, diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalue/Activator.java b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalue/Activator.java deleted file mode 100644 index 9aeed59c02..0000000000 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalue/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.detachment.propertyvalue; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.model.detachment.propertyvalue"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/Constants.java b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/Constants.java index 150f11b00d..96ff701ca1 100644 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/Constants.java +++ b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/Constants.java @@ -20,7 +20,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.graphics.Image; import org.osgi.framework.Bundle; -import org.polarsys.capella.detachment.propertyvalue.Activator; +import org.osgi.framework.FrameworkUtil; public final class Constants { @@ -82,16 +82,16 @@ public final class Constants { url = FileLocator.find(ICON_BUNDLE, new Path(EL_ICON), null); enumLiteralIcon = ImageDescriptor.createFromURL(url).createImage(); - url = FileLocator.find(Activator.getDefault().getBundle(), new Path("icons/full/collapseall.gif"), null); //$NON-NLS-1$ + url = FileLocator.find(FrameworkUtil.getBundle(Constants.class), new Path("icons/full/collapseall.gif"), null); //$NON-NLS-1$ collapsAllIcon = ImageDescriptor.createFromURL(url).createImage(); - url = FileLocator.find(Activator.getDefault().getBundle(), new Path("icons/full/expandall.gif"), null); //$NON-NLS-1$ + url = FileLocator.find(FrameworkUtil.getBundle(Constants.class), new Path("icons/full/expandall.gif"), null); //$NON-NLS-1$ expandAllIcon = ImageDescriptor.createFromURL(url).createImage(); - url = FileLocator.find(Activator.getDefault().getBundle(), new Path("icons/full/checked.gif"), null); //$NON-NLS-1$ + url = FileLocator.find(FrameworkUtil.getBundle(Constants.class), new Path("icons/full/checked.gif"), null); //$NON-NLS-1$ checkAllIcon = ImageDescriptor.createFromURL(url).createImage(); - url = FileLocator.find(Activator.getDefault().getBundle(), new Path("icons/full/unchecked.gif"), null); //$NON-NLS-1$ + url = FileLocator.find(FrameworkUtil.getBundle(Constants.class), new Path("icons/full/unchecked.gif"), null); //$NON-NLS-1$ uncheckAllIcon = ImageDescriptor.createFromURL(url).createImage(); } diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/PropertyValueHelper.java b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/PropertyValueHelper.java index 77d53d81bb..61efd1f20d 100644 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/PropertyValueHelper.java +++ b/ext/detachment/plugins/org.polarsys.capella.detachment.propertyvalue/src/org/polarsys/capella/detachment/propertyvalues/ui/page/PropertyValueHelper.java @@ -16,16 +16,16 @@ import java.util.Collections; import java.util.HashSet; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.util.EcoreUtil; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.capellacore.AbstractPropertyValue; import org.polarsys.capella.core.data.capellacore.EnumerationPropertyLiteral; import org.polarsys.capella.core.data.capellacore.EnumerationPropertyType; import org.polarsys.capella.core.data.capellacore.PropertyValueGroup; import org.polarsys.capella.core.data.capellacore.PropertyValuePkg; -import org.polarsys.capella.detachment.propertyvalue.Activator; import org.polarsys.kitalpha.model.common.scrutiny.analyzer.ModelScrutinyException; import org.polarsys.kitalpha.model.common.scrutiny.interfaces.IScrutinize; import org.polarsys.kitalpha.model.common.scrutiny.registry.ModelScrutinyRegistry; @@ -40,8 +40,8 @@ public static Collection getScrutinizers(ModelScrutinyRegistry anal RegistryElement regElt = analysis.getRegistryElement(id); return regElt.getFinders(); } catch (ModelScrutinyException e) { - Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); - Activator.getDefault().getLog().log(status); + Bundle bundle = FrameworkUtil.getBundle(PropertyValueHelper.class); + Platform.getLog(bundle).error(e.getMessage(), e); } return Collections.emptySet(); } diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/META-INF/MANIFEST.MF b/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/META-INF/MANIFEST.MF index bc340b4110..6fe1719be2 100644 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/META-INF/MANIFEST.MF +++ b/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.detachment.version.precondition;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.detachment.version.precondition.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.kitalpha.model.common.precondition, @@ -14,6 +13,5 @@ Require-Bundle: org.eclipse.core.runtime, Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Export-Package: org.polarsys.capella.detachment.version.precondition, - org.polarsys.capella.detachment.version.precondition.impl, +Export-Package: org.polarsys.capella.detachment.version.precondition.impl, org.polarsys.capella.detachment.version.precondition.util diff --git a/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/src/org/polarsys/capella/detachment/version/precondition/Activator.java b/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/src/org/polarsys/capella/detachment/version/precondition/Activator.java deleted file mode 100644 index 86dff9cedb..0000000000 --- a/ext/detachment/plugins/org.polarsys.capella.detachment.version.precondition/src/org/polarsys/capella/detachment/version/precondition/Activator.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.detachment.version.precondition; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - public static BundleContext getContext() { - return context; - } - - /** - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } -} diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/META-INF/MANIFEST.MF b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/META-INF/MANIFEST.MF index 60e5c1bf39..7d13586d4c 100644 --- a/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/META-INF/MANIFEST.MF +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/META-INF/MANIFEST.MF @@ -1,16 +1,16 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.polarsys.capella.viatra.common.data.gen;singleton:=true -Bundle-Version: 6.0.0.qualifier -Bundle-Vendor: %providerName -Export-Package: org.polarsys.capella.viatra.common.data.activity.surrogate, - org.polarsys.capella.viatra.common.data.core.surrogate -Require-Bundle: org.polarsys.capella.common.data.core.gen, - org.polarsys.capella.common.data.activity.gen, - org.eclipse.emf.ecore, - org.eclipse.viatra.query.runtime, - org.eclipse.xtext.xbase.lib -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Automatic-Module-Name: org.polarsys.capella.viatra.common.data.gen -Import-Package: org.apache.log4j +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.polarsys.capella.viatra.common.data.gen;singleton:=true +Bundle-Version: 6.0.0.qualifier +Bundle-Vendor: %providerName +Export-Package: org.polarsys.capella.viatra.common.data.activity.surrogate, + org.polarsys.capella.viatra.common.data.core.surrogate +Require-Bundle: org.polarsys.capella.common.data.core.gen, + org.polarsys.capella.common.data.activity.gen, + org.eclipse.emf.ecore, + org.eclipse.viatra.query.runtime, + org.eclipse.xtext.xbase.lib +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Automatic-Module-Name: org.polarsys.capella.viatra.common.data.gen +Import-Package: org.apache.log4j diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/activity/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/activity/surrogate/.gitignore new file mode 100644 index 0000000000..b9448531aa --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/activity/surrogate/.gitignore @@ -0,0 +1,17 @@ +/AbstractActivity.java +/AbstractActivity__ownedStructuredNodes.java +/ActivityEdge.java +/ActivityEdge__inActivityPartition.java +/ActivityEdge__inInterruptibleRegion.java +/ActivityEdge__inStructuredNode.java +/ActivityExchange.java +/ActivityExchange__realizingActivityFlows.java +/ActivityNode.java +/ActivityNode__inActivityPartition.java +/ActivityNode__inInterruptibleRegion.java +/ActivityNode__inStructuredNode.java +/ActivityNode__incoming.java +/ActivityNode__outgoing.java +/ActivityPartition.java +/ActivityPartition__subPartitions.java +/ActivityPartition__superPartition.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/core/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/core/surrogate/.gitignore new file mode 100644 index 0000000000..9be68448b2 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.common.data.gen/src-gen/org/polarsys/capella/viatra/common/data/core/surrogate/.gitignore @@ -0,0 +1,13 @@ +/AbstractConstraint.java +/AbstractConstraint__context.java +/InformationsExchanger.java +/InformationsExchanger__incomingInformationFlows.java +/InformationsExchanger__informationFlows.java +/InformationsExchanger__outgoingInformationFlows.java +/ModelElement.java +/ModelElement__constraints.java +/TraceableElement__incomingTraces.java +/AbstractType.java +/AbstractType__abstractTypedElements.java +/TraceableElement.java +/TraceableElement__outgoingTraces.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/META-INF/MANIFEST.MF b/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/META-INF/MANIFEST.MF index 80c8d05cde..d09ded8cf4 100644 --- a/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/META-INF/MANIFEST.MF +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/META-INF/MANIFEST.MF @@ -1,14 +1,14 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.polarsys.capella.viatra.common.re.gen;singleton:=true -Bundle-Version: 6.0.0.qualifier -Bundle-Vendor: %providerName -Export-Package: org.polarsys.capella.viatra.common.re.surrogate -Require-Bundle: org.polarsys.capella.common.re.gen, - org.eclipse.emf.ecore, - org.eclipse.viatra.query.runtime, - org.eclipse.xtext.xbase.lib -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Automatic-Module-Name: org.polarsys.capella.viatra.common.re.gen -Import-Package: org.apache.log4j +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.polarsys.capella.viatra.common.re.gen;singleton:=true +Bundle-Version: 6.0.0.qualifier +Bundle-Vendor: %providerName +Export-Package: org.polarsys.capella.viatra.common.re.surrogate +Require-Bundle: org.polarsys.capella.common.re.gen, + org.eclipse.emf.ecore, + org.eclipse.viatra.query.runtime, + org.eclipse.xtext.xbase.lib +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Automatic-Module-Name: org.polarsys.capella.viatra.common.re.gen +Import-Package: org.apache.log4j diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/src-gen/org/polarsys/capella/viatra/common/re/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/src-gen/org/polarsys/capella/viatra/common/re/surrogate/.gitignore new file mode 100644 index 0000000000..87bb46ac04 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.common.re.gen/src-gen/org/polarsys/capella/viatra/common/re/surrogate/.gitignore @@ -0,0 +1,3 @@ +/CatalogElement.java +/CatalogElement__referencedElements.java +/CatalogElement__replicatedElements.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/META-INF/MANIFEST.MF b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/META-INF/MANIFEST.MF index 1c1913afd3..428b8225d8 100644 --- a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/META-INF/MANIFEST.MF +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/META-INF/MANIFEST.MF @@ -1,33 +1,33 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.polarsys.capella.viatra.core.data.gen;singleton:=true -Bundle-Version: 6.0.0.qualifier -Bundle-Vendor: %providerName -Export-Package: org.polarsys.capella.viatra.core.data.capellacommon.surrogate, - org.polarsys.capella.viatra.core.data.capellacore.surrogate, - org.polarsys.capella.viatra.core.data.capellamodeller.surrogate, - org.polarsys.capella.viatra.core.data.cs.surrogate, - org.polarsys.capella.viatra.core.data.cs.surrogate.internal;x-internal:=true, - org.polarsys.capella.viatra.core.data.ctx.surrogate, - org.polarsys.capella.viatra.core.data.epbs.surrogate, - org.polarsys.capella.viatra.core.data.fa.surrogate, - org.polarsys.capella.viatra.core.data.fa.surrogate.internal;x-internal:=true, - org.polarsys.capella.viatra.core.data.information.communication.surrogate, - org.polarsys.capella.viatra.core.data.information.datatype.surrogate, - org.polarsys.capella.viatra.core.data.information.datavalue.surrogate, - org.polarsys.capella.viatra.core.data.information.surrogate, - org.polarsys.capella.viatra.core.data.interaction.surrogate, - org.polarsys.capella.viatra.core.data.la.surrogate, - org.polarsys.capella.viatra.core.data.oa.surrogate, - org.polarsys.capella.viatra.core.data.pa.deployment.surrogate, - org.polarsys.capella.viatra.core.data.pa.surrogate, - org.polarsys.capella.viatra.core.data.requirement.surrogate -Require-Bundle: org.polarsys.capella.common.data.core.gen, - org.polarsys.capella.core.data.gen, - org.eclipse.emf.ecore, - org.eclipse.viatra.query.runtime, - org.eclipse.xtext.xbase.lib -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Automatic-Module-Name: org.polarsys.capella.viatra.core.data.gen -Import-Package: org.apache.log4j +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.polarsys.capella.viatra.core.data.gen;singleton:=true +Bundle-Version: 6.0.0.qualifier +Bundle-Vendor: %providerName +Export-Package: org.polarsys.capella.viatra.core.data.capellacommon.surrogate, + org.polarsys.capella.viatra.core.data.capellacore.surrogate, + org.polarsys.capella.viatra.core.data.capellamodeller.surrogate, + org.polarsys.capella.viatra.core.data.cs.surrogate, + org.polarsys.capella.viatra.core.data.cs.surrogate.internal;x-internal:=true, + org.polarsys.capella.viatra.core.data.ctx.surrogate, + org.polarsys.capella.viatra.core.data.epbs.surrogate, + org.polarsys.capella.viatra.core.data.fa.surrogate, + org.polarsys.capella.viatra.core.data.fa.surrogate.internal;x-internal:=true, + org.polarsys.capella.viatra.core.data.information.communication.surrogate, + org.polarsys.capella.viatra.core.data.information.datatype.surrogate, + org.polarsys.capella.viatra.core.data.information.datavalue.surrogate, + org.polarsys.capella.viatra.core.data.information.surrogate, + org.polarsys.capella.viatra.core.data.interaction.surrogate, + org.polarsys.capella.viatra.core.data.la.surrogate, + org.polarsys.capella.viatra.core.data.oa.surrogate, + org.polarsys.capella.viatra.core.data.pa.deployment.surrogate, + org.polarsys.capella.viatra.core.data.pa.surrogate, + org.polarsys.capella.viatra.core.data.requirement.surrogate +Require-Bundle: org.polarsys.capella.common.data.core.gen, + org.polarsys.capella.core.data.gen, + org.eclipse.emf.ecore, + org.eclipse.viatra.query.runtime, + org.eclipse.xtext.xbase.lib +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Automatic-Module-Name: org.polarsys.capella.viatra.core.data.gen +Import-Package: org.apache.log4j diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacommon/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacommon/surrogate/.gitignore new file mode 100644 index 0000000000..87ff302ba9 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacommon/surrogate/.gitignore @@ -0,0 +1,30 @@ +/State.java +/State__availableAbstractCapabilities.java +/State__availableAbstractFunctions.java +/State__availableFunctionalChains.java +/AbstractState__realizedAbstractStates.java +/AbstractStateRealization.java +/AbstractStateRealization__realizedAbstractState.java +/AbstractStateRealization__realizingAbstractState.java +/CapabilityRealizationInvolvedElement.java +/CapabilityRealizationInvolvedElement__capabilityRealizationInvolvements.java +/CapabilityRealizationInvolvedElement__involvingCapabilityRealizations.java +/GenericTrace.java +/GenericTrace__source.java +/GenericTrace__target.java +/StateTransition.java +/StateTransition__realizedStateTransitions.java +/StateTransition__realizingStateTransitions.java +/CapabilityRealizationInvolvement.java +/CapabilityRealizationInvolvement__involvedCapabilityRealizationInvolvedElement.java +/AbstractState.java +/AbstractState__incoming.java +/AbstractState__involverRegions.java +/AbstractState__outgoing.java +/AbstractState__realizingAbstractStates.java +/StateEventRealization.java +/StateEventRealization__realizedEvent.java +/StateEventRealization__realizingEvent.java +/StateTransitionRealization.java +/StateTransitionRealization__realizedStateTransition.java +/StateTransitionRealization__realizingStateTransition.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacore/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacore/surrogate/.gitignore new file mode 100644 index 0000000000..1ccda3aae2 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellacore/surrogate/.gitignore @@ -0,0 +1,28 @@ +/Namespace.java +/Namespace__containedGenericTraces.java +/Namespace__containedRequirementsTraces.java +/Type.java +/Type__typedElements.java +/GeneralizableElement.java +/GeneralizableElement__sub.java +/GeneralizableElement__subGeneralizations.java +/GeneralizableElement__super.java +/GeneralizableElement__superGeneralizations.java +/AbstractPropertyValue.java +/AbstractPropertyValue__valuedElements.java +/GeneralClass.java +/GeneralClass__containedOperations.java +/PropertyValueGroup.java +/PropertyValueGroup__valuedElements.java +/Involvement.java +/Involvement__involver.java +/TypedElement.java +/TypedElement__type.java +/CapellaElement.java +/CapellaElement__appliedRequirements.java +/InvolvedElement__involvingInvolvements.java +/InvolverElement.java +/InvolverElement__involvedInvolvements.java +/InvolvedElement.java +/Classifier.java +/Classifier__containedProperties.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellamodeller/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellamodeller/surrogate/.gitignore new file mode 100644 index 0000000000..f65ed5e187 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/capellamodeller/surrogate/.gitignore @@ -0,0 +1,6 @@ +/SystemEngineering__containedOperationalAnalysis.java +/SystemEngineering__containedSystemAnalysis.java +/SystemEngineering__containedLogicalArchitectures.java +/SystemEngineering.java +/SystemEngineering__containedEPBSArchitectures.java +/SystemEngineering__containedPhysicalArchitectures.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/.gitignore new file mode 100644 index 0000000000..7b239e04bb --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/.gitignore @@ -0,0 +1,90 @@ +/CapabilityRealization__involvedComponents.java +/Component.java +/Component__containedComponentPorts.java +/Component__containedParts.java +/Component__containedPhysicalPorts.java +/Component__implementedInterfaceLinks.java +/Component__implementedInterfaces.java +/Component__providedInterfaces.java +/Component__realizedComponents.java +/Component__realizingComponents.java +/Component__representingParts.java +/Component__requiredInterfaces.java +/Component__usedInterfaceLinks.java +/Component__usedInterfaces.java +/InterfaceAllocation.java +/InterfaceAllocation__allocatedInterface.java +/InterfaceAllocation__allocatingInterfaceAllocator.java +/PhysicalLink.java +/PhysicalLink__categories.java +/PhysicalLink__realizedPhysicalLinks.java +/PhysicalLink__realizingPhysicalLinks.java +/InterfaceUse.java +/InterfaceUse__interfaceUser.java +/PhysicalPath.java +/PhysicalPath__firstPhysicalPathInvolvements.java +/PhysicalPath__realizedPhysicalPaths.java +/PhysicalPath__realizingPhysicalPaths.java +/InterfaceImplementation.java +/InterfaceImplementation__interfaceImplementor.java +/PhysicalPathInvolvement__previousInvolvements.java +/ExchangeItemAllocation.java +/ExchangeItemAllocation__allocatingInterface.java +/DeployableElement.java +/DeployableElement__deployingLinks.java +/ComponentRealization.java +/ComponentRealization__realizedComponent.java +/ComponentRealization__realizingComponent.java +/AbstractPhysicalLinkEnd.java +/AbstractPhysicalLinkEnd__involvedLinks.java +/DeploymentTarget.java +/DeploymentTarget__deploymentLinks.java +/PhysicalPort.java +/PhysicalPort__allocatedComponentPorts.java +/PhysicalPort__realizedPhysicalPorts.java +/PhysicalPort__realizingPhysicalPorts.java +/InterfaceAllocator.java +/InterfaceAllocator__allocatedInterfaces.java +/InterfaceAllocator__provisionedInterfaceAllocations.java +/PhysicalPathInvolvement.java +/PhysicalPathInvolvement__involvedComponent.java +/PhysicalPathInvolvement__involvedElement.java +/PhysicalPathReference.java +/PhysicalPathReference__referencedPhysicalPath.java +/AbstractPhysicalArtifact.java +/AbstractPhysicalArtifact__allocatorConfigurationItems.java +/BlockArchitecture.java +/BlockArchitecture__allocatedArchitectures.java +/BlockArchitecture__allocatingArchitectures.java +/BlockArchitecture__provisionedArchitectureAllocations.java +/BlockArchitecture__provisioningArchitectureAllocations.java +/BlockArchitecture__system.java +/EPBSArchitecture__system.java +/LogicalArchitecture__system.java +/PhysicalArchitecture__system.java +/SystemAnalysis__system.java +/Part.java +/Part__deployedParts.java +/Part__deployingParts.java +/Part__providedInterfaces.java +/Part__requiredInterfaces.java +/ArchitectureAllocation.java +/ArchitectureAllocation__allocatedArchitecture.java +/ArchitectureAllocation__allocatingArchitecture.java +/Interface.java +/Interface__allocatingComponents.java +/Interface__allocatingInterfaces.java +/Interface__exchangeItems.java +/Interface__implementorComponents.java +/Interface__interfaceImplementations.java +/Interface__interfaceUses.java +/Interface__providingComponentPorts.java +/Interface__providingComponents.java +/Interface__provisioningInterfaceAllocations.java +/Interface__realizedContextInterfaces.java +/Interface__realizedLogicalInterfaces.java +/Interface__realizingLogicalInterfaces.java +/Interface__realizingPhysicalInterfaces.java +/Interface__requiringComponentPorts.java +/Interface__requiringComponents.java +/Interface__userComponents.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/internal/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/internal/.gitignore new file mode 100644 index 0000000000..bace413f6e --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/cs/surrogate/internal/.gitignore @@ -0,0 +1,2 @@ +/PhysicalPathAll.java +/_PreviousInvolvement.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/ctx/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/ctx/surrogate/.gitignore new file mode 100644 index 0000000000..6037a432e5 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/ctx/surrogate/.gitignore @@ -0,0 +1,37 @@ +/CapabilityInvolvement.java +/CapabilityInvolvement__capability.java +/CapabilityInvolvement__systemComponent.java +/MissionInvolvement.java +/MissionInvolvement__mission.java +/MissionInvolvement__systemComponent.java +/Capability.java +/Capability__involvedSystemComponents.java +/Capability__purposeMissions.java +/Capability__purposes.java +/Capability__realizedOperationalCapabilities.java +/Capability__realizingCapabilityRealizations.java +/SystemFunction__childrenSystemFunctions.java +/SystemFunction__containedSystemFunctions.java +/SystemFunction__realizedOperationalActivities.java +/SystemFunction__realizingLogicalFunctions.java +/SystemFunction.java +/SystemFunction__allocatingSystemComponents.java +/CapabilityExploitation.java +/CapabilityExploitation__mission.java +/SystemAnalysis.java +/SystemAnalysis__allocatedOperationalAnalyses.java +/SystemAnalysis__allocatedOperationalAnalysisRealizations.java +/SystemAnalysis__allocatingLogicalArchitectures.java +/SystemAnalysis__containedCapabilityPkg.java +/SystemAnalysis__containedSystemFunctionPkg.java +/SystemComponent.java +/SystemComponent__allocatedSystemFunctions.java +/SystemComponent__capabilityInvolvements.java +/SystemComponent__involvingCapabilities.java +/SystemComponent__involvingMissions.java +/SystemComponent__missionInvolvements.java +/SystemComponent__realizedEntities.java +/SystemComponent__realizingLogicalComponents.java +/Mission.java +/Mission__exploitedCapabilities.java +/Mission__involvedSystemComponents.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/epbs/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/epbs/surrogate/.gitignore new file mode 100644 index 0000000000..b7589c2910 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/epbs/surrogate/.gitignore @@ -0,0 +1,9 @@ +/EPBSArchitecture.java +/EPBSArchitecture__allocatedPhysicalArchitectureRealizations.java +/EPBSArchitecture__allocatedPhysicalArchitectures.java +/EPBSArchitecture__containedCapabilityRealizationPkg.java +/PhysicalArtifactRealization.java +/PhysicalArtifactRealization__realizedPhysicalArtifact.java +/PhysicalArtifactRealization__realizingConfigurationItem.java +/ConfigurationItem.java +/ConfigurationItem__allocatedPhysicalArtifacts.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/.gitignore new file mode 100644 index 0000000000..0282906be7 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/.gitignore @@ -0,0 +1,112 @@ +/FunctionalExchange__allocatingComponentExchanges.java +/FunctionalExchange__categories.java +/FunctionalExchange__incomingComponentExchangeFunctionalExchangeRealizations.java +/FunctionalExchange__incomingFunctionalExchangeRealizations.java +/FunctionalExchange__involvingFunctionalChains.java +/FunctionalExchange__outgoingFunctionalExchangeRealizations.java +/FunctionalExchange__sourceFunctionOutputPort.java +/FunctionalExchange__targetFunctionInputPort.java +/ComponentExchangeAllocation.java +/ComponentExchangeAllocation__componentExchangeAllocated.java +/ComponentExchangeAllocation__componentExchangeAllocator.java +/ComponentExchangeFunctionalExchangeAllocation.java +/ComponentExchangeFunctionalExchangeAllocation__allocatedFunctionalExchange.java +/ComponentExchangeFunctionalExchangeAllocation__allocatingComponentExchange.java +/FunctionInputPort.java +/FunctionInputPort__incomingFunctionalExchanges.java +/FunctionOutputPort.java +/FunctionOutputPort__outgoingFunctionalExchanges.java +/FunctionRealization.java +/FunctionRealization__allocatedFunction.java +/FunctionRealization__allocatingFunction.java +/ComponentPortAllocation__allocatedPort.java +/ComponentPortAllocation__allocatingPort.java +/ComponentPortAllocationEnd.java +/ComponentPortAllocationEnd__owningComponentPortAllocation.java +/ExchangeLink.java +/ExchangeLink__exchanges.java +/FunctionSpecification.java +/FunctionSpecification__subFunctionSpecifications.java +/FunctionalExchangeRealization.java +/FunctionalExchangeRealization__realizedFunctionalExchange.java +/FunctionalExchangeRealization__realizingFunctionalExchange.java +/FunctionalChain__involvedFunctionalChainInvolvements.java +/FunctionalChain__involvedFunctions.java +/FunctionalChain__involvedFunctionalExchanges.java +/FunctionalChainInvolvement.java +/FunctionalChainInvolvement__involvedElement.java +/FunctionalChainInvolvement__previousFunctionalChainInvolvements.java +/FunctionalChainInvolvement_nextFunctionalChainInvolvements.java +/FunctionalChain__enactedFunctionalBlocks.java +/FunctionalChain__enactedFunctions.java +/FunctionalChain__firstFunctionalChainInvolvements.java +/FunctionalChain__involvedElements.java +/FunctionalChain__involvingCapabilities.java +/ComponentPortAllocation.java +/FunctionalChainReference.java +/FunctionalChainReference__referencedFunctionalChain.java +/ComponentExchange.java +/ComponentExchange__allocatedFunctionalExchanges.java +/ComponentExchange__allocatorPhysicalLinks.java +/ComponentExchange__categories.java +/ComponentExchange__incomingComponentExchangeRealizations.java +/ComponentExchange__outgoingComponentExchangeFunctionalExchangeAllocations.java +/ComponentExchange__outgoingComponentExchangeRealizations.java +/ComponentExchange__realizedComponentExchanges.java +/ComponentExchange__realizingComponentExchanges.java +/ComponentExchange__sourcePart.java +/ComponentExchange__sourcePort.java +/ComponentExchange__targetPart.java +/ComponentExchange__targetPort.java +/ComponentPort__allocatedFunctionPorts.java +/ComponentPort__componentExchanges.java +/ComponentPort__delegatedComponentPorts.java +/ComponentPort__delegatingComponentPorts.java +/ComponentPort__allocatingPhysicalPorts.java +/AbstractFunction__allocationBlocks.java +/AbstractFunction__componentFunctionalAllocations.java +/AbstractFunction__inFunctionRealizations.java +/AbstractFunction__outFunctionRealizations.java +/AbstractFunction__subFunctions.java +/ExchangeSpecificationRealization.java +/ExchangeSpecificationRealization__realizedExchangeSpecification.java +/ExchangeSpecificationRealization__realizingExchangeSpecification.java +/ComponentPort.java +/ComponentPort__realizedComponentPorts.java +/ComponentPort__realizingComponentPorts.java +/FunctionPort.java +/FunctionPort__allocatorComponentPorts.java +/FunctionPort__realizedFunctionPorts.java +/FunctionPort__realizingFunctionPorts.java +/ComponentExchangeRealization.java +/ComponentExchangeRealization__allocatedComponentExchange.java +/ComponentExchangeRealization__allocatingComponentExchange.java +/FunctionalExchangeSpecification.java +/FunctionalExchangeSpecification__functionalExchanges.java +/FunctionalChain.java +/FunctionalChain__involvingCapabilityRealizations.java +/FunctionalChain__realizedFunctionalChains.java +/FunctionalChain__realizingFunctionalChains.java +/ExchangeSpecification__containingLink.java +/AbstractFunction.java +/AbstractFunction__involvingCapabilityRealizations.java +/AbstractFunction__involvingFunctionalChains.java +/AbstractFunction__linkedFunctionSpecification.java +/AbstractFunction__linkedStateMachine.java +/ComponentFunctionalAllocation.java +/ComponentFunctionalAllocation__block.java +/ComponentFunctionalAllocation__function.java +/AbstractFunctionalBlock.java +/AbstractFunctionalBlock__allocatedFunctions.java +/AbstractFunctionalBlock__functionalAllocations.java +/ComponentExchangeAllocator.java +/ComponentExchangeAllocator__allocatedComponentExchanges.java +/ExchangeSpecification.java +/ExchangeSpecification__incomingExchangeSpecificationRealizations.java +/ExchangeSpecification__outgoingExchangeSpecificationRealizations.java +/FunctionalChainInvolvementFunction.java +/FunctionalChainInvolvementFunction__incomingInvolvementLinks.java +/FunctionalChainInvolvementFunction__outgoingInvolvementLinks.java +/FunctionalExchange.java +/FunctionalExchange__realizedFunctionalExchanges.java +/FunctionalExchange__realizingFunctionalExchanges.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/internal/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/internal/.gitignore new file mode 100644 index 0000000000..b666b670bc --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/fa/surrogate/internal/.gitignore @@ -0,0 +1,6 @@ +/_PreviousInvolvement.java +/_AbstractFunction__ownedFunctionPkgs.java +/_FunctionPkg__ownedFunctionPkgs.java +/_FunctionPkg__ownedFunctions.java +/FunctionalChainAll.java +/AbstractFunctionAll.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/communication/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/communication/surrogate/.gitignore new file mode 100644 index 0000000000..6a494c910c --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/communication/surrogate/.gitignore @@ -0,0 +1,13 @@ +/CommunicationItem.java +/CommunicationItem__properties.java +/CommunicationLinkExchanger.java +/CommunicationLinkExchanger__access.java +/CommunicationLinkExchanger__acquire.java +/CommunicationLinkExchanger__call.java +/CommunicationLinkExchanger__consume.java +/CommunicationLinkExchanger__execute.java +/CommunicationLinkExchanger__produce.java +/CommunicationLinkExchanger__receive.java +/CommunicationLinkExchanger__send.java +/CommunicationLinkExchanger__transmit.java +/CommunicationLinkExchanger__write.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datatype/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datatype/surrogate/.gitignore new file mode 100644 index 0000000000..7990f6202e --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datatype/surrogate/.gitignore @@ -0,0 +1,5 @@ +/DataType.java +/DataType__defaultValue.java +/DataType__nullValue.java +/DataType__realizedDataTypes.java +/DataType__realizingDataTypes.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datavalue/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datavalue/surrogate/.gitignore new file mode 100644 index 0000000000..5e83fdb0ae --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/datavalue/surrogate/.gitignore @@ -0,0 +1,13 @@ +/AbstractExpressionValue.java +/AbstractComplexValue.java +/AbstractComplexValue__complexType.java +/DataValue.java +/DataValue__type.java +/NumericValue.java +/NumericValue__numericType.java +/AbstractBooleanValue.java +/AbstractBooleanValue__booleanType.java +/AbstractStringValue.java +/AbstractStringValue__stringType.java +/AbstractEnumerationValue.java +/AbstractEnumerationValue__enumerationType.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/surrogate/.gitignore new file mode 100644 index 0000000000..2226685051 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/information/surrogate/.gitignore @@ -0,0 +1,41 @@ +/OperationAllocation__allocatedOperation.java +/OperationAllocation__allocatingOperation.java +/Operation__allocatedOperations.java +/Operation__allocatingOperations.java +/Operation.java +/Operation__realizedExchangeItems.java +/PortAllocation.java +/PortAllocation__allocatedPort.java +/PortAllocation__allocatingPort.java +/Port.java +/Port__incomingPortAllocations.java +/Port__incomingPortRealizations.java +/Port__outgoingPortAllocations.java +/Port__outgoingPortRealizations.java +/PortRealization.java +/PortRealization__realizedPort.java +/PortRealization__realizingPort.java +/AbstractInstance.java +/AbstractInstance__representingInstanceRoles.java +/ExchangeItem.java +/ExchangeItem__allocatorInterfaces.java +/ExchangeItem__realizedExchangeItems.java +/ExchangeItem__realizingExchangeItems.java +/ExchangeItem__realizingOperations.java +/Collection.java +/Collection__containedOperations.java +/Class__realizedClasses.java +/Property.java +/Property__association.java +/Union.java +/Union__containedUnionProperties.java +/AbstractEventOperation.java +/AbstractEventOperation__invokingSequenceMessages.java +/OperationAllocation.java +/Class.java +/Class__realizingClasses.java +/ExchangeItemRealization.java +/ExchangeItemRealization__realizedItem.java +/ExchangeItemRealization__realizingOperation.java +/Service.java +/Service__messages.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/interaction/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/interaction/surrogate/.gitignore new file mode 100644 index 0000000000..ebcf73a10c --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/interaction/surrogate/.gitignore @@ -0,0 +1,63 @@ +/InstanceRole.java +/InstanceRole__abstractEnds.java +/FragmentEnd.java +/FragmentEnd__abstractFragment.java +/AbstractFunctionAbstractCapabilityInvolvement.java +/AbstractFunctionAbstractCapabilityInvolvement__capability.java +/AbstractFunctionAbstractCapabilityInvolvement__function.java +/AbstractEnd.java +/AbstractEnd__covered.java +/CombinedFragment.java +/CombinedFragment__expressionGates.java +/InteractionUse.java +/InteractionUse__actualGates.java +/ScenarioRealization.java +/ScenarioRealization__realizedScenario.java +/ScenarioRealization__realizingScenario.java +/Scenario.java +/Scenario__containedFunctions.java +/Scenario__containedParts.java +/Scenario__realizedScenarios.java +/Scenario__realizingScenarios.java +/Scenario__referencedScenarios.java +/AbstractCapabilityInclude.java +/AbstractCapabilityInclude__inclusion.java +/AbstractCapability__extending.java +/AbstractCapability__incomingCapabilityAllocation.java +/AbstractCapability__outgoingCapabilityAllocation.java +/AbstractCapability__subGeneralizations.java +/AbstractCapability__including.java +/FunctionalChainAbstractCapabilityInvolvement.java +/FunctionalChainAbstractCapabilityInvolvement__capability.java +/FunctionalChainAbstractCapabilityInvolvement__functionalChain.java +/SequenceMessage.java +/SequenceMessage__invokedOperation.java +/SequenceMessage__receivingFunction.java +/SequenceMessage__receivingPart.java +/SequenceMessage__sendingFunction.java +/SequenceMessage__sendingPart.java +/ExecutionEnd.java +/ExecutionEnd__execution.java +/Execution.java +/Execution__covered.java +/AbstractCapabilityExtend__extension.java +/AbstractCapabilityRealization.java +/AbstractCapabilityRealization__realizedCapability.java +/AbstractCapabilityRealization__realizingCapability.java +/AbstractCapabilityExtensionPoint.java +/AbstractCapabilityExtensionPoint__abstractCapability.java +/MessageEnd.java +/MessageEnd__message.java +/InteractionState.java +/InteractionState__covered.java +/AbstractCapability__extendedAbstractCapabilities.java +/AbstractCapability__includedAbstractCapabilities.java +/AbstractCapability__includingAbstractCapabilities.java +/AbstractCapability__sub.java +/AbstractCapability__super.java +/AbstractCapability.java +/AbstractCapability__extendingAbstractCapabilities.java +/AbstractCapability__involvedAbstractFunctions.java +/AbstractCapability__involvedFunctionalChains.java +/AbstractCapabilityGeneralization.java +/AbstractCapabilityGeneralization__sub.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/la/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/la/surrogate/.gitignore new file mode 100644 index 0000000000..249f8a8a17 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/la/surrogate/.gitignore @@ -0,0 +1,23 @@ +/LogicalFunction.java +/LogicalFunction__allocatingSystemComponents.java +/LogicalFunction__childrenLogicalFunctions.java +/LogicalFunction__containedLogicalFunctions.java +/LogicalFunction__realizedSystemFunctions.java +/LogicalFunction__realizingPhysicalFunctions.java +/LogicalComponent.java +/LogicalComponent__allocatedLogicalFunctions.java +/LogicalComponent__realizedSystemComponents.java +/LogicalComponent__realizingPhysicalComponents.java +/LogicalComponent__subLogicalComponents.java +/LogicalArchitecture.java +/LogicalArchitecture__allocatedSystemAnalyses.java +/LogicalArchitecture__allocatedSystemAnalysisRealizations.java +/LogicalArchitecture__allocatingPhysicalArchitectures.java +/LogicalArchitecture__containedCapabilityRealizationPkg.java +/LogicalArchitecture__containedLogicalFunctionPkg.java +/CapabilityInvolvement__capability.java +/CapabilityInvolvement__systemComponent.java +/CapabilityRealization.java +/CapabilityRealization__realizedCapabilities.java +/CapabilityRealization__realizedCapabilityRealizations.java +/CapabilityRealization__realizingCapabilityRealizations.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/oa/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/oa/surrogate/.gitignore new file mode 100644 index 0000000000..916e331143 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/oa/surrogate/.gitignore @@ -0,0 +1,43 @@ +/ActivityAllocation.java +/ActivityAllocation__activity.java +/ActivityAllocation__role.java +/CommunicationMean.java +/CommunicationMean__sourceEntity.java +/CommunicationMean__targetEntity.java +/OperationalProcess.java +/OperationalProcess__involvingOperationalCapabilities.java +/RoleAllocation.java +/RoleAllocation__entity.java +/RoleAllocation__role.java +/Entity.java +/Entity__allocatedOperationalActivities.java +/Entity__allocatedRoles.java +/Entity__involvingOperationalCapabilities.java +/Entity__realizingSystemComponents.java +/Entity__roleAllocations.java +/Entity__subEntities.java +/Role.java +/Role__activityAllocations.java +/Role__allocatedOperationalActivities.java +/Role__allocatingEntities.java +/Role__roleAllocations.java +/OperationalActivity.java +/OperationalActivity__activityAllocations.java +/OperationalActivity__allocatingRoles.java +/OperationalActivity__allocatorEntities.java +/OperationalActivity__childrenOperationalActivities.java +/OperationalActivity__containedOperationalActivities.java +/OperationalActivity__ownedProcess.java +/OperationalActivity__realizingSystemFunctions.java +/OperationalAnalysis.java +/OperationalAnalysis__allocatingSystemAnalyses.java +/OperationalAnalysis__containedOperationalActivityPkg.java +/OperationalAnalysis__containedOperationalCapabilityPkg.java +/OperationalCapability.java +/OperationalCapability__involvedEntities.java +/OperationalCapability__realizingCapabilities.java +/Swimlane.java +/Swimlane__representedEntity.java +/EntityOperationalCapabilityInvolvement.java +/EntityOperationalCapabilityInvolvement__capability.java +/EntityOperationalCapabilityInvolvement__entity.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/deployment/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/deployment/surrogate/.gitignore new file mode 100644 index 0000000000..548d5bea73 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/deployment/surrogate/.gitignore @@ -0,0 +1,4 @@ +/ComponentInstance.java +/ComponentInstance__portInstances.java +/PortInstance.java +/PortInstance__component.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/surrogate/.gitignore new file mode 100644 index 0000000000..ab59cce6aa --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/pa/surrogate/.gitignore @@ -0,0 +1,20 @@ +/PhysicalArchitecture.java +/PhysicalArchitecture__allocatedLogicalArchitectureRealizations.java +/PhysicalArchitecture__allocatedLogicalArchitectures.java +/PhysicalArchitecture__allocatingEpbsArchitectures.java +/PhysicalArchitecture__containedCapabilityRealizationPkg.java +/PhysicalArchitecture__containedPhysicalFunctionPkg.java +/PhysicalComponent.java +/PhysicalComponent__allocatedPhysicalFunctions.java +/PhysicalComponent__deployedPhysicalComponents.java +/PhysicalComponent__deployingPhysicalComponents.java +/PhysicalComponent__logicalInterfaceRealizations.java +/PhysicalComponent__realizedLogicalComponents.java +/PhysicalComponent__subPhysicalComponents.java +/PhysicalNode.java +/PhysicalNode__subPhysicalNodes.java +/PhysicalFunction__realizedLogicalFunctions.java +/PhysicalFunction__containedPhysicalFunctions.java +/PhysicalFunction.java +/PhysicalFunction__allocatingPhysicalComponents.java +/PhysicalFunction__childrenPhysicalFunctions.java diff --git a/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/requirement/surrogate/.gitignore b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/requirement/surrogate/.gitignore new file mode 100644 index 0000000000..86fc0a9cd2 --- /dev/null +++ b/ext/viatra/plugins/org.polarsys.capella.viatra.core.data.gen/src-gen/org/polarsys/capella/viatra/core/data/requirement/surrogate/.gitignore @@ -0,0 +1,5 @@ +/Requirement.java +/Requirement__relatedCapellaElements.java +/RequirementsTrace.java +/RequirementsTrace__source.java +/RequirementsTrace__target.java diff --git a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/META-INF/MANIFEST.MF b/legacy/plugins/org.polarsys.capella.common.mdsofa.common/META-INF/MANIFEST.MF index c2b7a26503..f8b896ba25 100644 --- a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/META-INF/MANIFEST.MF +++ b/legacy/plugins/org.polarsys.capella.common.mdsofa.common/META-INF/MANIFEST.MF @@ -10,7 +10,8 @@ Require-Bundle: org.apache.log4j;visibility:=reexport, org.eclipse.emf.common, org.eclipse.emf.ecore, org.eclipse.jdt.core;visibility:=reexport, - org.eclipse.pde.core;visibility:=reexport + org.eclipse.pde.core;visibility:=reexport, + org.eclipse.osgi Bundle-ActivationPolicy: lazy Export-Package: org.polarsys.capella.common.mdsofa.common.activator, org.polarsys.capella.common.mdsofa.common.adapter, diff --git a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/AbstractActivator.java b/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/AbstractActivator.java deleted file mode 100644 index db2e41f494..0000000000 --- a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/AbstractActivator.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.common.mdsofa.common.activator; - -import org.eclipse.core.runtime.Plugin; - -/** - */ -public abstract class AbstractActivator extends Plugin { - /** - * Get the plug-in ID according to MANISFEST.MF definition. - * - * @return a String containing the plug-in ID. - */ - public String getPluginId() { - return getBundle().getSymbolicName(); - } -} diff --git a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/SolFaCommonActivator.java b/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/SolFaCommonActivator.java index 044d296cd1..1e7bdd43af 100644 --- a/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/SolFaCommonActivator.java +++ b/legacy/plugins/org.polarsys.capella.common.mdsofa.common/src/org/polarsys/capella/common/mdsofa/common/activator/SolFaCommonActivator.java @@ -13,8 +13,9 @@ package org.polarsys.capella.common.mdsofa.common.activator; import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Plugin; import org.osgi.framework.BundleContext; - +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.mdsofa.common.helper.IUserEnforcedHelper; import org.polarsys.capella.common.mdsofa.common.internal.helper.DefaultUserHelper; @@ -22,7 +23,7 @@ /** * SolFa common plug-in activator. */ -public class SolFaCommonActivator extends AbstractActivator { +public class SolFaCommonActivator extends Plugin { /** * Extension point "user_helper" short id. */ @@ -70,7 +71,7 @@ public IUserEnforcedHelper getUserEnforcedHelper() { // Lazy loading. Search for the implementation. if (null == _userHelper) { // Get extensions abiding to user helper extension point. - IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(getPluginId(), EXTENSION_POINT_SHORT_ID_USER_HELPER); + IConfigurationElement[] configurationElements = ExtensionPointHelper.getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), EXTENSION_POINT_SHORT_ID_USER_HELPER); if ((null != configurationElements) && (configurationElements.length > 0)) { // There should be one implementation only ! // So take the first one, as expected. diff --git a/releng/plugins/org.polarsys.capella.core.egf/META-INF/MANIFEST.MF b/releng/plugins/org.polarsys.capella.core.egf/META-INF/MANIFEST.MF index bd31d3006d..8260bdac2d 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/META-INF/MANIFEST.MF +++ b/releng/plugins/org.polarsys.capella.core.egf/META-INF/MANIFEST.MF @@ -4,7 +4,6 @@ Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.polarsys.capella.core.egf;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.core.egf.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.egf.pattern;visibility:=reexport, diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassbasicGetGenFeatureTODOoverride.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassbasicGetGenFeatureTODOoverride.java index 6887917ea5..7076b1e757 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassbasicGetGenFeatureTODOoverride.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassbasicGetGenFeatureTODOoverride.java @@ -49,20 +49,10 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List isInterfaceList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List isImplementationList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List useInterfaceOverrideAnnotationList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isGWTList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List publicStaticFinalFlagList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List singleWildcardList = null; @@ -71,59 +61,34 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List positiveOffsetCorrectionList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List negativeOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List positiveOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genFeatureParameter : genFeatureList) { for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object isInterfaceParameter : isInterfaceList) { - for (Object isImplementationParameter : isImplementationList) { - for (Object useInterfaceOverrideAnnotationParameter : useInterfaceOverrideAnnotationList) { - for (Object isGWTParameter : isGWTList) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { - for (Object singleWildcardParameter : singleWildcardList) { - for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { - for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { - for (Object negativeOperationOffsetCorrectionParameter : negativeOperationOffsetCorrectionList) { - for (Object positiveOperationOffsetCorrectionParameter : positiveOperationOffsetCorrectionList) { - - this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.isInterface = (java.lang.Boolean) isInterfaceParameter; - this.isImplementation = (java.lang.Boolean) isImplementationParameter; - this.useInterfaceOverrideAnnotation = (java.lang.Boolean) useInterfaceOverrideAnnotationParameter; - this.isGWT = (java.lang.Boolean) isGWTParameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; - this.singleWildcard = (java.lang.String) singleWildcardParameter; - this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; - this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; - this.negativeOperationOffsetCorrection = (java.lang.String) negativeOperationOffsetCorrectionParameter; - this.positiveOperationOffsetCorrection = (java.lang.String) positiveOperationOffsetCorrectionParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } - } - } - } + for (Object isInterfaceParameter : isInterfaceList) { + for (Object isImplementationParameter : isImplementationList) { + for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { + for (Object singleWildcardParameter : singleWildcardList) { + for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { + for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { + + this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this.isInterface = (java.lang.Boolean) isInterfaceParameter; + this.isImplementation = (java.lang.Boolean) isImplementationParameter; + this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; + this.singleWildcard = (java.lang.String) singleWildcardParameter; + this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; + this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -155,19 +120,12 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); parameterValues.put("isInterface", this.isInterface); parameterValues.put("isImplementation", this.isImplementation); - parameterValues.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameterValues.put("isGWT", this.isGWT); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameterValues.put("singleWildcard", this.singleWildcard); parameterValues.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameterValues.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameterValues.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameterValues.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -181,19 +139,12 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); parameters.put("isInterface", this.isInterface); parameters.put("isImplementation", this.isImplementation); - parameters.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameters.put("isGWT", this.isGWT); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameters.put("singleWildcard", this.singleWildcard); parameters.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameters.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameters.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameters.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassdeclaredFieldGenFeatureinsert.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassdeclaredFieldGenFeatureinsert.java index 9a3b9e6b7d..d93b177693 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassdeclaredFieldGenFeatureinsert.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassdeclaredFieldGenFeatureinsert.java @@ -78,20 +78,10 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List isInterfaceList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List isImplementationList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List useInterfaceOverrideAnnotationList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isGWTList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List publicStaticFinalFlagList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List singleWildcardList = null; @@ -100,59 +90,34 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List positiveOffsetCorrectionList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List negativeOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List positiveOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genFeatureParameter : genFeatureList) { for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object isInterfaceParameter : isInterfaceList) { - for (Object isImplementationParameter : isImplementationList) { - for (Object useInterfaceOverrideAnnotationParameter : useInterfaceOverrideAnnotationList) { - for (Object isGWTParameter : isGWTList) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { - for (Object singleWildcardParameter : singleWildcardList) { - for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { - for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { - for (Object negativeOperationOffsetCorrectionParameter : negativeOperationOffsetCorrectionList) { - for (Object positiveOperationOffsetCorrectionParameter : positiveOperationOffsetCorrectionList) { - - this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.isInterface = (java.lang.Boolean) isInterfaceParameter; - this.isImplementation = (java.lang.Boolean) isImplementationParameter; - this.useInterfaceOverrideAnnotation = (java.lang.Boolean) useInterfaceOverrideAnnotationParameter; - this.isGWT = (java.lang.Boolean) isGWTParameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; - this.singleWildcard = (java.lang.String) singleWildcardParameter; - this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; - this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; - this.negativeOperationOffsetCorrection = (java.lang.String) negativeOperationOffsetCorrectionParameter; - this.positiveOperationOffsetCorrection = (java.lang.String) positiveOperationOffsetCorrectionParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } - } - } - } + for (Object isInterfaceParameter : isInterfaceList) { + for (Object isImplementationParameter : isImplementationList) { + for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { + for (Object singleWildcardParameter : singleWildcardList) { + for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { + for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { + + this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this.isInterface = (java.lang.Boolean) isInterfaceParameter; + this.isImplementation = (java.lang.Boolean) isImplementationParameter; + this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; + this.singleWildcard = (java.lang.String) singleWildcardParameter; + this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; + this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -184,19 +149,12 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); parameterValues.put("isInterface", this.isInterface); parameterValues.put("isImplementation", this.isImplementation); - parameterValues.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameterValues.put("isGWT", this.isGWT); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameterValues.put("singleWildcard", this.singleWildcard); parameterValues.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameterValues.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameterValues.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameterValues.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -216,19 +174,12 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); parameters.put("isInterface", this.isInterface); parameters.put("isImplementation", this.isImplementation); - parameters.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameters.put("isGWT", this.isGWT); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameters.put("singleWildcard", this.singleWildcard); parameters.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameters.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameters.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameters.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureTODOoverride.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureTODOoverride.java index 065ccfaee1..97f81f7d7e 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureTODOoverride.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureTODOoverride.java @@ -164,20 +164,10 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List isInterfaceList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List isImplementationList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List useInterfaceOverrideAnnotationList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isGWTList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List publicStaticFinalFlagList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List singleWildcardList = null; @@ -186,59 +176,34 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List positiveOffsetCorrectionList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List negativeOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List positiveOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genFeatureParameter : genFeatureList) { for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object isInterfaceParameter : isInterfaceList) { - for (Object isImplementationParameter : isImplementationList) { - for (Object useInterfaceOverrideAnnotationParameter : useInterfaceOverrideAnnotationList) { - for (Object isGWTParameter : isGWTList) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { - for (Object singleWildcardParameter : singleWildcardList) { - for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { - for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { - for (Object negativeOperationOffsetCorrectionParameter : negativeOperationOffsetCorrectionList) { - for (Object positiveOperationOffsetCorrectionParameter : positiveOperationOffsetCorrectionList) { - - this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.isInterface = (java.lang.Boolean) isInterfaceParameter; - this.isImplementation = (java.lang.Boolean) isImplementationParameter; - this.useInterfaceOverrideAnnotation = (java.lang.Boolean) useInterfaceOverrideAnnotationParameter; - this.isGWT = (java.lang.Boolean) isGWTParameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; - this.singleWildcard = (java.lang.String) singleWildcardParameter; - this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; - this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; - this.negativeOperationOffsetCorrection = (java.lang.String) negativeOperationOffsetCorrectionParameter; - this.positiveOperationOffsetCorrection = (java.lang.String) positiveOperationOffsetCorrectionParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } - } - } - } + for (Object isInterfaceParameter : isInterfaceList) { + for (Object isImplementationParameter : isImplementationList) { + for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { + for (Object singleWildcardParameter : singleWildcardList) { + for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { + for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { + + this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this.isInterface = (java.lang.Boolean) isInterfaceParameter; + this.isImplementation = (java.lang.Boolean) isImplementationParameter; + this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; + this.singleWildcard = (java.lang.String) singleWildcardParameter; + this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; + this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -270,19 +235,12 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); parameterValues.put("isInterface", this.isInterface); parameterValues.put("isImplementation", this.isImplementation); - parameterValues.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameterValues.put("isGWT", this.isGWT); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameterValues.put("singleWildcard", this.singleWildcard); parameterValues.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameterValues.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameterValues.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameterValues.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -302,19 +260,12 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); parameters.put("isInterface", this.isInterface); parameters.put("isImplementation", this.isImplementation); - parameters.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameters.put("isGWT", this.isGWT); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameters.put("singleWildcard", this.singleWildcard); parameters.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameters.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameters.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameters.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureoverride.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureoverride.java index 83c5aed813..e78cb2d85b 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureoverride.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassgetGenFeatureoverride.java @@ -253,20 +253,10 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List isInterfaceList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List isImplementationList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List useInterfaceOverrideAnnotationList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isGWTList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List publicStaticFinalFlagList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List singleWildcardList = null; @@ -275,59 +265,34 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List positiveOffsetCorrectionList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List negativeOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List positiveOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genFeatureParameter : genFeatureList) { for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object isInterfaceParameter : isInterfaceList) { - for (Object isImplementationParameter : isImplementationList) { - for (Object useInterfaceOverrideAnnotationParameter : useInterfaceOverrideAnnotationList) { - for (Object isGWTParameter : isGWTList) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { - for (Object singleWildcardParameter : singleWildcardList) { - for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { - for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { - for (Object negativeOperationOffsetCorrectionParameter : negativeOperationOffsetCorrectionList) { - for (Object positiveOperationOffsetCorrectionParameter : positiveOperationOffsetCorrectionList) { - - this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.isInterface = (java.lang.Boolean) isInterfaceParameter; - this.isImplementation = (java.lang.Boolean) isImplementationParameter; - this.useInterfaceOverrideAnnotation = (java.lang.Boolean) useInterfaceOverrideAnnotationParameter; - this.isGWT = (java.lang.Boolean) isGWTParameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; - this.singleWildcard = (java.lang.String) singleWildcardParameter; - this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; - this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; - this.negativeOperationOffsetCorrection = (java.lang.String) negativeOperationOffsetCorrectionParameter; - this.positiveOperationOffsetCorrection = (java.lang.String) positiveOperationOffsetCorrectionParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } - } - } - } + for (Object isInterfaceParameter : isInterfaceList) { + for (Object isImplementationParameter : isImplementationList) { + for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { + for (Object singleWildcardParameter : singleWildcardList) { + for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { + for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { + + this.genFeature = (org.eclipse.emf.codegen.ecore.genmodel.GenFeature) genFeatureParameter; + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this.isInterface = (java.lang.Boolean) isInterfaceParameter; + this.isImplementation = (java.lang.Boolean) isImplementationParameter; + this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; + this.singleWildcard = (java.lang.String) singleWildcardParameter; + this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; + this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -359,19 +324,12 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); parameterValues.put("isInterface", this.isInterface); parameterValues.put("isImplementation", this.isImplementation); - parameterValues.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameterValues.put("isGWT", this.isGWT); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameterValues.put("singleWildcard", this.singleWildcard); parameterValues.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameterValues.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameterValues.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameterValues.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -385,19 +343,12 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); parameters.put("isInterface", this.isInterface); parameters.put("isImplementation", this.isImplementation); - parameters.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameters.put("isGWT", this.isGWT); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameters.put("singleWildcard", this.singleWildcard); parameters.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameters.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameters.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameters.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassimplementedGenOperationTODOoverride.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassimplementedGenOperationTODOoverride.java index b8bd1c09b0..1c2d83d474 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassimplementedGenOperationTODOoverride.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/common/tig/model/ClassimplementedGenOperationTODOoverride.java @@ -110,20 +110,10 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List isInterfaceList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List isImplementationList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List useInterfaceOverrideAnnotationList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isGWTList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List publicStaticFinalFlagList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) List singleWildcardList = null; @@ -132,59 +122,34 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List positiveOffsetCorrectionList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List negativeOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List positiveOperationOffsetCorrectionList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genOperationParameter : genOperationList) { for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object isInterfaceParameter : isInterfaceList) { - for (Object isImplementationParameter : isImplementationList) { - for (Object useInterfaceOverrideAnnotationParameter : useInterfaceOverrideAnnotationList) { - for (Object isGWTParameter : isGWTList) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { - for (Object singleWildcardParameter : singleWildcardList) { - for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { - for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { - for (Object negativeOperationOffsetCorrectionParameter : negativeOperationOffsetCorrectionList) { - for (Object positiveOperationOffsetCorrectionParameter : positiveOperationOffsetCorrectionList) { - - this.genOperation = (org.eclipse.emf.codegen.ecore.genmodel.GenOperation) genOperationParameter; - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.isInterface = (java.lang.Boolean) isInterfaceParameter; - this.isImplementation = (java.lang.Boolean) isImplementationParameter; - this.useInterfaceOverrideAnnotation = (java.lang.Boolean) useInterfaceOverrideAnnotationParameter; - this.isGWT = (java.lang.Boolean) isGWTParameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; - this.singleWildcard = (java.lang.String) singleWildcardParameter; - this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; - this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; - this.negativeOperationOffsetCorrection = (java.lang.String) negativeOperationOffsetCorrectionParameter; - this.positiveOperationOffsetCorrection = (java.lang.String) positiveOperationOffsetCorrectionParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } - } - } - } + for (Object isInterfaceParameter : isInterfaceList) { + for (Object isImplementationParameter : isImplementationList) { + for (Object publicStaticFinalFlagParameter : publicStaticFinalFlagList) { + for (Object singleWildcardParameter : singleWildcardList) { + for (Object negativeOffsetCorrectionParameter : negativeOffsetCorrectionList) { + for (Object positiveOffsetCorrectionParameter : positiveOffsetCorrectionList) { + + this.genOperation = (org.eclipse.emf.codegen.ecore.genmodel.GenOperation) genOperationParameter; + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this.isInterface = (java.lang.Boolean) isInterfaceParameter; + this.isImplementation = (java.lang.Boolean) isImplementationParameter; + this.publicStaticFinalFlag = (java.lang.String) publicStaticFinalFlagParameter; + this.singleWildcard = (java.lang.String) singleWildcardParameter; + this.negativeOffsetCorrection = (java.lang.String) negativeOffsetCorrectionParameter; + this.positiveOffsetCorrection = (java.lang.String) positiveOffsetCorrectionParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -216,19 +181,12 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); parameterValues.put("isInterface", this.isInterface); parameterValues.put("isImplementation", this.isImplementation); - parameterValues.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameterValues.put("isGWT", this.isGWT); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameterValues.put("singleWildcard", this.singleWildcard); parameterValues.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameterValues.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameterValues.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameterValues.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -248,19 +206,12 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); parameters.put("isInterface", this.isInterface); parameters.put("isImplementation", this.isImplementation); - parameters.put("useInterfaceOverrideAnnotation", this.useInterfaceOverrideAnnotation); - parameters.put("isGWT", this.isGWT); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("publicStaticFinalFlag", this.publicStaticFinalFlag); parameters.put("singleWildcard", this.singleWildcard); parameters.put("negativeOffsetCorrection", this.negativeOffsetCorrection); parameters.put("positiveOffsetCorrection", this.positiveOffsetCorrection); - parameters.put("negativeOperationOffsetCorrection", this.negativeOperationOffsetCorrection); - parameters.put("positiveOperationOffsetCorrection", this.positiveOperationOffsetCorrection); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/core/edit/ItemProviderInsert.java b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/core/edit/ItemProviderInsert.java index 53f0115b1f..00b4f9c595 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/core/edit/ItemProviderInsert.java +++ b/releng/plugins/org.polarsys.capella.core.egf/generated/org/polarsys/capella/core/edit/ItemProviderInsert.java @@ -60,44 +60,24 @@ public String generate(Object argument) throws Exception { //this pattern can only be called by another (i.e. it's not an entry point in execution) List genModelList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List isJDK50List = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List forceDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) - List indentDefaultCaseList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) List _ListList = null; //this pattern can only be called by another (i.e. it's not an entry point in execution) - List hasSwitchList = null; - //this pattern can only be called by another (i.e. it's not an entry point in execution) for (Object genClassParameter : genClassList) { for (Object genPackageParameter : genPackageList) { for (Object genModelParameter : genModelList) { - for (Object isJDK50Parameter : isJDK50List) { - for (Object forceDefaultCaseParameter : forceDefaultCaseList) { - for (Object indentDefaultCaseParameter : indentDefaultCaseList) { - for (Object _ListParameter : _ListList) { - for (Object hasSwitchParameter : hasSwitchList) { - - this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; - this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; - this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; - this.isJDK50 = (java.lang.Boolean) isJDK50Parameter; - this.forceDefaultCase = (java.lang.Boolean) forceDefaultCaseParameter; - this.indentDefaultCase = (java.lang.String) indentDefaultCaseParameter; - this._List = (java.lang.String) _ListParameter; - this.hasSwitch = (java.lang.Boolean) hasSwitchParameter; - - if (preCondition(ctx)) { - ctx.setNode(new Node.Container(currentNode, getClass())); - orchestration(ctx); - } - - } - } - } + for (Object _ListParameter : _ListList) { + + this.genClass = (org.eclipse.emf.codegen.ecore.genmodel.GenClass) genClassParameter; + this.genPackage = (org.eclipse.emf.codegen.ecore.genmodel.GenPackage) genPackageParameter; + this.genModel = (org.eclipse.emf.codegen.ecore.genmodel.GenModel) genModelParameter; + this._List = (java.lang.String) _ListParameter; + + if (preCondition(ctx)) { + ctx.setNode(new Node.Container(currentNode, getClass())); + orchestration(ctx); } + } } } @@ -122,11 +102,7 @@ public String orchestration(PatternContext ctx) throws Exception { parameterValues.put("genClass", this.genClass); parameterValues.put("genPackage", this.genPackage); parameterValues.put("genModel", this.genModel); - parameterValues.put("isJDK50", this.isJDK50); - parameterValues.put("forceDefaultCase", this.forceDefaultCase); - parameterValues.put("indentDefaultCase", this.indentDefaultCase); parameterValues.put("_List", this._List); - parameterValues.put("hasSwitch", this.hasSwitch); String outputWithCallBack = OutputManager.computeLoopOutput(ictx); String loop = OutputManager.computeLoopOutputWithoutCallback(ictx); ictx.getReporter().loopFinished(loop, outputWithCallBack, ictx, parameterValues); @@ -139,11 +115,7 @@ public Map getParameters() { parameters.put("genClass", this.genClass); parameters.put("genPackage", this.genPackage); parameters.put("genModel", this.genModel); - parameters.put("isJDK50", this.isJDK50); - parameters.put("forceDefaultCase", this.forceDefaultCase); - parameters.put("indentDefaultCase", this.indentDefaultCase); parameters.put("_List", this._List); - parameters.put("hasSwitch", this.hasSwitch); return parameters; } diff --git a/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/AbstractGenerator.java b/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/AbstractGenerator.java index f92fbda4db..b6d6219c2c 100644 --- a/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/AbstractGenerator.java +++ b/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/AbstractGenerator.java @@ -12,11 +12,12 @@ *******************************************************************************/ package org.polarsys.capella.core.egf; -import org.apache.log4j.Logger; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.ui.statushandlers.StatusManager; +import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; /** * Base class generator implementation.
@@ -42,12 +43,11 @@ protected boolean handleDiagnostic(Diagnostic diagnostic, String message) { handleDiagnostic(child, message); } Throwable exception = diagnostic.getException(); + Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (null != exception) { loggerMessage.append(exception.getMessage()); - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, loggerMessage.toString(), exception)); - } else { - Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, loggerMessage.toString(), exception)); } + Platform.getLog(bundle).error(loggerMessage.toString(), exception); result = false; } return result; diff --git a/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/Activator.java b/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/Activator.java deleted file mode 100644 index f4447ca846..0000000000 --- a/releng/plugins/org.polarsys.capella.core.egf/src/org/polarsys/capella/core/egf/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.core.egf; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "egf"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/tests/plugins/.project b/tests/plugins/.project new file mode 100644 index 0000000000..2f3b5af791 --- /dev/null +++ b/tests/plugins/.project @@ -0,0 +1,17 @@ + + + tests_plugins + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/tests/plugins/.settings/org.eclipse.core.resources.prefs b/tests/plugins/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..4824b80263 --- /dev/null +++ b/tests/plugins/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.benchmarks.ju/META-INF/MANIFEST.MF index 12a2a958c1..f3b39ca8f8 100644 --- a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.benchmarks.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.benchmarks.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.benchmarks.ju.CapellaPerformanceTestsActivator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.apache.xerces, diff --git a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/CapellaPerformanceTestsActivator.java b/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/CapellaPerformanceTestsActivator.java deleted file mode 100644 index 7c1126ac7c..0000000000 --- a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/CapellaPerformanceTestsActivator.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.benchmarks.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -public class CapellaPerformanceTestsActivator extends Plugin { - - public static final String PLUGIN_ID = "org.polarsys.capella.test.benchmarks.ju"; //$NON-NLS-1$ - - public static CapellaPerformanceTestsActivator getDefault() { - return plugin; - } - - private static CapellaPerformanceTestsActivator plugin; - - /** - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - super.start(bundleContext); - plugin = this; - } - - /** - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - plugin = null; - super.stop(bundleContext); - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/TestParameters.java b/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/TestParameters.java index e1df385a00..9088107eed 100644 --- a/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/TestParameters.java +++ b/tests/plugins/org.polarsys.capella.test.benchmarks.ju/src/org/polarsys/capella/test/benchmarks/ju/TestParameters.java @@ -13,6 +13,7 @@ package org.polarsys.capella.test.benchmarks.ju; import org.eclipse.core.runtime.IConfigurationElement; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; public class TestParameters implements ITestParameters { @@ -26,7 +27,7 @@ private TestParameters() { public static ITestParameters getInstance() { if (instance == null) { for (IConfigurationElement configElement : ExtensionPointHelper - .getConfigurationElements(CapellaPerformanceTestsActivator.PLUGIN_ID, TEST_PARAMETER_EXT_POINT)) { + .getConfigurationElements(FrameworkUtil.getBundle(TestParameters.class).getSymbolicName(), TEST_PARAMETER_EXT_POINT)) { instance = (ITestParameters) ExtensionPointHelper.createInstance(configElement, ExtensionPointHelper.ATT_CLASS); } diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.business.queries.ju/META-INF/MANIFEST.MF index e1f5655df2..7a3ffa0763 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.business.queries.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.business.queries.ju.TestBusinessQueriesPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.data.business.queries;visibility:=reexport, diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestConstants.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestConstants.java index 6e59a611a7..35028fe2fd 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestConstants.java +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestConstants.java @@ -51,7 +51,7 @@ public class BQTestConstants { public static boolean isDiscardedBQ(String bqFqn) { if (discardedBQs == null) { try { - File fileConf = IResourceHelpers.getFileInPlugin(TestBusinessQueriesPlugin.class, + File fileConf = IResourceHelpers.getFileInPlugin(BQTestConstants.class, BQTestConstants.DISCARDED_BQ_CONFIGURATION_FILE_RELATIVE_PATH); String data = IResourceHelpers.readFileAsString(fileConf); discardedBQs = Arrays.asList(data.split("\\r?\\n")); //$NON-NLS-1$ diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestHelpers.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestHelpers.java index 97453e9df1..22ec2a8e8c 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestHelpers.java +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/BQTestHelpers.java @@ -32,6 +32,7 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.sirius.business.api.session.Session; import org.osgi.framework.Bundle; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.business.queries.IBusinessQuery; /** @@ -130,7 +131,7 @@ public static List getAllObjectsInSession(Session session, EClass clazz * Return the File location of this plugin. On a debug session, Generation will generate directly on it. */ public static File getBqTestProject() { - Bundle bundle = TestBusinessQueriesPlugin.getDefault().getBundle(); + Bundle bundle = FrameworkUtil.getBundle(BQTestHelpers.class); File file = new File(bundle.getLocation().substring("reference:file:/".length())); return file; } diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/TestBusinessQueriesPlugin.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/TestBusinessQueriesPlugin.java deleted file mode 100644 index 1d360af60e..0000000000 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/TestBusinessQueriesPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.business.queries.ju; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.ui.services.AbstractUIActivator; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestBusinessQueriesPlugin extends AbstractUIActivator { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.business.queries.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestBusinessQueriesPlugin plugin; - - /** - * The constructor - */ - public TestBusinessQueriesPlugin() { - // Do Nothing - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TestBusinessQueriesPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/GenerateQueriesHandler.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/GenerateQueriesHandler.java index acf0f63d13..901650b395 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/GenerateQueriesHandler.java +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/GenerateQueriesHandler.java @@ -30,6 +30,7 @@ import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.HandlerUtil; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.libraries.ILibraryManager; import org.polarsys.capella.common.libraries.IModel; @@ -41,7 +42,6 @@ import org.polarsys.capella.test.business.queries.ju.BQTestConstants; import org.polarsys.capella.test.business.queries.ju.BQTestHelpers; import org.polarsys.capella.test.business.queries.ju.QueryResult; -import org.polarsys.capella.test.business.queries.ju.TestBusinessQueriesPlugin; import org.polarsys.capella.test.framework.helpers.IResourceHelpers; /** @@ -100,7 +100,7 @@ public IStatus run(IProgressMonitor monitor) { } monitor.worked(1); } - return new Status(IStatus.WARNING, TestBusinessQueriesPlugin.PLUGIN_ID, + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Generated in " + BQTestHelpers.getBqTestProject().getAbsolutePath()); } }; diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/SortQueriesHandler.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/SortQueriesHandler.java index e182052bc5..6123ec6fa3 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/SortQueriesHandler.java +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/handlers/SortQueriesHandler.java @@ -28,12 +28,12 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.handlers.HandlerUtil; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EcoreUtil2; import org.polarsys.capella.common.ui.services.commands.AbstractUiHandler; import org.polarsys.capella.core.business.queries.IBusinessQuery; import org.polarsys.capella.test.business.queries.ju.BQTestHelpers; import org.polarsys.capella.test.business.queries.ju.QueryResult; -import org.polarsys.capella.test.business.queries.ju.TestBusinessQueriesPlugin; import org.polarsys.capella.test.framework.helpers.IResourceHelpers; /** @@ -71,7 +71,7 @@ public IStatus run(IProgressMonitor monitor) { monitor.worked(1); } - return new Status(IStatus.WARNING, TestBusinessQueriesPlugin.PLUGIN_ID, "Sorted in "+BQTestHelpers.getBqTestProject().getAbsolutePath()); + return new Status(IStatus.WARNING, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Sorted in "+BQTestHelpers.getBqTestProject().getAbsolutePath()); } }; diff --git a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/views/BqLabelProvider.java b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/views/BqLabelProvider.java index ebe58f2921..870e72cf34 100644 --- a/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/views/BqLabelProvider.java +++ b/tests/plugins/org.polarsys.capella.test.business.queries.ju/src/org/polarsys/capella/test/business/queries/ju/views/BqLabelProvider.java @@ -4,11 +4,12 @@ import org.eclipse.core.runtime.Adapters; import org.eclipse.emf.ecore.EObject; import org.eclipse.swt.graphics.Image; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ui.providers.MDEAdapterFactoryLabelProvider; import org.polarsys.capella.test.business.queries.ju.QueryResult; import org.polarsys.capella.test.business.queries.ju.ResultItem; import org.polarsys.capella.test.business.queries.ju.ResultItem.Kind; -import org.polarsys.capella.test.business.queries.ju.TestBusinessQueriesPlugin; import org.polarsys.kitalpha.emde.model.Element; public class BqLabelProvider extends MDEAdapterFactoryLabelProvider { @@ -48,11 +49,11 @@ public String getText(Object object) { @Override public Image getImage(Object object) { if (object instanceof IFile) { - return TestBusinessQueriesPlugin.getDefault().getImage("full/obj16/test.png"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/full/obj16/test.png").createImage(); } if (object instanceof QueryResult) { if (((QueryResult) object).getBusinessQuery() == null) { - return TestBusinessQueriesPlugin.getDefault().getImage("full/obj16/error_tsk.png"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/full/obj16/error_tsk.png").createImage(); } EObject adapt = Adapters.adapt(object, Element.class); if (adapt != null) { @@ -60,10 +61,10 @@ public Image getImage(Object object) { } } else if (object instanceof ResultItem) { if (((ResultItem)object).getKind() == Kind.ADDED) { - return TestBusinessQueriesPlugin.getDefault().getImage("full/obj16/add_obj.png"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/full/obj16/add_obj.png").createImage(); } if (((ResultItem)object).getKind() == Kind.MISSING) { - return TestBusinessQueriesPlugin.getDefault().getImage("full/obj16/delete_edit.png"); + return AbstractUIPlugin.imageDescriptorFromPlugin(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "icons/full/obj16/delete_edit.png").createImage(); } EObject adapt = Adapters.adapt(object, Element.class); if (adapt != null) { diff --git a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/TestDiagramCommonPlugin.java b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/TestDiagramCommonPlugin.java index 2396e4c301..e288e0cb0b 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/TestDiagramCommonPlugin.java +++ b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/TestDiagramCommonPlugin.java @@ -25,9 +25,6 @@ */ public class TestDiagramCommonPlugin extends AbstractUIPlugin { - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.diagram.common.ju"; //$NON-NLS-1$ - // The shared instance private static TestDiagramCommonPlugin plugin; diff --git a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/step/tools/DeleteElementTool.java b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/step/tools/DeleteElementTool.java index e95da1f18c..82e357e5f0 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/step/tools/DeleteElementTool.java +++ b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/step/tools/DeleteElementTool.java @@ -27,9 +27,9 @@ import org.eclipse.sirius.diagram.business.api.helper.delete.DeleteHookHelper; import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription; import org.junit.Assert; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; import org.polarsys.capella.core.commands.preferences.service.ScopedCapellaPreferencesStore; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.model.preferences.IDeletePreferences; import org.polarsys.capella.test.diagram.common.ju.context.DiagramContext; import org.polarsys.capella.test.diagram.common.ju.wrapper.Messages; @@ -74,8 +74,8 @@ public void delete(DDiagramElement element) { private void disableConfirmation() { // ScopedCapellaPreferencesStore.setValue(boolean) doesn't work if setDefault has same value - ScopedCapellaPreferencesStore.getInstance(CapellaModelPreferencesPlugin.PLUGIN_ID).setDefault(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, true); - ScopedCapellaPreferencesStore.getInstance(CapellaModelPreferencesPlugin.PLUGIN_ID).setValue(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, false); + ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(IDeletePreferences.class).getSymbolicName()).setDefault(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, true); + ScopedCapellaPreferencesStore.getInstance(FrameworkUtil.getBundle(IDeletePreferences.class).getSymbolicName()).setValue(IDeletePreferences.PREFERENCE_CONFIRM_DELETE, false); } public void deleteAll() { diff --git a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/wrapper/AbstractToolWrapper.java b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/wrapper/AbstractToolWrapper.java index 278af0e2e0..560382e268 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/wrapper/AbstractToolWrapper.java +++ b/tests/plugins/org.polarsys.capella.test.diagram.common.ju/src/org/polarsys/capella/test/diagram/common/ju/wrapper/AbstractToolWrapper.java @@ -27,7 +27,7 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription; -import org.polarsys.capella.test.diagram.common.ju.TestDiagramCommonPlugin; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.test.diagram.common.ju.wrapper.utils.ArgumentType; import org.polarsys.capella.test.diagram.common.ju.wrapper.utils.InvalidArgumentException; @@ -119,7 +119,7 @@ final public boolean isArgumentsAreSet() { final public IStatus checkArguments() { boolean ret = true; - MultiStatus result = new MultiStatus(TestDiagramCommonPlugin.PLUGIN_ID, Status.OK, "isArgumentsAreSet", null); + MultiStatus result = new MultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), Status.OK, "isArgumentsAreSet", null); Iterator it = getArgumentTypes().iterator(); while (it.hasNext() && ret) { @@ -130,20 +130,20 @@ final public IStatus checkArguments() { || (currentType.equals(ArgumentType.PREDECESSOR) && (_arguments.get(currentType) == null)) || (currentType.equals(ArgumentType.STARTINGENDPREDECESSOR) && (_arguments.get(currentType) == null)) || (currentType.equals(ArgumentType.FINISHINGENDPREDECESSOR) && (_arguments.get(currentType) == null))) { - result.add(new Status(Status.OK, TestDiagramCommonPlugin.PLUGIN_ID, currentType + " is ok")); + result.add(new Status(Status.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), currentType + " is ok")); return result; } if (!_arguments.containsKey(currentType) || (_arguments.get(currentType) == null)) { - result.add(new Status(Status.ERROR, TestDiagramCommonPlugin.PLUGIN_ID, currentType + " is not set or null")); + result.add(new Status(Status.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), currentType + " is not set or null")); } else { ret = checkValue(currentType); if (ret) { - result.add(new Status(Status.OK, TestDiagramCommonPlugin.PLUGIN_ID, currentType + " is ok")); + result.add(new Status(Status.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), currentType + " is ok")); } else { - result.add(new Status(Status.ERROR, TestDiagramCommonPlugin.PLUGIN_ID, currentType + " is not value")); + result.add(new Status(Status.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), currentType + " is not value")); } } } diff --git a/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/META-INF/MANIFEST.MF index ea663c93ca..1b576bd8be 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.diagram.filters.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.diagram.filters.ju.TestDiagramFiltersPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.diagram.common.ju;visibility:=reexport, diff --git a/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/src/org/polarsys/capella/test/diagram/filters/ju/TestDiagramFiltersPlugin.java b/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/src/org/polarsys/capella/test/diagram/filters/ju/TestDiagramFiltersPlugin.java deleted file mode 100644 index a7f02f044f..0000000000 --- a/tests/plugins/org.polarsys.capella.test.diagram.filters.ju/src/org/polarsys/capella/test/diagram/filters/ju/TestDiagramFiltersPlugin.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.diagram.filters.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestDiagramFiltersPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.diagram.filters.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestDiagramFiltersPlugin plugin; - - /** - * The constructor - */ - public TestDiagramFiltersPlugin() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 TestDiagramFiltersPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/META-INF/MANIFEST.MF index 657138a94a..2bac462016 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.diagram.misc.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.diagram.misc.ju.TestDiagramMiscPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.diagram.common.ju;visibility:=reexport, @@ -20,7 +19,8 @@ Require-Bundle: org.eclipse.ui, org.eclipse.swt, org.polarsys.capella.core.platform.sirius.clipboard, org.polarsys.capella.core.preferences, - org.polarsys.capella.core.model.handler + org.polarsys.capella.core.model.handler, + org.polarsys.capella.core.model.preferences Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName diff --git a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/TestDiagramMiscPlugin.java b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/TestDiagramMiscPlugin.java deleted file mode 100644 index 98810a846a..0000000000 --- a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/TestDiagramMiscPlugin.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.diagram.misc.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -@SuppressWarnings({"findbugs:ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD","squid:S2696"}) -public class TestDiagramMiscPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.diagram.misc.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestDiagramMiscPlugin plugin; - - /** - * The constructor - */ - public TestDiagramMiscPlugin() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 TestDiagramMiscPlugin getDefault() { - return plugin; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/AllocationManagementTest.java b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/AllocationManagementTest.java index 6337b98171..c739c6e87e 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/AllocationManagementTest.java +++ b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/AllocationManagementTest.java @@ -25,8 +25,8 @@ import org.polarsys.capella.core.data.fa.FunctionInputPort; import org.polarsys.capella.core.data.fa.FunctionOutputPort; import org.polarsys.capella.core.data.fa.FunctionalExchange; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.model.preferences.ISynchronizationPreferences; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.platform.sirius.ui.actions.AllocationManagementAction; import org.polarsys.capella.core.preferences.Activator; import org.polarsys.capella.test.framework.api.BasicTestCase; @@ -116,7 +116,7 @@ protected void assertFunctionalExchangeToComponentExchangeAllocation(FunctionalE String.valueOf(syncFunctionPortsToComponentPorts)); assertEquals(syncFunctionPortsToComponentPorts, - CapellaModelPreferencesPlugin.getDefault().isSynchronizationOfComponentPortToFunctionPortAllowed()); + PreferencesHelper.isSynchronizationOfComponentPortToFunctionPortAllowed()); TransactionHelper.getExecutionManager(functionalExchange).execute(new AbstractReadWriteCommand() { @Override @@ -155,7 +155,7 @@ protected void assertComponentExchangeToPhysicalLinkAllocation(ComponentExchange ISynchronizationPreferences.PREFS_ALLOW_SYNC_PHYSICALPORT_TO_COMPONENTPORT_ON_PHYSICALLINK, String.valueOf(syncPhysicalPortsToComponentPorts)); - assertEquals(syncPhysicalPortsToComponentPorts, CapellaModelPreferencesPlugin.getDefault() + assertEquals(syncPhysicalPortsToComponentPorts, PreferencesHelper .isSynchronizationOfPhysicalPortToComponentPortOnPhysicalLinkAllowed()); TransactionHelper.getExecutionManager(componentExchange).execute(new AbstractReadWriteCommand() { diff --git a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/CheckPhysCompNatureOptionTestCase.java b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/CheckPhysCompNatureOptionTestCase.java index f5b0cca807..9bfb9c96aa 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/CheckPhysCompNatureOptionTestCase.java +++ b/tests/plugins/org.polarsys.capella.test.diagram.misc.ju/src/org/polarsys/capella/test/diagram/misc/ju/testcases/CheckPhysCompNatureOptionTestCase.java @@ -22,8 +22,8 @@ import org.polarsys.capella.core.data.pa.PhysicalComponent; import org.polarsys.capella.core.data.pa.properties.fields.PhysicalComponentNatureGroup; import org.polarsys.capella.core.data.pa.properties.sections.PhysicalComponentSection; -import org.polarsys.capella.core.model.preferences.CapellaModelPreferencesPlugin; import org.polarsys.capella.core.model.preferences.IDataPreferences; +import org.polarsys.capella.core.model.preferences.helpers.PreferencesHelper; import org.polarsys.capella.core.preferences.Activator; import org.polarsys.capella.core.ui.properties.fields.AbstractSemanticField; import org.polarsys.capella.test.framework.api.BasicTestCase; @@ -42,14 +42,14 @@ public void test() { assertNotNull(session); updateDataPreferences("true"); - assertTrue(CapellaModelPreferencesPlugin.getDefault().isChangePhysicalComponentNatureAllowed()); + assertTrue(PreferencesHelper.isChangePhysicalComponentNatureAllowed()); SessionContext context = new SessionContext(session); String idPhysComp_01 = "6a369845-b31c-4c9f-b586-3b659d245b88"; PhysicalComponent PC_01 = (PhysicalComponent) context.getSemanticElement(idPhysComp_01); checkPhysicalComponentSection(PC_01, true); updateDataPreferences("false"); - assertFalse(CapellaModelPreferencesPlugin.getDefault().isChangePhysicalComponentNatureAllowed()); + assertFalse(PreferencesHelper.isChangePhysicalComponentNatureAllowed()); checkPhysicalComponentSection(PC_01, false); } diff --git a/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/META-INF/MANIFEST.MF index 0a743e61d4..709a893241 100644 --- a/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.diagram.tools.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.diagram.tools.ju.TestDiagramToolsPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.test.diagram.common.ju;visibility:=reexport, @@ -17,8 +16,7 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.common.queries Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.test.diagram.tools.ju, - org.polarsys.capella.test.diagram.tools.ju.cdb, +Export-Package: org.polarsys.capella.test.diagram.tools.ju.cdb, org.polarsys.capella.test.diagram.tools.ju.diagram.actions, org.polarsys.capella.test.diagram.tools.ju.es, org.polarsys.capella.test.diagram.tools.ju.idb, diff --git a/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/src/org/polarsys/capella/test/diagram/tools/ju/TestDiagramToolsPlugin.java b/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/src/org/polarsys/capella/test/diagram/tools/ju/TestDiagramToolsPlugin.java deleted file mode 100644 index f79962f15d..0000000000 --- a/tests/plugins/org.polarsys.capella.test.diagram.tools.ju/src/org/polarsys/capella/test/diagram/tools/ju/TestDiagramToolsPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.diagram.tools.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestDiagramToolsPlugin extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.diagram.tools.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestDiagramToolsPlugin plugin; - - /** - * The constructor - */ - public TestDiagramToolsPlugin() { - // Do Nothing - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TestDiagramToolsPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.doc.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.doc.ju/META-INF/MANIFEST.MF index 24612c616a..d72660687a 100644 --- a/tests/plugins/org.polarsys.capella.test.doc.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.doc.ju/META-INF/MANIFEST.MF @@ -5,7 +5,6 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.polarsys.capella.test.doc.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.doc.ju.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.doc.ju/src/org/polarsys/capella/test/doc/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.doc.ju/src/org/polarsys/capella/test/doc/ju/Activator.java deleted file mode 100644 index 008e3a8754..0000000000 --- a/tests/plugins/org.polarsys.capella.test.doc.ju/src/org/polarsys/capella/test/doc/ju/Activator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.doc.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.doc.ju"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/META-INF/MANIFEST.MF index 9b28d26299..3e273b199f 100644 --- a/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.explorer.activity.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.explorer.activity.ju.TestActivityExplorerPlugin Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.test.framework, org.eclipse.amalgam.explorer.activity.ui, @@ -17,6 +16,5 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName Bundle-Localization: plugin -Export-Package: org.polarsys.capella.test.explorer.activity.ju, - org.polarsys.capella.test.explorer.activity.ju.testcases, +Export-Package: org.polarsys.capella.test.explorer.activity.ju.testcases, org.polarsys.capella.test.explorer.activity.ju.testsuites diff --git a/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/src/org/polarsys/capella/test/explorer/activity/ju/TestActivityExplorerPlugin.java b/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/src/org/polarsys/capella/test/explorer/activity/ju/TestActivityExplorerPlugin.java deleted file mode 100644 index b9f06bca62..0000000000 --- a/tests/plugins/org.polarsys.capella.test.explorer.activity.ju/src/org/polarsys/capella/test/explorer/activity/ju/TestActivityExplorerPlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.explorer.activity.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -public class TestActivityExplorerPlugin extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.explorer.activity.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestActivityExplorerPlugin plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static TestActivityExplorerPlugin getDefault() { - return plugin; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.fastlinker.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.fastlinker.ju/META-INF/MANIFEST.MF index 0a0415710f..3a7faaa9e5 100644 --- a/tests/plugins/org.polarsys.capella.test.fastlinker.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.fastlinker.ju/META-INF/MANIFEST.MF @@ -3,14 +3,12 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.fastlinker.ju; singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.fastlinker.ju.TestFastLinkerPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.ui.fastlinker, org.polarsys.capella.test.framework Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.test.fastlinker.ju, - org.polarsys.capella.test.fastlinker.ju.testcases, +Export-Package: org.polarsys.capella.test.fastlinker.ju.testcases, org.polarsys.capella.test.fastlinker.ju.testsuites Bundle-Localization: plugin diff --git a/tests/plugins/org.polarsys.capella.test.fastlinker.ju/src/org/polarsys/capella/test/fastlinker/ju/TestFastLinkerPlugin.java b/tests/plugins/org.polarsys.capella.test.fastlinker.ju/src/org/polarsys/capella/test/fastlinker/ju/TestFastLinkerPlugin.java deleted file mode 100644 index 285262ae9d..0000000000 --- a/tests/plugins/org.polarsys.capella.test.fastlinker.ju/src/org/polarsys/capella/test/fastlinker/ju/TestFastLinkerPlugin.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.fastlinker.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestFastLinkerPlugin extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.fastlinker.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestFastLinkerPlugin plugin; - - /** - * The constructor - */ - public TestFastLinkerPlugin() { - // Nothing to do. - } - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static TestFastLinkerPlugin getDefault() { - return plugin; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.fragmentation/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.fragmentation/META-INF/MANIFEST.MF index 55a44f7611..d71bb9429d 100644 --- a/tests/plugins/org.polarsys.capella.test.fragmentation/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.fragmentation/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.fragmentation Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.fragmentation.ju.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework;bundle-version="0.8.0", @@ -16,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.commandline.core Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.polarsys.capella.test.fragmentation.ju, - org.polarsys.capella.test.fragmentation.ju.testsuites +Export-Package: org.polarsys.capella.test.fragmentation.ju.testsuites Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/Activator.java deleted file mode 100644 index 3a4e45955c..0000000000 --- a/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/Activator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.fragmentation.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.fragmentation.ju"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/utils/initegrity/IntegrityChecker.java b/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/utils/initegrity/IntegrityChecker.java index 26277d1785..63ad0fe76b 100644 --- a/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/utils/initegrity/IntegrityChecker.java +++ b/tests/plugins/org.polarsys.capella.test.fragmentation/src/org/polarsys/capella/test/fragmentation/ju/utils/initegrity/IntegrityChecker.java @@ -33,11 +33,11 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DView; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.helpers.EObjectExt; import org.polarsys.capella.common.helpers.EObjectLabelProviderHelper; import org.polarsys.capella.core.commandline.core.AbstractCommandLine; import org.polarsys.capella.core.sirius.analysis.tool.HashMapSet; -import org.polarsys.capella.test.fragmentation.ju.Activator; /** * This class retrieve elements which are duplicated in other resources of the session @@ -114,7 +114,7 @@ public IStatus getStatus(Session session_p, Logger logger_p, IProgressMonitor mo EObjectLabelProviderHelper.getText(objects.get(idDuplicate).iterator().next()), idDuplicate)); } - statuses.add(new Status(AbstractCommandLine.FATAL, Activator.PLUGIN_ID, buffer.toString())); + statuses.add(new Status(AbstractCommandLine.FATAL, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), buffer.toString())); } submonitor.worked(1); @@ -165,17 +165,17 @@ public IStatus getStatus(Session session_p, Logger logger_p, IProgressMonitor mo } } } - statuses.add(new Status(AbstractCommandLine.FATAL, Activator.PLUGIN_ID, buffer.toString())); + statuses.add(new Status(AbstractCommandLine.FATAL, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), buffer.toString())); } submonitor.worked(1); submonitor.done(); monitor_p.done(); if (statuses.size() > 0) { - return new MultiStatus(Activator.PLUGIN_ID, IStatus.ERROR, statuses.toArray(new IStatus[0]), + return new MultiStatus(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IStatus.ERROR, statuses.toArray(new IStatus[0]), IntegrityChecker_FailedDuplicateElements, null); } - return new Status(IStatus.OK, Activator.PLUGIN_ID, IntegrityChecker_OK); + return new Status(IStatus.OK, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), IntegrityChecker_OK); } } diff --git a/tests/plugins/org.polarsys.capella.test.framework/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.framework/META-INF/MANIFEST.MF index a298e3699f..0ae1c0f4f4 100644 --- a/tests/plugins/org.polarsys.capella.test.framework/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.framework/META-INF/MANIFEST.MF @@ -37,6 +37,5 @@ Export-Package: org.polarsys.capella.test.framework, org.polarsys.capella.test.framework.model, org.polarsys.capella.test.framework.provider Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-Activator: org.polarsys.capella.test.framework.CapellaTestFrameworkPlugin Bundle-ClassPath: . Bundle-Localization: plugin diff --git a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/CapellaTestFrameworkPlugin.java b/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/CapellaTestFrameworkPlugin.java deleted file mode 100644 index 2c9dfc04eb..0000000000 --- a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/CapellaTestFrameworkPlugin.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.framework; - -import org.osgi.framework.BundleContext; -import org.polarsys.capella.common.mdsofa.common.activator.AbstractActivator; - -/** - * Activator - */ -public class CapellaTestFrameworkPlugin extends AbstractActivator { - - private static CapellaTestFrameworkPlugin __instance; - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.framework"; //$NON-NLS-1$ - - - /** - * Get the singleton instance. - * - * @return - */ - public static CapellaTestFrameworkPlugin getDefault() { - return __instance; - } - - /** - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context_p) throws Exception { - super.start(context_p); - __instance = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context_p) throws Exception { - __instance = null; - super.stop(context_p); - } -} diff --git a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ChangeLocker.java b/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ChangeLocker.java index 9ee0c0d7a5..774f89edc7 100644 --- a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ChangeLocker.java +++ b/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ChangeLocker.java @@ -18,7 +18,7 @@ import org.eclipse.emf.transaction.ResourceSetChangeEvent; import org.eclipse.emf.transaction.ResourceSetListenerImpl; import org.eclipse.emf.transaction.RollbackException; -import org.polarsys.capella.test.framework.CapellaTestFrameworkPlugin; +import org.osgi.framework.FrameworkUtil; /** * Used to make test model read-only when a test case works on this model and is not the owner.
@@ -30,6 +30,6 @@ public class ChangeLocker extends ResourceSetListenerImpl { @Override public Command transactionAboutToCommit(ResourceSetChangeEvent event) throws RollbackException { - throw new RollbackException(new Status(IStatus.CANCEL, CapellaTestFrameworkPlugin.PLUGIN_ID, "Test model can not be modified by a test artefact which is not its owner.")); + throw new RollbackException(new Status(IStatus.CANCEL, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "Test model can not be modified by a test artefact which is not its owner.")); } } diff --git a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ModelProviderHelper.java b/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ModelProviderHelper.java index f78be36a94..8e29f26d2f 100644 --- a/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ModelProviderHelper.java +++ b/tests/plugins/org.polarsys.capella.test.framework/src/org/polarsys/capella/test/framework/api/ModelProviderHelper.java @@ -22,9 +22,9 @@ import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.sirius.business.api.session.Session; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; import org.polarsys.capella.common.mdsofa.common.helper.ProjectHelper; -import org.polarsys.capella.test.framework.CapellaTestFrameworkPlugin; import org.polarsys.capella.test.framework.helpers.GuiActions; import org.polarsys.capella.test.framework.helpers.IResourceHelpers; import org.polarsys.capella.test.framework.helpers.TestHelper; @@ -52,7 +52,7 @@ public static ModelProviderHelper getInstance() { */ private void initExtensionListeners() { for (IConfigurationElement configElement : ExtensionPointHelper - .getConfigurationElements(CapellaTestFrameworkPlugin.PLUGIN_ID, MODEL_PROVIDER_EXT_POINT)) { + .getConfigurationElements(FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), MODEL_PROVIDER_EXT_POINT)) { modelProvider = (IModelProvider) ExtensionPointHelper.createInstance(configElement, ExtensionPointHelper.ATT_CLASS); } diff --git a/tests/plugins/org.polarsys.capella.test.library.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.library.ju/META-INF/MANIFEST.MF index 73cd5d668c..f33cb9c8df 100644 --- a/tests/plugins/org.polarsys.capella.test.library.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.library.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.library.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.libraries.ju.TestLibrariesPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, @@ -12,7 +11,6 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName Bundle-Localization: plugin -Export-Package: org.polarsys.capella.test.libraries.ju, - org.polarsys.capella.test.libraries.ju.testcases.basic, +Export-Package: org.polarsys.capella.test.libraries.ju.testcases.basic, org.polarsys.capella.test.libraries.ju.testsuites.main, org.polarsys.capella.test.libraries.ju.testsuites.partial diff --git a/tests/plugins/org.polarsys.capella.test.library.ju/src/org/polarsys/capella/test/libraries/ju/TestLibrariesPlugin.java b/tests/plugins/org.polarsys.capella.test.library.ju/src/org/polarsys/capella/test/libraries/ju/TestLibrariesPlugin.java deleted file mode 100644 index cf4b1bd813..0000000000 --- a/tests/plugins/org.polarsys.capella.test.library.ju/src/org/polarsys/capella/test/libraries/ju/TestLibrariesPlugin.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.libraries.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestLibrariesPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.library.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestLibrariesPlugin plugin; - - /** - * The constructor - */ - public TestLibrariesPlugin() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 TestLibrariesPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.massactions.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.massactions.ju/META-INF/MANIFEST.MF index fd3fa29fcf..aabe46d5dc 100644 --- a/tests/plugins/org.polarsys.capella.test.massactions.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.massactions.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.massactions.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.massactions.ju.activator.TestActivator Require-Bundle: org.polarsys.capella.test.framework, org.polarsys.capella.common.ui.massactions.core, org.polarsys.capella.common.ui.massactions diff --git a/tests/plugins/org.polarsys.capella.test.massactions.ju/src/org/polarsys/capella/test/massactions/ju/activator/TestActivator.java b/tests/plugins/org.polarsys.capella.test.massactions.ju/src/org/polarsys/capella/test/massactions/ju/activator/TestActivator.java deleted file mode 100644 index 3ec0308f19..0000000000 --- a/tests/plugins/org.polarsys.capella.test.massactions.ju/src/org/polarsys/capella/test/massactions/ju/activator/TestActivator.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.massactions.ju.activator; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * - * @author Sandu Postaru - * - */ -public class TestActivator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - TestActivator.context = bundleContext; - } - - /* - * (non-Javadoc) - * - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - TestActivator.context = null; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.migration.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.migration.ju/META-INF/MANIFEST.MF index 1c1ae7b012..1da75daa30 100644 --- a/tests/plugins/org.polarsys.capella.test.migration.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.migration.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.migration.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.migration.ju.TestMigrationPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, @@ -17,8 +16,7 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName Bundle-Localization: plugin -Export-Package: org.polarsys.capella.test.migration.ju, - org.polarsys.capella.test.migration.ju.fwk, +Export-Package: org.polarsys.capella.test.migration.ju.fwk, org.polarsys.capella.test.migration.ju.helpers, org.polarsys.capella.test.migration.ju.model, org.polarsys.capella.test.migration.ju.testcases.basic, diff --git a/tests/plugins/org.polarsys.capella.test.migration.ju/src/org/polarsys/capella/test/migration/ju/TestMigrationPlugin.java b/tests/plugins/org.polarsys.capella.test.migration.ju/src/org/polarsys/capella/test/migration/ju/TestMigrationPlugin.java deleted file mode 100644 index f34931d5d6..0000000000 --- a/tests/plugins/org.polarsys.capella.test.migration.ju/src/org/polarsys/capella/test/migration/ju/TestMigrationPlugin.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.migration.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestMigrationPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.migration.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestMigrationPlugin plugin; - - /** - * The constructor - */ - public TestMigrationPlugin() { - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 TestMigrationPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.model.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.model.ju/META-INF/MANIFEST.MF index 327fdbb44c..3e38cd8362 100644 --- a/tests/plugins/org.polarsys.capella.test.model.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.model.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.model.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.model.ju.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.model.ju/src/org/polarsys/capella/test/model/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.model.ju/src/org/polarsys/capella/test/model/ju/Activator.java deleted file mode 100644 index bdb2c7cd0a..0000000000 --- a/tests/plugins/org.polarsys.capella.test.model.ju/src/org/polarsys/capella/test/model/ju/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.model.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.model.ju"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.navigator.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.navigator.ju/META-INF/MANIFEST.MF index d02b45ae90..ada7f21bbd 100644 --- a/tests/plugins/org.polarsys.capella.test.navigator.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.navigator.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.navigator.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.navigator.ju.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.navigator.ju/src/org/polarsys/capella/test/navigator/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.navigator.ju/src/org/polarsys/capella/test/navigator/ju/Activator.java deleted file mode 100644 index 57da23de16..0000000000 --- a/tests/plugins/org.polarsys.capella.test.navigator.ju/src/org/polarsys/capella/test/navigator/ju/Activator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.navigator.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.navigator.ju"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.odesign/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.odesign/META-INF/MANIFEST.MF index bd8833007b..10807d1ec4 100644 --- a/tests/plugins/org.polarsys.capella.test.odesign/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.odesign/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.odesign Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.odesign.Activator Bundle-Vendor: %providerName Require-Bundle: org.polarsys.capella.test.framework, org.polarsys.capella.core.platform.sirius.ui.services, diff --git a/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.afm.old b/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.afm.old new file mode 100644 index 0000000000..91c47d52eb --- /dev/null +++ b/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.afm.old @@ -0,0 +1,8 @@ + + + + + + diff --git a/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.capella.old b/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.capella.old new file mode 100644 index 0000000000..88eb8d919a --- /dev/null +++ b/tests/plugins/org.polarsys.capella.test.odesign/model/EmptyProject/EmptyProject-20211209_1713.capella.old @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/plugins/org.polarsys.capella.test.odesign/src/org/polarsys/capella/test/odesign/Activator.java b/tests/plugins/org.polarsys.capella.test.odesign/src/org/polarsys/capella/test/odesign/Activator.java deleted file mode 100644 index 5d7b2a0c2c..0000000000 --- a/tests/plugins/org.polarsys.capella.test.odesign/src/org/polarsys/capella/test/odesign/Activator.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.odesign; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.platform.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.platform.ju/META-INF/MANIFEST.MF index 19b31d40c1..ac5ada0f68 100644 --- a/tests/plugins/org.polarsys.capella.test.platform.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.platform.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.platform.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.platform.ju.Activator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework;bundle-version="0.8.0", @@ -20,8 +19,7 @@ Require-Bundle: org.eclipse.ui, org.polarsys.capella.core.compare Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Export-Package: org.polarsys.capella.test.platform.ju, - org.polarsys.capella.test.platform.ju.testcases, +Export-Package: org.polarsys.capella.test.platform.ju.testcases, org.polarsys.capella.test.platform.ju.testsuites Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/Activator.java deleted file mode 100644 index a0f9095b24..0000000000 --- a/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/Activator.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.platform.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.platform.ju"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/testcases/JobLogTest.java b/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/testcases/JobLogTest.java index b874412322..ab77452aa7 100644 --- a/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/testcases/JobLogTest.java +++ b/tests/plugins/org.polarsys.capella.test.platform.ju/src/org/polarsys/capella/test/platform/ju/testcases/JobLogTest.java @@ -21,12 +21,12 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.tools.report.appenders.reportlogview.LightMarkerRegistry; import org.polarsys.capella.common.tools.report.util.IJobConstants; import org.polarsys.capella.test.framework.api.BasicTestCase; import org.polarsys.capella.test.framework.helpers.GuiActions; import org.polarsys.capella.test.framework.helpers.log.StatusValidator; -import org.polarsys.capella.test.platform.ju.Activator; /** * This test ensures that jobs are properly logged into both Error Log and Information views @@ -38,7 +38,7 @@ private class MyJob extends Job { MyJob(int severity, boolean log) { super(MyJob.class.getSimpleName()); - this.status = new Status(severity, Activator.getDefault().getBundle().getSymbolicName(), "severity:" + severity); + this.status = new Status(severity, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "severity:" + severity); if (log) { setProperty(IJobConstants.ALWAYS_LOG_STATUS, true); } diff --git a/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/META-INF/MANIFEST.MF index 31672de039..1869e031ea 100644 --- a/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.progressmonitoring.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.progressmonitoring.ju.internal.Activator Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.test.framework, org.polarsys.capella.core.ui.metric, @@ -12,7 +11,6 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName Bundle-Localization: plugin -Export-Package: org.polarsys.capella.test.progressmonitoring.ju.internal, - org.polarsys.capella.test.progressmonitoring.ju.testcases, +Export-Package: org.polarsys.capella.test.progressmonitoring.ju.testcases, org.polarsys.capella.test.progressmonitoring.ju.testsuites, org.polarsys.capella.test.progressmonitoring.ju.util diff --git a/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/src/org/polarsys/capella/test/progressmonitoring/ju/internal/Activator.java b/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/src/org/polarsys/capella/test/progressmonitoring/ju/internal/Activator.java deleted file mode 100644 index 6f1cdf329c..0000000000 --- a/tests/plugins/org.polarsys.capella.test.progressmonitoring.ju/src/org/polarsys/capella/test/progressmonitoring/ju/internal/Activator.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.progressmonitoring.ju.internal; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends Plugin implements BundleActivator { - - // The shared instance - public static Activator plugin; - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - plugin = null; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.projection.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.projection.ju/META-INF/MANIFEST.MF index ac37ed8203..0b9bda73de 100644 --- a/tests/plugins/org.polarsys.capella.test.projection.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.projection.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.projection.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.projection.ju.ProjectionTestActivator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.projection.ju/src/org/polarsys/capella/test/projection/ju/ProjectionTestActivator.java b/tests/plugins/org.polarsys.capella.test.projection.ju/src/org/polarsys/capella/test/projection/ju/ProjectionTestActivator.java deleted file mode 100644 index 0d55b4000b..0000000000 --- a/tests/plugins/org.polarsys.capella.test.projection.ju/src/org/polarsys/capella/test/projection/ju/ProjectionTestActivator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.projection.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class ProjectionTestActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.projection.ju"; //$NON-NLS-1$ - - // The shared instance - private static ProjectionTestActivator plugin; - - /** - * The constructor - */ - public ProjectionTestActivator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 ProjectionTestActivator getDefault() { - return plugin; - } - -} diff --git a/doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/src/.gitkeep b/tests/plugins/org.polarsys.capella.test.rcptt/workspace/MDEReport.html similarity index 100% rename from doc/plugins/org.polarsys.capella.core.re.updateconnections.doc/src/.gitkeep rename to tests/plugins/org.polarsys.capella.test.rcptt/workspace/MDEReport.html diff --git a/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/META-INF/MANIFEST.MF index 4ba9350732..8d3449fe88 100644 --- a/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.re.updateconnections.ju Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.re.updateconnections.ju.UpdateConnectionsTestsActivator Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/src/org/polarsys/capella/test/re/updateconnections/ju/UpdateConnectionsTestsActivator.java b/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/src/org/polarsys/capella/test/re/updateconnections/ju/UpdateConnectionsTestsActivator.java deleted file mode 100644 index 52a8a03410..0000000000 --- a/tests/plugins/org.polarsys.capella.test.re.updateconnections.ju/src/org/polarsys/capella/test/re/updateconnections/ju/UpdateConnectionsTestsActivator.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.re.updateconnections.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class UpdateConnectionsTestsActivator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsysc.apella.re.updatelinks.tests"; //$NON-NLS-1$ - - // The shared instance - private static UpdateConnectionsTestsActivator plugin; - - /** - * The constructor - */ - public UpdateConnectionsTestsActivator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#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 UpdateConnectionsTestsActivator getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.recrpl.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.recrpl.ju/META-INF/MANIFEST.MF index 0138a36328..a497e71aff 100644 --- a/tests/plugins/org.polarsys.capella.test.recrpl.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.recrpl.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.recrpl.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.recrpl.ju.RecRplTestPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/RecRplTestPlugin.java b/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/RecRplTestPlugin.java deleted file mode 100644 index 78db269275..0000000000 --- a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/RecRplTestPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.recrpl.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class RecRplTestPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.recrpl.ju"; //$NON-NLS-1$ - - // The shared instance - private static RecRplTestPlugin plugin; - - /** - * The constructor - */ - public RecRplTestPlugin() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static RecRplTestPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/handlers/scope/ExternalInclusion.java b/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/handlers/scope/ExternalInclusion.java index d8b1885b22..185359e12e 100644 --- a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/handlers/scope/ExternalInclusion.java +++ b/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/handlers/scope/ExternalInclusion.java @@ -17,10 +17,10 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.transaction.util.TransactionUtil; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.ctx.CtxFactory; import org.polarsys.capella.core.data.ctx.SystemComponent; import org.polarsys.capella.test.framework.helpers.ExternalResourceHelper; -import org.polarsys.capella.test.recrpl.ju.RecRplTestPlugin; public class ExternalInclusion { @@ -42,7 +42,7 @@ public static void setEnabled(boolean enabled) { public static Resource getExternalResource(EObject element) { Resource resource = ExternalResourceHelper.getExternalResource(TransactionUtil.getEditingDomain(element), - RecRplTestPlugin.PLUGIN_ID); + FrameworkUtil.getBundle(ExternalInclusion.class).getSymbolicName()); getOrCreateActor(ExternalInclusion.ACTOR_1, resource); getOrCreateActor(ExternalInclusion.ACTOR_2, resource); diff --git a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/testcases/CreateRPL_SpecificPackages.java b/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/testcases/CreateRPL_SpecificPackages.java index cb8dc6c8a7..636ad9bc5f 100644 --- a/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/testcases/CreateRPL_SpecificPackages.java +++ b/tests/plugins/org.polarsys.capella.test.recrpl.ju/src/org/polarsys/capella/test/recrpl/ju/testcases/CreateRPL_SpecificPackages.java @@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; import org.polarsys.capella.common.helpers.EObjectExt; @@ -115,8 +116,8 @@ public abstract class CreateRPL_SpecificPackages extends RecRplTestCase { public void setUp() throws Exception { super.setUp(); - - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).put(IReConstants.PROPERTY__PARENT_LOCATOR, IReConstants.LOCATOR_OPTION_SPECIFIC_PACKAGES); + + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(Activator.class).getSymbolicName()).put(IReConstants.PROPERTY__PARENT_LOCATOR, IReConstants.LOCATOR_OPTION_SPECIFIC_PACKAGES); manager = ExecutionManagerRegistry.getInstance().addNewManager(); project = new CapellaModelSkeleton.Builder(manager).build(); @@ -134,7 +135,7 @@ protected Resource getModelResource() { public void tearDown() throws Exception { ExecutionManagerRegistry.getInstance().removeManager(manager); - InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID).put(IReConstants.PROPERTY__PARENT_LOCATOR, IReConstants.LOCATOR_OPTION_DEFAULT); + InstanceScope.INSTANCE.getNode(FrameworkUtil.getBundle(Activator.class).getSymbolicName()).put(IReConstants.PROPERTY__PARENT_LOCATOR, IReConstants.LOCATOR_OPTION_DEFAULT); super.tearDown(); } diff --git a/tests/plugins/org.polarsys.capella.test.richtext.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.richtext.ju/META-INF/MANIFEST.MF index 43f26347dd..087f8224f3 100644 --- a/tests/plugins/org.polarsys.capella.test.richtext.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.richtext.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.richtext.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.richtext.ju.RichtextTestPlugin Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.test.framework, org.eclipse.sirius.diagram.ui, @@ -18,8 +17,7 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: %providerName Bundle-Localization: plugin -Export-Package: org.polarsys.capella.test.richtext.ju, - org.polarsys.capella.test.richtext.ju.mocks, +Export-Package: org.polarsys.capella.test.richtext.ju.mocks, org.polarsys.capella.test.richtext.ju.testcases, org.polarsys.capella.test.richtext.ju.testsuites Automatic-Module-Name: org.polarsys.capella.test.richtext.ju diff --git a/tests/plugins/org.polarsys.capella.test.richtext.ju/src/org/polarsys/capella/test/richtext/ju/RichtextTestPlugin.java b/tests/plugins/org.polarsys.capella.test.richtext.ju/src/org/polarsys/capella/test/richtext/ju/RichtextTestPlugin.java deleted file mode 100644 index 79f23aa1ba..0000000000 --- a/tests/plugins/org.polarsys.capella.test.richtext.ju/src/org/polarsys/capella/test/richtext/ju/RichtextTestPlugin.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.richtext.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -public class RichtextTestPlugin extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.richtext.ju"; //$NON-NLS-1$ - - // The shared instance - private static RichtextTestPlugin plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static RichtextTestPlugin getDefault() { - return plugin; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/META-INF/MANIFEST.MF index 3987e5772e..204f9fe280 100644 --- a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.semantic.queries.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.semantic.queries.ju.TestSemanticQueriesPlugin Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.test.framework, org.polarsys.capella.core.semantic.queries, diff --git a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/TestSemanticQueriesPlugin.java b/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/TestSemanticQueriesPlugin.java deleted file mode 100644 index fc5606b072..0000000000 --- a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/TestSemanticQueriesPlugin.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales Global Services - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.semantic.queries.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * - * Activator - * - */ -public class TestSemanticQueriesPlugin extends Plugin { - /** - * The plug-in ID - */ - public static final String PLUGIN_ID = "org.polarsys.capella.test.semantic.queries.ju"; //$NON-NLS-1$ - /** - * The shared instance - */ - private static TestSemanticQueriesPlugin plugin; - - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static TestSemanticQueriesPlugin getDefault() { - return plugin; - } -} diff --git a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/UniqueIDInPluginsTest.java b/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/UniqueIDInPluginsTest.java index 56228c8c31..877622da8e 100644 --- a/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/UniqueIDInPluginsTest.java +++ b/tests/plugins/org.polarsys.capella.test.semantic.queries.ju/src/org/polarsys/capella/test/semantic/queries/ju/UniqueIDInPluginsTest.java @@ -19,8 +19,8 @@ import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.mdsofa.common.helper.ExtensionPointHelper; -import org.polarsys.capella.common.ui.toolkit.browser.BrowserActivator; import org.polarsys.capella.common.ui.toolkit.browser.category.Messages; import org.polarsys.capella.test.framework.api.BasicTestCase; @@ -37,8 +37,8 @@ public void test() throws Exception { List listofCategoryId = new ArrayList(); List listofSubCategoryId = new ArrayList(); - IConfigurationElement[] categories = ExtensionPointHelper.getConfigurationElements(BrowserActivator.PLUGIN_ID, - CONTENT_PROVIDER_CATEGORY); + IConfigurationElement[] categories = ExtensionPointHelper + .getConfigurationElements(FrameworkUtil.getBundle(org.polarsys.capella.common.ui.toolkit.browser.category.Messages.class).getSymbolicName(), CONTENT_PROVIDER_CATEGORY); for (IConfigurationElement categoryConfigurationElement : categories) { diff --git a/tests/plugins/org.polarsys.capella.test.table/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.table/META-INF/MANIFEST.MF index e475778c41..e15e4a799e 100644 --- a/tests/plugins/org.polarsys.capella.test.table/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.table/META-INF/MANIFEST.MF @@ -7,7 +7,6 @@ Automatic-Module-Name: org.polarsys.capella.test.table Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.eclipse.ui.plugin, org.osgi.framework;version="1.9.0" -Bundle-Activator: org.polarsys.capella.test.table.ju.Activator Require-Bundle: org.polarsys.capella.test.framework, org.eclipse.sirius, org.polarsys.capella.test.diagram.common.ju, diff --git a/tests/plugins/org.polarsys.capella.test.table/src/org/polarsys/capella/test/table/ju/Activator.java b/tests/plugins/org.polarsys.capella.test.table/src/org/polarsys/capella/test/table/ju/Activator.java deleted file mode 100644 index c204eb33aa..0000000000 --- a/tests/plugins/org.polarsys.capella.test.table/src/org/polarsys/capella/test/table/ju/Activator.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.table.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.table"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - 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; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.transition.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.transition.ju/META-INF/MANIFEST.MF index ee37dd9f22..c240dc442c 100644 --- a/tests/plugins/org.polarsys.capella.test.transition.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.transition.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.transition.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.transition.ju.TransitionTestPlugin Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.polarsys.capella.test.framework, diff --git a/tests/plugins/org.polarsys.capella.test.transition.ju/src/org/polarsys/capella/test/transition/ju/TransitionTestPlugin.java b/tests/plugins/org.polarsys.capella.test.transition.ju/src/org/polarsys/capella/test/transition/ju/TransitionTestPlugin.java deleted file mode 100644 index b0f91d3983..0000000000 --- a/tests/plugins/org.polarsys.capella.test.transition.ju/src/org/polarsys/capella/test/transition/ju/TransitionTestPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.transition.ju; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TransitionTestPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.transition.ju"; //$NON-NLS-1$ - - // The shared instance - private static TransitionTestPlugin plugin; - - /** - * The constructor - */ - public TransitionTestPlugin() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * @return the shared instance - */ - public static TransitionTestPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/META-INF/MANIFEST.MF b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/META-INF/MANIFEST.MF index 7fac453584..64f195d416 100644 --- a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/META-INF/MANIFEST.MF +++ b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/META-INF/MANIFEST.MF @@ -3,7 +3,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.polarsys.capella.test.validation.rules.ju;singleton:=true Bundle-Version: 6.0.0.qualifier -Bundle-Activator: org.polarsys.capella.test.validation.rules.ju.TestValidationRulesPlugin Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.common.re.gen, @@ -19,8 +18,7 @@ Require-Bundle: org.eclipse.core.runtime, org.polarsys.capella.core.transition.system.topdown Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy -Export-Package: org.polarsys.capella.test.validation.rules.ju, - org.polarsys.capella.test.validation.rules.ju.testcases, +Export-Package: org.polarsys.capella.test.validation.rules.ju.testcases, org.polarsys.capella.test.validation.rules.ju.testcases.dc_cl, org.polarsys.capella.test.validation.rules.ju.testcases.dcom, org.polarsys.capella.test.validation.rules.ju.testcases.dcon, diff --git a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/TestValidationRulesPlugin.java b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/TestValidationRulesPlugin.java deleted file mode 100644 index ebfeaed286..0000000000 --- a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/TestValidationRulesPlugin.java +++ /dev/null @@ -1,63 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2020 THALES GLOBAL SERVICES. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Thales - initial API and implementation - *******************************************************************************/ -package org.polarsys.capella.test.validation.rules.ju; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class TestValidationRulesPlugin extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.polarsys.capella.test.validation.rules.ju"; //$NON-NLS-1$ - - // The shared instance - private static TestValidationRulesPlugin plugin; - - /** - * The constructor - */ - public TestValidationRulesPlugin() { - // Do Nothing - } - - /** - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /** - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TestValidationRulesPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/dwf_ds/Rule_DWF_DS_18.java b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/dwf_ds/Rule_DWF_DS_18.java index 1016ce6407..de5aac2647 100644 --- a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/dwf_ds/Rule_DWF_DS_18.java +++ b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/dwf_ds/Rule_DWF_DS_18.java @@ -29,6 +29,7 @@ import org.eclipse.ui.IViewPart; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.navigator.CommonViewer; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.core.data.capellamodeller.Project; import org.polarsys.capella.core.data.interaction.InteractionPackage; import org.polarsys.capella.core.data.interaction.ui.quickfix.generator.DWF_DS_18_Resolutions; @@ -38,7 +39,6 @@ import org.polarsys.capella.test.framework.api.OracleDefinition; import org.polarsys.capella.test.framework.helpers.log.FormatedLogger; import org.polarsys.capella.test.framework.helpers.log.FormatedSysoutLogger; -import org.polarsys.capella.test.validation.rules.ju.TestValidationRulesPlugin; import org.polarsys.capella.test.validation.rules.ju.testcases.AbstractRulesOnDesignTest; /** @@ -141,7 +141,7 @@ protected IStatus testCheckQuickFix(List markers) { status = Status.OK_STATUS; } else { String message = "Quick fix to navigate to elements for validation rule DWF_DS_18 does not work"; - status = new Status(IStatus.ERROR, TestValidationRulesPlugin.PLUGIN_ID, message); + status = new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), message); } return status; } diff --git a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/i/Rule_I37_38.java b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/i/Rule_I37_38.java index 82ec5cbab4..ed1fd1c4db 100644 --- a/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/i/Rule_I37_38.java +++ b/tests/plugins/org.polarsys.capella.test.validation.rules.ju/src/org/polarsys/capella/test/validation/rules/ju/testcases/i/Rule_I37_38.java @@ -27,6 +27,7 @@ import org.eclipse.emf.transaction.TransactionalCommandStack; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.ui.IViewPart; +import org.osgi.framework.FrameworkUtil; import org.polarsys.capella.common.ef.ExecutionManager; import org.polarsys.capella.common.ef.ExecutionManagerRegistry; import org.polarsys.capella.common.ef.command.AbstractReadWriteCommand; @@ -40,7 +41,6 @@ import org.polarsys.capella.core.model.handler.command.CapellaResourceHelper; import org.polarsys.capella.core.model.skeleton.CapellaModelSkeleton; import org.polarsys.capella.test.framework.api.BasicTestCase; -import org.polarsys.capella.test.validation.rules.ju.TestValidationRulesPlugin; /** * Tests ability to move elements. @@ -156,7 +156,7 @@ public void handleDiagnostic(Diagnostic ms) throws RollbackException { it.remove(); } } - throw new RollbackException(new Status(IStatus.ERROR, TestValidationRulesPlugin.PLUGIN_ID, "rolling back")); //$NON-NLS-1$ + throw new RollbackException(new Status(IStatus.ERROR, FrameworkUtil.getBundle(this.getClass()).getSymbolicName(), "rolling back")); //$NON-NLS-1$ } private Diagnostic findDiagnostic(String message, Collection diagnostics) {