/******************************************************************************* | |
* Copyright (c) 2004-2008 Istvan Rath and Daniel Varro | |
* 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: | |
* Istvan Rath - initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.viatra2.treeeditor.properties.validators; | |
import org.eclipse.viatra2.core.IModelElement; | |
public class LocalNameValidator extends VPMValidator | |
{ | |
public LocalNameValidator(IModelElement e) {super(e);} | |
public String isValid(Object value) | |
{ | |
for (IModelElement sibling : iElement.getNamespace().getElementsInNamespace()) | |
{ | |
if (sibling.getName().equals(value.toString())) | |
return "Warning: name collision with " + sibling.getFullyQualifiedName(); | |
} | |
return null; // means valid | |
} | |
} |