blob: 4794d4f5a64cdacf5b779d852470c868c410f33c [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 DeleteInstanceof extends DeleteRelationShip {
/**
* @param manager
* @param variableI
*/
public DeleteInstanceof(IModelManager manager, IModelElement source, IModelElement target) {
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 = instance
// source = type
/* if (source == null) {
throw new GTOperationException(GTErrorStrings.INTERNAL_EMPTY_VALUE);
}
if (target == null) {
throw new GTOperationException(GTErrorStrings.INTERNAL_EMPTY_VALUE);
}
try {
manager.deleteInstanceOf(source, target );
} catch (VPMCoreException e) {
throw new GTOperationException(GTErrorStrings.DELETE_INSTANCEOF
+"Type: "+source.getFullyQualifiedName()
+"Instance: "+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()+" instanceof "+target.getName();
}
}