Пример #1
0
 /** @see org.eclipse.debug.core.model.IValue#hasVariables() */
 @Override
 public boolean hasVariables() throws DebugException {
   if (interpreterValue.getValue() == null) {
     return false;
   }
   if (interpreterValue.getActualType() instanceof CollectionType) {
     return !((MitraCollection) interpreterValue.getValue()).isEmpty();
   } else {
     return getFieldDescriptors().size() > 0;
   }
 }
Пример #2
0
  protected List<FeatureFieldDescription> getFieldDescriptors() {
    if (interpreterValue == null || interpreterValue.getValue() == null) {
      return Collections.emptyList();
    }

    MetamodelManager manager = ((MitraDebugTarget) getDebugTarget()).getMetamodelManager();

    IMetamodel metamodel = manager.getMetamodel(interpreterValue.getActualType());
    return metamodel.getAllFeatureFieldsDescriptions(interpreterValue.getActualType(), true, false);
  }
Пример #3
0
  /** @see org.eclipse.debug.core.model.IValue#getVariables() */
  @Override
  public IVariable[] getVariables() throws DebugException {

    if (interpreterValue.getValue() == null) {
      return null;
    }
    if (interpreterValue.getActualType() instanceof CollectionType) {
      return getElements();
    } else {
      return getFields();
    }
  }
Пример #4
0
  public MitraValue(MitraDebugTarget target, MitraVariable var, MObject interpreterValue) {
    super(target);

    String valueString = "not initialized";
    if (interpreterValue != null) {
      Object valObject = interpreterValue.getValue();
      if (valObject != null) {
        valueString = valObject.toString();
      }
    }
    variable = var;
    value = valueString;
    this.interpreterValue = interpreterValue;
  }
Пример #5
0
  protected IVariable[] getElements() throws DebugException {
    MitraStackFrame stackFrame = variable.getStackFrame();
    MitraCollection oclCollection = (MitraCollection) interpreterValue.getValue();
    IVariable[] variables = new IVariable[oclCollection.size()];
    int index = 0;
    for (MObject element : oclCollection) {
      String name = "[" + index + "]";
      MitraVariable mitraVariable = new MitraVariable(stackFrame, name);
      MitraValue mitraValue =
          new MitraValue((MitraDebugTarget) getDebugTarget(), mitraVariable, element);
      mitraVariable.setValue(mitraValue);

      variables[index] = mitraVariable;
      index++;
    }
    return variables;
  }