Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 59096dc55bebc93765a7de5baae5f71ebffd5d2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*****************************************************************************
 * Copyright (c) 2011 CEA LIST.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
 *****************************************************************************/
package org.eclipse.papyrus.uml.tools.providers;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.uml.tools.helper.HistoryUtil;
import org.eclipse.papyrus.uml.tools.providers.internal.EditServiceValidator;
import org.eclipse.papyrus.uml.tools.providers.internal.UMLElementMEBContentProvider;

public class ServiceEditFilteredUMLContentProvider extends UMLElementMEBContentProvider {

	private EditServiceValidator validator;

	public ServiceEditFilteredUMLContentProvider(EObject editedObject, EStructuralFeature feature, EObject semanticRoot) {
		super(semanticRoot, HistoryUtil.getHistoryID(editedObject, feature, semanticRoot));
		validator = new EditServiceValidator(editedObject, feature);
	}

	@Override
	public boolean isValidValue(Object element) {
		return super.isValidValue(element) && validator.isValidValue(getAdaptedValue(element));
	}
}

Back to the top