Examples of IJavaReferenceType


Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

        if (editor == null) {
            return region;
        }

        // get the inner class type according to the debugger stack frame, if any
        IJavaReferenceType debugType = sourceMapper.getLastTypeInDebugger();
        if (debugType == null) {
            return region;
        }

        boolean externalClass = editor.getEditorInput() instanceof ExternalClassFileEditorInput;
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

  /**
   * Returns whether the given field variable has the same name as any variables
   */
  private boolean isDuplicateName(IJavaFieldVariable variable)
  {
    IJavaReferenceType javaType = variable.getReceivingType();
    try {
      String[] names = javaType.getAllFieldNames();
      boolean found = false;
      for (int i = 0; i < names.length; i++) {
        if (variable.getName().equals(names[i])) {
          if (found) {
            return true;
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

   *            type name, for example - "int"
   * @return primitive type
   * @throws CoreException
   */
  protected IJavaType getPrimitiveType(String name) throws CoreException {
    IJavaReferenceType type = null;
    if ("boolean".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Boolean"); //$NON-NLS-1$
    } else if ("byte".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Byte"); //$NON-NLS-1$
    } else if ("char".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Character"); //$NON-NLS-1$
    } else if ("double".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Double"); //$NON-NLS-1$
    } else if ("float".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Float"); //$NON-NLS-1$
    } else if ("int".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Integer"); //$NON-NLS-1$
    } else if ("long".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Long"); //$NON-NLS-1$
    } else if ("short".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Short"); //$NON-NLS-1$
    } else if ("void".equals(name)) { //$NON-NLS-1$
      type = (IJavaReferenceType) getType("java.lang.Void"); //$NON-NLS-1$
    }
    if (type != null) {
      IJavaFieldVariable field = type.getField("TYPE"); //$NON-NLS-1$
      IJavaClassObject clazz = (IJavaClassObject) field.getValue();
      return clazz.getInstanceType();
    }
    throw new CoreException(new Status(IStatus.ERROR,
        JDIDebugPlugin.getUniqueIdentifier(), IStatus.OK,
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

    }
    IJavaType[] types = getVM().getJavaTypes(tname);
    if (types != null && types.length > 0) {
      // find the one with the right class loader
      for (IJavaType type2 : types) {
        IJavaReferenceType type = (IJavaReferenceType) type2;
        IJavaObject cloader = type.getClassLoaderObject();
        if (isCompatibleLoader(loader, cloader)) {
          return type.getClassObject();
        }
      }
    }
    IJavaValue loaderArg = loader;
    if (loader == null) {
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

      // Compile in context of declaring type to get proper visibility of
      // locals and members.
      // Compiling in context of receiving type potentially provides
      // access to more members,
      // but does not allow access to privates members in declaring type
      IJavaReferenceType receivingType = frame.getReferenceType();

      // currently disabled - see bugs 99416 and 106492
      // if (frame.isStatic()) {
      // receivingType= frame.getReferenceType();
      // } else {
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

      if (index >= 0) {
        recTypeName = typeName.substring(0, index);
      }
      IJavaType[] javaTypes = getDebugTarget().getJavaTypes(recTypeName);
      if (javaTypes.length > 0) {
        IJavaReferenceType recType = (IJavaReferenceType) javaTypes[0];
        unit = parseCompilationUnit(
            mapper.getSource(recType, getJavaProject(), false)
                .toCharArray(),
            mapper.getCompilationUnitName(), javaProject);
      } else {
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

        if (object instanceof IJavaValue) {
          // look at its type
          object = ((IJavaValue) object).getJavaType();
        }
        if (object instanceof IJavaReferenceType) {
          IJavaReferenceType refType = (IJavaReferenceType) object;
          String[] sourcePaths = refType.getSourcePaths(null);
          if (sourcePaths != null && sourcePaths.length > 0) {
            return sourcePaths[0];
          }
        }
        if (object instanceof IJavaType) {
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaReferenceType

    if (!(value instanceof IJavaObject)) {
      return value;
    }
    IJavaObject javaValue = (IJavaObject) value;
    try {
      IJavaReferenceType type = getType(javaValue);
      if (type == null) {
        return value;
      }
      IJavaStackFrame stackFrame = getStackFrame(javaValue);
      if (stackFrame == null) {
        return value;
      }

      // find the project the snippets will be compiled in.
      ISourceLocator locator = javaValue.getLaunch().getSourceLocator();
      Object sourceElement = null;
      if (locator instanceof ISourceLookupDirector) {
        String[] sourcePaths = type.getSourcePaths(null);
        if (sourcePaths != null && sourcePaths.length > 0) {
          sourceElement = ((ISourceLookupDirector) locator)
              .getSourceElement(sourcePaths[0]);
        }
        if (!(sourceElement instanceof IJavaElement)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.