Commit 4d755cc7 authored by Carmen Carlan's avatar Carmen Carlan

Merge branch 'master' of https://git.fortiss.org/af3/af3.git into 3979

parents d5df2d89 7d5b92e5
AbstractComponentToImage.java 2da368d234415e072899b1827c83fa78b5523ffc GREEN
ExportComponentToImage.java 9f2c80bdb1af3bf3a6e6e7f8576785bd651e2d58 GREEN
ExportModelToDocument.java 4e13fb5d6bb0d264852bc490b51c3dd11b01f587 YELLOW
ExportModelToDocument.java 8365d2e970db8a4badd3324d0f14ad7aa8d340ec GREEN
......@@ -17,12 +17,13 @@
package eu.fbk.af3.tools.diagram.ui.commands;
import static java.util.Collections.emptyList;
import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace;
import static org.eclipse.ui.PlatformUI.getWorkbench;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
......@@ -36,7 +37,6 @@ import org.eclipse.ui.PlatformUI;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.internal.views.NavigatorViewPart;
......@@ -81,7 +81,7 @@ public class ExportModelToDocument extends AbstractComponentToImage {
} else if(selection instanceof Component) {
selectedComponent = (Component)selection;
} else {
return Collections.emptyList();
return emptyList();
}
final List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
......@@ -90,7 +90,7 @@ public class ExportModelToDocument extends AbstractComponentToImage {
return contributionItems;
}
return Collections.emptyList();
return emptyList();
}
/** The action. */
......@@ -123,7 +123,8 @@ public class ExportModelToDocument extends AbstractComponentToImage {
return;
}
final FileProject fileProject = ProjectUtils.getFileProject(selectedComponent);
final FileProject fileProject =
getFirstParentWithType(selectedComponent, FileProject.class);
final DocumentGenerator documentGenerator = new DocumentGenerator();
documentGenerator.init(fileProject.getName(), parameterDialog.getDocumentFormat());
......
AllocationTableEditor.java f6f1c153cb555b7cf5b42fec63fce7ae217517f6 GREEN
ArchitectureParameterEditorBase.java c9e9a721f5b8aee62c39ae3307c9ad32a78bce4a GREEN
ArchitectureParameterTableEditorBase.java c5af213271a7a4e9d7d3bc18ab82879ef4030213 GREEN
ModelListenerEditorBase.java 0d0b5bc9c4385061cc69d30f7d9bcd19d5837324 GREEN
ArchitectureParameterTableEditorBase.java 1bf2f9273e4bbecc779cedcbce2d4742db0eb32c GREEN
ModelListenerEditorBase.java f8970c5917a9a4e71d86f739a60a21bcd10f2d93 GREEN
ParameterTableEditor.java 435231b3020dca1e20189a132439cc666cc72eb6 GREEN
......@@ -15,12 +15,13 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.allocation.ui.editor;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import java.util.Collection;
import org.fortiss.af3.allocation.model.ParameterEntry;
import org.fortiss.af3.allocation.model.ParameterTable;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
......@@ -62,7 +63,7 @@ public abstract class ArchitectureParameterTableEditorBase<A extends IProjectRoo
/** {@inheritDoc} */
@Override
protected FileProject getFileProject() {
return ProjectUtils.getFileProject(architecture);
return getFirstParentWithType(architecture, FileProject.class);
}
/** Performs a full update for the given {@link ParameterTable}. */
......
......@@ -23,6 +23,7 @@ import static org.fortiss.af3.allocation.model.AF3AllocationPackage.Literals.ALL
import static org.fortiss.af3.allocation.model.AF3AllocationPackage.Literals.ALLOCATION_TABLE__TARGET_VIEW;
import static org.fortiss.tooling.kernel.model.FortissToolingKernelPackage.Literals.INAMED_ELEMENT__NAME;
import static org.fortiss.tooling.kernel.ui.util.SelectionUtils.checkAndPickFirst;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.runAsCommand;
import java.util.Collection;
......@@ -49,7 +50,6 @@ import org.eclipse.swt.widgets.Display;
import org.fortiss.af3.allocation.model.AllocationEntry;
import org.fortiss.af3.allocation.model.AllocationTable;
import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.project.utils.ProjectUtils;
import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.ui.editor.GEFEditorBase;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
......@@ -346,7 +346,7 @@ public abstract class ModelListenerEditorBase<T extends EObject> extends GEFEdit
* registered.
*/
protected FileProject getFileProject() {
return ProjectUtils.getFileProject(getEditedObject());
return getFirstParentWithType(getEditedObject(), FileProject.class);
}
/** {@inheritDoc} */
......
AllocationModelElementFactory.java 9aba183708290c741ebbbe2897bbfcc51ea33fb6 GREEN
AllocationUtils.java ef4a95f7373ef8013952535b91ffe1d334bc380b GREEN
AllocationUtils.java ad2c5fd704b4b72c38e2c52c9c88f22a10d47eec GREEN
......@@ -20,13 +20,13 @@ import static org.conqat.lib.commons.reflect.ReflectionUtils.isInstanceOfAny;
import static org.eclipse.emf.ecore.util.EcoreUtil.create;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationEntry;
import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.createAllocationTableCollection;
import static org.fortiss.af3.project.utils.ProjectUtils.getFileProject;
import static org.fortiss.tooling.common.util.LambdaUtils.asStream;
import static org.fortiss.tooling.common.util.LambdaUtils.getFirst;
import static org.fortiss.tooling.common.util.LambdaUtils.isAssignableFromAny;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copyToRefMap;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getEClassForClass;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.computeFullyQualifiedName;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
......@@ -722,7 +722,7 @@ public class AllocationUtils {
at.setTargetView(targetView);
atc.getContainedElements().add(at);
FileProject fileProject = getFileProject(modelRef);
FileProject fileProject = getFirstParentWithType(modelRef, FileProject.class);
if(IPersistencyService.getInstance().getTopLevelElementFor(fileProject) != null) {
IElementCompositorService cs = IElementCompositorService.getInstance();
cs.compose(fileProject, atc, null);
......
......@@ -48,18 +48,6 @@
modelElementClass="org.fortiss.af3.component.model.behavior.code.CodeSpecification">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.component.ui.handler.LibraryComponentPackageHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.component.model.LibraryComponentPackage">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.component.ui.handler.LibraryComponentHandler">
<modelElementClass
modelElementClass="org.fortiss.af3.component.model.LibraryComponent">
</modelElementClass>
</modelElementHandler>
<modelElementHandler
handler="org.fortiss.af3.component.ui.handler.ComponentSpecificationsContainerHandler">
<modelElementClass
......@@ -222,18 +210,6 @@
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.generator.JavaCodeGeneratorEasyStartMenu">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.library.AddComponentToLibrary">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.library.AddTypeDefinitionToLibrary">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.library.AddFunctionDefinitionToLibrary">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.library.ConvertReferenceToComponent">
</contextMenuContribution>
<contextMenuContribution
contributor="org.fortiss.af3.component.ui.generator.FMUGeneratorEasyStartMenu">
</contextMenuContribution>
......
ComponentArchitectureTransformationMenuBase.java 368175b563d71779b3c3ba01f018f174f63fd8c9 GREEN
ComponentArchitectureTransformationMenuBase.java 22b6e8af5218780335c1ff938fc05140016cae21 GREEN
......@@ -18,10 +18,10 @@ package org.fortiss.af3.component.ui.commands;
import static java.util.Collections.emptyList;
import static org.eclipse.jface.dialogs.MessageDialog.openConfirm;
import static org.eclipse.swt.widgets.Display.getCurrent;
import static org.fortiss.af3.project.utils.ProjectUtils.getFileProject;
import static org.fortiss.tooling.kernel.service.IElementCompositorService.getInstance;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstParentWithType;
import java.util.ArrayList;
import java.util.List;
......@@ -99,7 +99,7 @@ public abstract class ComponentArchitectureTransformationMenuBase<A extends IPro
/** {@inheritDoc} */
@Override
public void run() {
FileProject fileProject = getFileProject(ca);
FileProject fileProject = getFirstParentWithType(ca, FileProject.class);
ITopLevelElement topLevelElement =
IPersistencyService.getInstance().getTopLevelElementFor(fileProject);
......
DataStateEditorBase.java 059a318a25d29dff87a79464b62a3bc18bbb4df1 GREEN
DataStateEditorBase.java 97ea60745d06d48d28ba0b0c389e2213c52d03e0 GREEN
DataStateTypeEditingSupport.java 03409cc03c82ccabff3f33e4244794acf40999e7 GREEN
DataStateValueEditingSupport.java 5c43c62a7d38f5a82a3d62a6e56ecb913961efdd GREEN
DataStateVariableNameEditingSupport.java f0160439e0ec89d90000c446e80143479216c3a8 GREEN
......@@ -368,10 +368,4 @@ public abstract class DataStateEditorBase<T extends IDataStateVariableProvider>
}
}
};
/** {@inheritDoc} */
@Override
public boolean enableLibraryView() {
return false;
}
}
ChannelEditPart.java 0800867ecc9ba4572cc92292eb7ff93b312165d8 GREEN
ComponentDiagramEditPart.java 34ac1aa7bfcdad122dfb0dcb8d978bbb454de674 GREEN
ComponentDiagramEditPart.java 8534b4ee95f6dadef390d88116fb3c072d0ee56a GREEN
ComponentEditPart.java b233eaaceed5febc9d3f116bce1eab48fc856e21 GREEN
EditPartFactory.java 3946e41148150781cf8e3b4265019d1bb435b71e GREEN
FreePortEditPart.java 38b56b3da20ff4f85e6dbde06e39a1f2d41d7440 GREEN
......
......@@ -19,7 +19,6 @@ import java.util.ArrayList;
import java.util.List;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentRef;
import org.fortiss.tooling.base.ui.editpart.DiagramEditPartBase;
import org.fortiss.tooling.base.ui.layout.RectangleGridLayoutDiagramConfiguration;
......@@ -42,13 +41,7 @@ public class ComponentDiagramEditPart extends DiagramEditPartBase<Component> {
List<Object> result = new ArrayList<Object>();
result.addAll(getModel().getSubComponents());
List<Object> connectorsList;
if(getModel() instanceof ComponentRef) {
connectorsList =
(List)((ComponentRef)getModel()).getLibraryComponentShadow().getConnectors();
} else {
connectorsList = (List)modelElementHandler.getConnectors(getModel());
}
List<Object> connectorsList = (List)modelElementHandler.getConnectors(getModel());
result.addAll(connectorsList);
return result;
......
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.handler;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.PLUGIN_ID;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.LibraryComponent;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
/**
* {@link IModelElementHandler} for {@link LibraryComponent}.
*
* @author ratiu
*/
public class LibraryComponentHandler
extends NamedCommentedModelElementHandlerBase<LibraryComponent> {
/** {@inheritDoc} */
@Override
public String getName(LibraryComponent element) {
return element.getComponent().getName();
}
/** {@inheritDoc} */
@Override
protected String getPluginId() {
return PLUGIN_ID;
}
/** {@inheritDoc} */
@Override
protected String getIconPath(LibraryComponent element) {
return "icons/component.gif";
}
/** {@inheritDoc} */
@Override
public List<EObject> getSubnodes(LibraryComponent element) {
Component component = element.getComponent();
IModelElementHandler<EObject> handler =
IModelElementHandlerService.getInstance().getModelElementHandler(component);
return handler.getSubnodes(component);
}
/** {@inheritDoc} */
@Override
public List<EObject> getSpecifications(LibraryComponent element) {
return ComponentHandler.getFilteredSpecifications(element.getComponent());
}
/** {@inheritDoc} */
@Override
public EObject handleOpenModelElementRequest(LibraryComponent element) {
return ComponentHandler.doHandleOpenModelElementRequest(element.getComponent());
}
}
/*-------------------------------------------------------------------------+
| Copyright 2011 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.handler;
import static org.fortiss.af3.component.ui.AF3ComponentUIActivator.PLUGIN_ID;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.LibraryComponent;
import org.fortiss.af3.component.model.LibraryComponentPackage;
import org.fortiss.af3.expression.model.definitions.library.LibraryFunctionDefinition;
import org.fortiss.af3.expression.model.definitions.library.LibraryTypeDefinition;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.extension.base.NamedCommentedModelElementHandlerBase;
/**
* {@link IModelElementHandler} for {@link LibraryComponentPackage}.
*
* @author ratiu
*/
public class LibraryComponentPackageHandler
extends NamedCommentedModelElementHandlerBase<LibraryComponentPackage> {
/** {@inheritDoc} */
@Override
protected String getPluginId() {
return PLUGIN_ID;
}
/** {@inheritDoc} */
@Override
protected String getIconPath(LibraryComponentPackage element) {
return "icons/package.gif";
}
/** {@inheritDoc} */
@Override
public List<EObject> getSubnodes(LibraryComponentPackage element) {
List<EObject> subNodes = new ArrayList<EObject>();
subNodes.addAll(element.getSubPackages());
if(element.getDataDictionary() != null) {
subNodes.add(element.getDataDictionary());
}
for(LibraryTypeDefinition td : element.getLibraryTypeDefinitions()) {
subNodes.add(td);
}
for(LibraryFunctionDefinition fd : element.getLibraryFunctionDefinitions()) {
subNodes.add(fd);
}
for(LibraryComponent lc : element.getLibraryComponents()) {
subNodes.add(lc);
}
return subNodes;
}
}
AddComponentToLibrary.java 62b0a5559ba09cc4c40fa5f33bb5d20548d1e971 GREEN
AddFunctionDefinitionToLibrary.java 9100e66109501071b6a22c7018daa06b1cbbfa8d GREEN
AddTypeDefinitionToLibrary.java 8b4f247f6f968fdc072f93ee04d35324420eab1c GREEN
ConvertReferenceToComponent.java 8282e28a34ce8342f2794797e116e254b649182b GREEN
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.library;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.LibraryComponentPackage;
import org.fortiss.tooling.base.ui.library.AddElementToLibraryBase;
/**
* Menu for adding components to the component library.
*
* @author ratiu
*/
public class AddComponentToLibrary extends AddElementToLibraryBase<Component> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<Component> getElementClass() {
return Component.class;
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<LibraryComponentPackage> getLibraryPackageClass() {
return LibraryComponentPackage.class;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.library;
import org.fortiss.af3.component.model.LibraryComponentPackage;
import org.fortiss.af3.expression.model.definitions.FunctionDefinition;
import org.fortiss.tooling.base.ui.library.AddElementToLibraryBase;
/**
* Menu for adding function definitions to the component library.
*
* @author ratiu
*/
public class AddFunctionDefinitionToLibrary extends AddElementToLibraryBase<FunctionDefinition> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<FunctionDefinition> getElementClass() {
return FunctionDefinition.class;
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<LibraryComponentPackage> getLibraryPackageClass() {
return LibraryComponentPackage.class;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.library;
import org.fortiss.af3.component.model.LibraryComponentPackage;
import org.fortiss.af3.expression.model.definitions.TypeDefinition;
import org.fortiss.tooling.base.ui.library.AddElementToLibraryBase;
/**
* Menu for adding type definitions to the component library.
*
* @author ratiu
*/
public class AddTypeDefinitionToLibrary extends AddElementToLibraryBase<TypeDefinition> {
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<TypeDefinition> getElementClass() {
return TypeDefinition.class;
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
protected Class<LibraryComponentPackage> getLibraryPackageClass() {
return LibraryComponentPackage.class;
}
}
/*-------------------------------------------------------------------------+
| Copyright 2012 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.component.ui.library;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.component.model.ComponentRef;
import org.fortiss.af3.component.ui.AF3ComponentUIActivator;
import org.fortiss.tooling.base.library.ModelElementLibraryService;
import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor;
import org.fortiss.tooling.kernel.ui.extension.data.ContextMenuContextProvider;
import org.fortiss.tooling.kernel.ui.service.IContextMenuService;
/**
* Menu for converting {@link ComponentRef} references into {@link Component}.
*
* @author ratiu
*/
public class ConvertReferenceToComponent implements IContextMenuContributor {
/** {@inheritDoc} */
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
if(selection instanceof ComponentRef) {
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
contributionItems.add(new ActionContributionItem(
new ConvertComponentRefToComponentAction((ComponentRef)selection)));
return contributionItems;
}