Examples of ILocalVariable


Examples of org.eclipse.jdt.core.ILocalVariable

    if (o.isReadOnly())
      throw new IllegalArgumentException(Messages.Worklist_IllegalWorklistElement + o);

    switch (o.getElementType()) {
    case IJavaElement.LOCAL_VARIABLE: {
      final ILocalVariable lv = (ILocalVariable) o;
      final String sig = lv.getTypeSignature();
      if (!isValidTypeSignature(sig))
        throw new IllegalArgumentException(Messages.Worklist_IllegalWorklistElement
            + o);
      break;
    }
View Full Code Here

Examples of org.eclipse.jdt.core.ILocalVariable

  @Override
  protected void addHyperlinks(List<IHyperlink> hyperlinksCollector, final IRegion wordRegion,
      SelectionDispatchAction openAction, IJavaElement element, boolean qualify, JavaEditor editor) {

    if (element instanceof ILocalVariable) {
      ILocalVariable localVariable = (ILocalVariable) element;
      IJavaElement parent = localVariable.getParent();
      if (parent instanceof IMethod) {
        IMethod parentMethod = (IMethod) parent;
        if (parentMethod.getAnnotation("Autowired") != null) {
          String typeSignature = localVariable.getTypeSignature();
          addHyperlinksHelper(typeSignature, localVariable, hyperlinksCollector);
        }
      }
    }
    else if (element instanceof IField) {
View Full Code Here

Examples of org.eclipse.jdt.core.ILocalVariable

  private String newName;

  @Override
  protected boolean initialize(Object element) {
    if (element instanceof ILocalVariable) {
      ILocalVariable variable = (ILocalVariable) element;
      IJavaProject javaProject = (IJavaProject) variable.getAncestor(IJavaElement.JAVA_PROJECT);
      IProject project = javaProject.getProject();
      if (SpringCoreUtils.isSpringProject(project) && variable.getParent() instanceof IMethod) {
        IMethod method = (IMethod) variable.getParent();
        try {
          if (method.isConstructor()) {
            refactoredVariable = variable;
            newName = getArguments().getNewName();
            return true;
View Full Code Here

Examples of org.eclipse.jdt.core.ILocalVariable

  @Override
  protected boolean initialize(Object element) {
    boolean hasPathVariable = false;

    if (element instanceof ILocalVariable) {
      ILocalVariable variable = (ILocalVariable) element;
      ICompilationUnit compilationUnit = getCompilationUnit(variable);
      file = (IFile) compilationUnit.getResource();

      try {
        ISourceRange sourceRange = variable.getSourceRange();
        AssistContext assistContext = new AssistContext(compilationUnit, null, sourceRange.getOffset(),
            sourceRange.getLength());
        ASTNode node = assistContext.getCoveringNode();

        if (node instanceof SingleVariableDeclaration) {
View Full Code Here

Examples of org.eclipse.jdt.core.ILocalVariable

              switch (method.getNumberOfParameters()) {
              case 0:
                break;
              case 1: {
                ILocalVariable pType = method.getParameters()[0];
                String[][] resolvedType = type
                    .resolveType(Signature.toString(pType
                        .getTypeSignature()));
                IType parameterType = null;
                if (resolvedType != null) {
                  parameterType = project
                      .findType(resolvedType[0][0]
                          + "." + resolvedType[0][1]); //$NON-NLS-1$
                }
                if (resolvedType == null
                    || !Util.assignable(
                        parameterType,
                        project.findType("javafx.event.Event"))) { ////$NON-NLS-1$
                  DefaultProblem problem = new DefaultProblem(
                      unit.getElementName().toCharArray(),
                      "Parameter '" //$NON-NLS-1$
                          + pType.getElementName()
                          + "' is not assignable to javafx.event.Event", //$NON-NLS-1$
                      IProblem.ExternalProblemNotFixable,
                      new String[0],
                      ProblemSeverities.Warning, pType
                          .getSourceRange()
                          .getOffset(), pType
                          .getSourceRange()
                          .getOffset()
                          + pType.getSourceRange()
                              .getLength(),
                      getMethodLineNumber(type, method),
                      0);
                  problems.add(problem);
                }
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.