Package org.pdtextensions.core

Examples of org.pdtextensions.core.PHPType


                    public boolean visit(FullyQualifiedReference s) throws Exception {
                      if (s.sourceStart() == match.getOffset() && s.sourceEnd() == match.getOffset() + match.getLength()) {
                        IModelElement sourceElement = PDTModelUtils.getSourceElement(module, s.sourceStart(), s.matchLength());
                        if (sourceElement != null) {
                          IType sourceType = (IType) sourceElement.getAncestor(IModelElement.TYPE);
                          if (sourceType != null && new PHPType(sourceType).isInstanceOf((IType) modelElement)) {
                            int offset;
                            if (s.getNamespace() == null) {
                              offset = s.sourceStart();
                            } else {
                              if ("\\".equals(s.getNamespace().getName())) { //$NON-NLS-1$
View Full Code Here


                  }
                } else {
                  IModelElement sourceElement = PDTModelUtils.getSourceElement(module, expression.getCallName().sourceStart(), expression.getCallName().matchLength());
                  if (sourceElement != null && sourceElement.getElementType() == IModelElement.METHOD) {
                    IType declaringType = ((IMethod) sourceElement).getDeclaringType();
                    if (declaringType != null && new PHPType(declaringType).isInstanceOf(method.getDeclaringType())) {
                      try {
                        addTextEdit(
                          changeManager.get(module),
                          getProcessorName(),
                          new ReplaceEdit(expression.getCallName().sourceStart(), method.getElementName().length(), getNewElementName())
View Full Code Here

              } else if (receiverReference instanceof TypeReference) {
                receiverTypes = PDTTypeInferenceUtils.getTypes((TypeReference) receiverReference, sourceModule);
              }
              if (receiverTypes != null && receiverTypes.length > 0) {
                IType ancestorType = (IType) modelElement.getAncestor(IModelElement.TYPE);
                if (ancestorType != null && new PHPType(receiverTypes[0]).isInstanceOf(ancestorType)) {
                  replaceEdit = createReplaceEdit(astNode);
                }
              }
            }
View Full Code Here

  public boolean canEnableUpdateReferences() {
    IType enclosingType = (IType) modelElement.getAncestor(IModelElement.TYPE);
    if (enclosingType == null) return false;

    try {
      return new PHPType(enclosingType).inResourceWithSameName();
    } catch (CoreException e) {
      PEXUIPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, PEXUIPlugin.PLUGIN_ID, e.getMessage(), e));

      return false;
    }
View Full Code Here

TOP

Related Classes of org.pdtextensions.core.PHPType

Copyright © 2018 www.massapicom. 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.