diff options
author | Remi Schnekenburger | 2014-11-05 09:30:18 +0000 |
---|---|---|
committer | Remi Schnekenburger | 2014-11-05 09:58:29 +0000 |
commit | 3d72202ee0195ff2c5d21efa374c48fc6d2a44ea (patch) | |
tree | 534587c946d7b0398fb11395e8f58f39e533b737 /extraplugins/adl4eclipse | |
parent | b00de2ee0233b18298b0e848e7977d134fc2c417 (diff) | |
download | org.eclipse.papyrus-3d72202ee0195ff2c5d21efa374c48fc6d2a44ea.tar.gz org.eclipse.papyrus-3d72202ee0195ff2c5d21efa374c48fc6d2a44ea.tar.xz org.eclipse.papyrus-3d72202ee0195ff2c5d21efa374c48fc6d2a44ea.zip |
450059: [ADL4Eclipse] ADL4Eclipse shall provide a table to display the
list of plugins in an eclipse application
https://bugs.eclipse.org/bugs/show_bug.cgi?id=450059
Change-Id: Iadbb732fd273e0bfd81fe3587ce14d3ad707cf55
Signed-off-by: Remi Schnekenburger <remi.schnekenburger@cea.fr>
Diffstat (limited to 'extraplugins/adl4eclipse')
16 files changed, 327 insertions, 0 deletions
diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.classpath b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.classpath new file mode 100644 index 00000000000..ad32c83a788 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.project b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.project new file mode 100644 index 00000000000..ac04af86b8a --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.adl4eclipsetool.table</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.settings/org.eclipse.jdt.core.prefs b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..c537b63063c --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/META-INF/MANIFEST.MF b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..336ace93847 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.papyrus.adl4eclipsetool.table;singleton:=true +Bundle-Version: 1.0.1.qualifier +Bundle-Activator: org.eclipse.papyrus.adl4eclipsetool.table.Activator +Bundle-Vendor: %Bundle-Vendor +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.papyrus.infra.nattable;bundle-version="1.0.1", + org.eclipse.papyrus.osgi.profile;bundle-version="1.0.1", + org.eclipse.papyrus.adl4eclipse.profile;bundle-version="1.0.1", + org.eclipse.uml2.uml;bundle-version="5.0.1", + org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.7.0", + org.eclipse.papyrus.uml.nattable;bundle-version="1.0.1", + org.eclipse.papyrus.infra.emf.nattable;bundle-version="1.0.1", + org.eclipse.papyrus.infra.nattable.model;bundle-version="1.0.1", + org.eclipse.papyrus.infra.widgets;bundle-version="1.0.1", + org.eclipse.nebula.widgets.nattable.core;bundle-version="1.1.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Bundle-ActivationPolicy: lazy +Bundle-Description: This bundle provides a table for the ADL4Eclipse tool. This synchronized table should be created on a package, and displays all the bundles contained in this package +Export-Package: org.eclipse.papyrus.adl4eclipsetool.table, + org.eclipse.papyrus.adl4eclipsetool.table.manager, + org.eclipse.papyrus.adl4eclipsetool.table.tester diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/OSGI-INF/l10n/bundle.properties b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..e5614dfb166 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,3 @@ +#Properties file for org.eclipse.papyrus.adl4eclipsetool.table +Bundle-Vendor = Eclipse Modeling Project +Bundle-Name = ADL4Eclipse tool table
\ No newline at end of file diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/about.html b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/about.html new file mode 100644 index 00000000000..598b3684879 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>May 12, 2008</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/build.properties b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/build.properties new file mode 100644 index 00000000000..48bb1c930be --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/build.properties @@ -0,0 +1,9 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + about.html,\ + icons/,\ + resource/,\ + plugin.xml diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture.png b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture.png Binary files differnew file mode 100644 index 00000000000..872aa57d7a2 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture.png diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture_new.png b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture_new.png Binary files differnew file mode 100644 index 00000000000..5f371a9c043 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture_new.png diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/plugin.xml b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/plugin.xml new file mode 100644 index 00000000000..d01c48d5c8b --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/plugin.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.papyrus.infra.nattable.tester"> + <tester + class="org.eclipse.papyrus.adl4eclipsetool.table.tester.TableArchitectureCreationTester" + id="org.eclipse.papyrus.adl4eclipsetool.table.tester.TableArchitectureCreationTester"> + </tester> + </extension> + <extension + point="org.eclipse.papyrus.infra.nattable.configuration"> + <configuration + file="resource/architecture.nattableconfiguration" + type="PapyrusArchitectureTable"> + </configuration> + </extension> + <extension + point="org.eclipse.papyrus.infra.nattable.axismanager"> + <axisManager + id="org.eclipse.papyrus.adl4eclipsetool.table.manager.PluginAxisManager" + manager="org.eclipse.papyrus.adl4eclipsetool.table.manager.PluginAxisManager"> + </axisManager> + </extension> + +</plugin> diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/resource/architecture.nattableconfiguration b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/resource/architecture.nattableconfiguration new file mode 100644 index 00000000000..c953444feb4 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/resource/architecture.nattableconfiguration @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<nattableconfiguration:TableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider" xmlns:nattabletester="http://www.eclipse.org/papyrus/nattable/model/table/nattabletester" description="This table is used to display Plugins and Features described as classes" name="ArchitectureTable" type="PapyrusArchitectureTable" iconPath="platform:/plugin/org.eclipse.papyrus.adl4eclipsetool.table/icons/table_Architecture.png" defaultRowAxisProvider="//@rowAxisProviders.0" defaultColumnAxisProvider="//@columnAxisProviders.0"> + <creationTester xsi:type="nattabletester:JavaTableTester" tester="org.eclipse.papyrus.adl4eclipsetool.table.tester.TableArchitectureCreationTester"/> + <rowHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration" indexStyle="NUMERIC" displayLabel="false"> + <ownedLabelConfigurations xsi:type="nattablelabelprovider:ObjectLabelProviderConfiguration"/> + <ownedAxisConfigurations xsi:type="nattableaxisconfiguration:EStructuralFeatureValueFillingConfiguration"> + <listenFeature xsi:type="ecore:EReference" href="http://www.eclipse.org/uml2/5.0.0/UML#//Package/packagedElement"/> + </ownedAxisConfigurations> + <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.adl4eclipsetool.table.manager.PluginAxisManager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.labelprovider" headerLabelConfiguration="//@rowHeaderAxisConfiguration/@ownedLabelConfigurations.0" specificAxisConfigurations="//@rowHeaderAxisConfiguration/@ownedAxisConfigurations.0"/> + </rowHeaderAxisConfiguration> + <columnHeaderAxisConfiguration xsi:type="nattableaxisconfiguration:TableHeaderAxisConfiguration" displayIndex="false"> + <ownedLabelConfigurations xsi:type="nattablelabelprovider:FeatureLabelProviderConfiguration" displayIcon="false" displayIsDerived="false" displayType="false" displayMultiplicity="false"/> + <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.uml.nattable.feature.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="//@columnHeaderAxisConfiguration/@ownedLabelConfigurations.0"/> + <axisManagers xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" axisManagerId="org.eclipse.papyrus.uml.nattable.stereotype.property.axis.manager" labelProviderContext="org.eclipse.papyrus.infra.nattable.header.feature.labelprovider" headerLabelConfiguration="//@columnHeaderAxisConfiguration/@ownedLabelConfigurations.0"/> + </columnHeaderAxisConfiguration> + <columnAxisProviders xsi:type="nattableaxisprovider:SlaveObjectAxisProvider" description="This provider provides the default columns for the Architecture Table" name="ArchitectureFeatureProvider"> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-zF6IEeShzc-cy4seTg" element="property_of_stereotype:/OSGI::ModuleLayer::Bundle::symbolicName"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-xV6IEeShzc-cy4seTg" element="property_of_stereotype:/OSGI::ModuleLayer::Bundle::name"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-016IEeShzc-cy4seTg" element="property_of_stereotype:/OSGI::ModuleLayer::Bundle::activator"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-116IEeShzc-cy4seTg" element="property_of_stereotype:/OSGI::ModuleLayer::Bundle::isSingleton"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-1F6IEeShzc-cy4seTg" element="property_of_stereotype:/ADL4Eclipse::Plugin::isIncubation"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + <axis xsi:type="nattableaxis:FeatureIdAxis" xmi:id="_aAC-wl6IEeShzc-cy4seTg" element="property_of_stereotype:/OSGI::ModuleLayer::Bundle::description"> + <manager xsi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="../../../plugin/org.eclipse.papyrus.uml.nattable.generic.config/configs/generic.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.1"/> + </axis> + </columnAxisProviders> + <rowAxisProviders xsi:type="nattableaxisprovider:MasterObjectAxisProvider" description="This row providers allows to display all plugins in a Table" name="ArchitectureProvider" disconnectSlave="true"/> +</nattableconfiguration:TableConfiguration> diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Activator.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Activator.java new file mode 100644 index 00000000000..30fe7411e89 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Activator.java @@ -0,0 +1,50 @@ +package org.eclipse.papyrus.adl4eclipsetool.table; + +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.eclipse.papyrus.adl4eclipsetool.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) + */ + 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/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Messages.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Messages.java new file mode 100644 index 00000000000..7d463447908 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/Messages.java @@ -0,0 +1,21 @@ +package org.eclipse.papyrus.adl4eclipsetool.table; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.adl4eclipsetool.table.messages"; //$NON-NLS-1$ + + public static String TableArchitectureCreationTester_MissingNamedProfile; + + public static String TableArchitectureCreationTester_MissingRequiredProfiles; + + public static String TableArchitectureCreationTester_NotAPackage; + + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/manager/PluginAxisManager.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/manager/PluginAxisManager.java new file mode 100644 index 00000000000..c07a8e83bc3 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/manager/PluginAxisManager.java @@ -0,0 +1,25 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.adl4eclipsetool.table.manager; + +import org.eclipse.papyrus.infra.emf.nattable.manager.axis.AbstractSynchronizedOnEStructuralFeatureAxisManager; + +/** + * Axis Manager for plugins (represented as Component stereotyped Plugin) + */ +public class PluginAxisManager extends AbstractSynchronizedOnEStructuralFeatureAxisManager { + + + +} diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/messages.properties b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/messages.properties new file mode 100644 index 00000000000..449a206d930 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/messages.properties @@ -0,0 +1,3 @@ +TableArchitectureCreationTester_MissingNamedProfile=Impossible to find profile {0} applied on the package +TableArchitectureCreationTester_MissingRequiredProfiles=Impossible to find required profiles applied on the package +TableArchitectureCreationTester_NotAPackage=The context is not a Package diff --git a/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/tester/TableArchitectureCreationTester.java b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/tester/TableArchitectureCreationTester.java new file mode 100644 index 00000000000..7f37f8d1665 --- /dev/null +++ b/extraplugins/adl4eclipse/org.eclipse.papyrus.adl4eclipsetool.table/src/org/eclipse/papyrus/adl4eclipsetool/table/tester/TableArchitectureCreationTester.java @@ -0,0 +1,58 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.adl4eclipsetool.table.tester; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.util.NLS; +import org.eclipse.papyrus.adl4eclipse.org.IADL4ECLIPSE_Stereotype; +import org.eclipse.papyrus.adl4eclipsetool.table.Activator; +import org.eclipse.papyrus.adl4eclipsetool.table.Messages; +import org.eclipse.papyrus.infra.nattable.tester.ITableTester; +import org.eclipse.papyrus.osgi.profile.IOSGIStereotype; +import org.eclipse.uml2.uml.Package; +import org.eclipse.uml2.uml.Profile; + +public class TableArchitectureCreationTester implements ITableTester { + + /** + * {@inheritDoc} + */ + @Override + public IStatus isAllowed(Object context) { + if (context instanceof Package) { + Package package_= (Package)context; + // check OSGI and eclipse profile + IStatus ADL4EclipseStatus = checkProfileApplied(package_, IADL4ECLIPSE_Stereotype.ADL4ECLIPSE); + IStatus oSGIStatus = checkProfileApplied(package_, IOSGIStereotype.OSGI); + IStatus oSGIModuleLayerStatus = checkProfileApplied(package_, IOSGIStereotype.OSGI_MODULE_LAYER); + if(!ADL4EclipseStatus.isOK() || !oSGIStatus.isOK() || !oSGIModuleLayerStatus.isOK()) { + return new MultiStatus(Activator.PLUGIN_ID, IStatus.OK, new IStatus[] {ADL4EclipseStatus, oSGIStatus, oSGIModuleLayerStatus}, Messages.TableArchitectureCreationTester_MissingRequiredProfiles, null); + } + return Status.OK_STATUS; + + } + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.TableArchitectureCreationTester_NotAPackage); + } + + + protected IStatus checkProfileApplied(Package package_, String profileQualifiedName) { + Profile profile = package_.getAppliedProfile(profileQualifiedName, true); + if(profile==null) { + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind(Messages.TableArchitectureCreationTester_MissingNamedProfile, profileQualifiedName)); + } + return Status.OK_STATUS; + } +} |