Package org.eclipse.php.internal.core.typeinference

Examples of org.eclipse.php.internal.core.typeinference.FakeConstructor


   * @return new offset
   */
  public int inject(IDocument document, ITextViewer textViewer, int offset) {
    IModelElement modelElement = proposal.getModelElement();
    if (modelElement instanceof FakeConstructor) {
      FakeConstructor fc = (FakeConstructor) modelElement;
      if (fc.getParent() instanceof AliasType) {
        return offset;
      }

    } else if (modelElement instanceof AliasType) {
      return offset;
View Full Code Here


   * @param modelElement
   * @return
   */
  private IMethod getProperMethod(IMethod modelElement) {
    if (modelElement instanceof FakeConstructor) {
      FakeConstructor fc = (FakeConstructor) modelElement;
      if (fc.getParent() instanceof AliasType) {
        AliasType aliasType = (AliasType) fc.getParent();
        alias = aliasType.getAlias();
        if (aliasType.getParent() instanceof IType) {
          fc = FakeConstructor.createFakeConstructor(null,
              (IType) aliasType.getParent(), false);
        }
      }
      IType type = fc.getDeclaringType();
      IMethod[] ctors = FakeConstructor.getConstructors(type,
          fc.isEnclosingClass());
      // here we must make sure ctors[1] != null,
      // it means there is an available FakeConstructor for ctors[0]
      if (ctors != null && ctors.length == 2 && ctors[0] != null
          && ctors[1] != null) {
        return ctors[0];
View Full Code Here

    return alias + LPAREN + RPAREN;
  }

  private void initAlias() {
    if (method instanceof FakeConstructor) {
      FakeConstructor fc = (FakeConstructor) method;
      if (fc.getParent() instanceof AliasType) {
        alias = ((AliasType) fc.getParent()).getAlias();
      }
    }
  }
View Full Code Here

      return PHPModelUtils.getDocBlock((IType) member);
    }
    if (member instanceof IMethod) {
      PHPDocBlock result = PHPModelUtils.getDocBlock((IMethod) member);
      if (result == null && member instanceof FakeConstructor) {
        FakeConstructor fc = (FakeConstructor) member;
        result = PHPModelUtils.getDocBlock((IType) fc.getParent());
      }
      return result;
    }
    if (member instanceof IField) {
      return PHPModelUtils.getDocBlock((IField) member);
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.typeinference.FakeConstructor

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.