| /******************************************************************************* |
| * Copyright (c) 2016 Fundación Tecnalia Research & Innovation. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Huascar Espinoza - initial API and implementation |
| * Alejandra Ruíz - initial API and implementation |
| * Idoya Del Río - initial API and implementation |
| * Mari Carmen Palacios - initial API and implementation |
| * Angel López - initial API and implementation |
| *******************************************************************************/ |
| /** |
| * Generated with Acceleo |
| */ |
| package org.eclipse.opencert.pam.procspec.process.providers; |
| |
| import java.util.List;
|
|
|
| import org.eclipse.emf.ecore.EObject;
|
|
|
| import org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent;
|
|
|
| import org.eclipse.emf.eef.runtime.context.PropertiesEditingContext;
|
|
|
| import org.eclipse.emf.eef.runtime.impl.utils.EEFUtils;
|
|
|
| import org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider;
|
|
|
| import org.eclipse.emf.eef.runtime.providers.impl.PropertiesEditingProviderImpl;
|
|
|
| import org.eclipse.jface.viewers.IFilter;
|
|
|
| import org.eclipse.opencert.pam.procspec.process.ActivityRel;
|
| import org.eclipse.opencert.pam.procspec.process.ProcessPackage;
|
|
|
| import org.eclipse.opencert.pam.procspec.process.components.ActivityRelPropertiesEditionComponent; |
| |
| /** |
| * |
| * |
| */ |
| public class ActivityRelPropertiesEditionProvider extends PropertiesEditingProviderImpl { |
| |
| /** |
| * Constructor without provider for super types. |
| */ |
| public ActivityRelPropertiesEditionProvider() { |
| super(); |
| } |
| |
| /** |
| * Constructor with providers for super types. |
| * @param superProviders providers to use for super types. |
| */ |
| public ActivityRelPropertiesEditionProvider(List<PropertiesEditingProvider> superProviders) { |
| super(superProviders); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext) |
| * |
| */ |
| public boolean provides(PropertiesEditingContext editingContext) { |
| return (editingContext.getEObject() instanceof ActivityRel) |
| && (ProcessPackage.Literals.ACTIVITY_REL == editingContext.getEObject().eClass()); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) |
| * |
| */ |
| public boolean provides(PropertiesEditingContext editingContext, String part) { |
| return (editingContext.getEObject() instanceof ActivityRel) && (ActivityRelPropertiesEditionComponent.BASE_PART.equals(part)); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.Class) |
| * |
| */ |
| @SuppressWarnings("rawtypes") |
| public boolean provides(PropertiesEditingContext editingContext, java.lang.Class refinement) { |
| return (editingContext.getEObject() instanceof ActivityRel) && (refinement == ActivityRelPropertiesEditionComponent.class); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#provides(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.Class) |
| * |
| */ |
| @SuppressWarnings("rawtypes") |
| public boolean provides(PropertiesEditingContext editingContext, String part, java.lang.Class refinement) { |
| return (editingContext.getEObject() instanceof ActivityRel) && ((ActivityRelPropertiesEditionComponent.BASE_PART.equals(part) && refinement == ActivityRelPropertiesEditionComponent.class)); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String) |
| * |
| */ |
| public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode) { |
| if (editingContext.getEObject() instanceof ActivityRel) { |
| return new ActivityRelPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); |
| } |
| return super.getPropertiesEditingComponent(editingContext, mode); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String) |
| * |
| */ |
| public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part) { |
| if (editingContext.getEObject() instanceof ActivityRel) { |
| if (ActivityRelPropertiesEditionComponent.BASE_PART.equals(part)) |
| return new ActivityRelPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); |
| } |
| return super.getPropertiesEditingComponent(editingContext, mode, part); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @see org.eclipse.emf.eef.runtime.providers.PropertiesEditingProvider#getPropertiesEditingComponent(org.eclipse.emf.eef.runtime.context.PropertiesEditingContext, java.lang.String, java.lang.String, java.lang.Class) |
| */ |
| @SuppressWarnings("rawtypes") |
| public IPropertiesEditionComponent getPropertiesEditingComponent(PropertiesEditingContext editingContext, String mode, String part, java.lang.Class refinement) { |
| if (editingContext.getEObject() instanceof ActivityRel) { |
| if (ActivityRelPropertiesEditionComponent.BASE_PART.equals(part) |
| && refinement == ActivityRelPropertiesEditionComponent.class) |
| return new ActivityRelPropertiesEditionComponent(editingContext, editingContext.getEObject(), mode); |
| } |
| return super.getPropertiesEditingComponent(editingContext, mode, part, refinement); |
| } |
| |
| /** |
| * Provides the filter used by the plugin.xml to assign part forms. |
| */ |
| public static class EditionFilter implements IFilter { |
| |
| /** |
| * {@inheritDoc} |
| * |
| * @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object) |
| */ |
| public boolean select(Object toTest) { |
| EObject eObj = EEFUtils.resolveSemanticObject(toTest); |
| return eObj != null && ProcessPackage.Literals.ACTIVITY_REL == eObj.eClass(); |
| } |
| |
| } |
| |
| } |