blob: fb13e9b2d11810557b46074a9a538a2464c81129 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Akos Horvath, Gergely Varro 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:
* Akos Horvath, Gergely Varro - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation;
import org.eclipse.viatra2.core.IModelElement;
import org.eclipse.viatra2.core.IModelManager;
import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.exceptions.GTErrorStrings;
import org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.exceptions.GTOperationException;
import org.eclipse.viatra2.gtasm.patternmatcher.impl.patternmatcher.internal.MatchingFrame;
/**
* @author Akos Horvath
*
*/
public class DeleteSuperTypeof extends DeleteRelationShip {
/**
* @param manager
* @param variableI
* @param p
*/
public DeleteSuperTypeof(IModelManager manager, IModelElement target, IModelElement source) {
super(manager,source,target);
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.gtasm.patternmatcher.impl.gtmatcher.internal.operation.DeleteElement#delete(org.eclipse.viatra2.gtasm.patternmatcher.internal.MatchingFrame)
*/
@Override
protected boolean delete(MatchingFrame frame) throws GTOperationException{
// target = supertype
// source = subtype
/* if (source == null) {
throw new GTOperationException(GTErrorStrings.INTERNAL_EMPTY_VALUE);
}
if (target == null) {
throw new GTOperationException(GTErrorStrings.INTERNAL_EMPTY_VALUE);
}
try {
manager.deleteSupertypeOf(source, target);
} catch (VPMCoreException e) {
throw new GTOperationException(GTErrorStrings.DELETE_SUPERTYPEOF
+"SuperType: "+source.getFullyQualifiedName()
+"SubType: "+target.getFullyQualifiedName());
}
return true;*/
String[] context = {getClass().getSimpleName()};
throw new GTOperationException(GTErrorStrings.INTERNAL_OPERATION_NOT_SUPPORTED
,context
,null);
}
public String toString(){
return "Delete "+ source.getName()+" supertypeof "+target.getName();
}
}