/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. */ package org.sintef.thingml.resource.thingml.debug; public class ThingmlDebugVariable extends org.sintef.thingml.resource.thingml.debug.ThingmlDebugElement implements org.eclipse.debug.core.model.IVariable { private String name; private org.eclipse.debug.core.model.IValue value; private String referenceTypeName; public ThingmlDebugVariable(org.eclipse.debug.core.model.IDebugTarget debugTarget, String name, org.eclipse.debug.core.model.IValue value, String referenceTypeName) { super(debugTarget); this.name = name; this.value = value; this.referenceTypeName = referenceTypeName; } public boolean supportsValueModification() { return false; } public void setValue(org.eclipse.debug.core.model.IValue value) throws org.eclipse.debug.core.DebugException { throw new org.eclipse.debug.core.DebugException(new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, org.sintef.thingml.resource.thingml.mopp.ThingmlPlugin.PLUGIN_ID, "Can't set variable.")); } public void setValue(String expression) throws org.eclipse.debug.core.DebugException { throw new org.eclipse.debug.core.DebugException(new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, org.sintef.thingml.resource.thingml.mopp.ThingmlPlugin.PLUGIN_ID, "Can't set variable.")); } public boolean verifyValue(org.eclipse.debug.core.model.IValue value) throws org.eclipse.debug.core.DebugException { throw new org.eclipse.debug.core.DebugException(new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, org.sintef.thingml.resource.thingml.mopp.ThingmlPlugin.PLUGIN_ID, "Can't set variable.")); } public boolean verifyValue(String expression) throws org.eclipse.debug.core.DebugException { throw new org.eclipse.debug.core.DebugException(new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, org.sintef.thingml.resource.thingml.mopp.ThingmlPlugin.PLUGIN_ID, "Can't set variable.")); } public org.eclipse.debug.core.model.IValue getValue() throws org.eclipse.debug.core.DebugException { return value; } public String getName() throws org.eclipse.debug.core.DebugException { return name; } public String getReferenceTypeName() throws org.eclipse.debug.core.DebugException { return referenceTypeName; } public boolean hasValueChanged() throws org.eclipse.debug.core.DebugException { return true; } }