Examples of ISourceModule


Examples of org.eclipse.dltk.compiler.env.ISourceModule

              fTextEditor.getEditorInput());
      IRegion wordRegion = ScriptWordFinder.findWord(document, offset);
      if (wordRegion == null)
        return null;
      if (input instanceof ISourceModule) {
        ISourceModule sm = (ISourceModule) input;
        IModelElement modelElement = sm.getModelElement();
        RutaSelectionParser parser = new RutaSelectionParser();
        ModuleDeclaration moduleDeclaration = parser.parse(sm);
        String word = document.get(wordRegion.getOffset(), wordRegion.getLength());
        RutaReferenceVisitor referenceVisitor = new RutaReferenceVisitor(wordRegion.getOffset());
        moduleDeclaration.traverse(referenceVisitor);
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ISourceModule

    if (myAnnotations != null && !myAnnotations.isEmpty()) {
      removeAnnotations(myAnnotations.keySet());
    }

    RutaSelectionParser parser = new RutaSelectionParser();
    ISourceModule unit = (ISourceModule) getInputModelElement();
    ModuleDeclaration parsed = parser.parse(unit);
    ISourceViewer sourceViewer = getSourceViewer();
    StyledText styledText = sourceViewer.getTextWidget();
    int caret = 0;
    if (sourceViewer instanceof ITextViewerExtension5) {
View Full Code Here

Examples of org.eclipse.dltk.compiler.env.ISourceModule

    if (myAnnotations != null && !myAnnotations.isEmpty()) {
      removeAnnotations(myAnnotations.keySet());
    }

    RutaSelectionParser parser = new RutaSelectionParser();
    ISourceModule unit = (ISourceModule) getInputModelElement();
    ModuleDeclaration parsed = parser.parse(unit);
    RutaRuleIdVisitor visitor = new RutaRuleIdVisitor(id);
    try {
      parsed.traverse(visitor);
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

   */
  @Override
  public void apply(ICompletionReporter reporter) throws Exception {

    SuperclassMethodContext context = (SuperclassMethodContext) getContext();
    ISourceModule module = context.getSourceModule();

    IModelElement element = module.getElementAt(context.getOffset());

    if (!(element instanceof SourceType)) {
      while(element.getParent() != null) {
        element = element.getParent();
        if (element instanceof SourceType) {
          break;
        }
      }
    }

    if (element == null || !(element instanceof SourceType)) {
      return;
    }

    IDLTKSearchScope scope = SearchEngine.createSearchScope(module.getScriptProject());
    SourceType type = (SourceType) element;
    SourceRange range = getReplacementRange(context);
    String prefix = context.getPrefix();

    IType[] projectTypes = PhpModelAccess.getDefault().findTypes(type.getElementName(), MatchRule.EXACT, 0, 0, scope, null);
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

   * @since 0.17.0
   */
  public static IModelElement getSourceElement(IModelElement element, int offset, int length) throws CoreException {
    Assert.isNotNull(element);

    ISourceModule sourceModule = (ISourceModule) element.getAncestor(IModelElement.SOURCE_MODULE);
    if (sourceModule == null) return null;

    return getSourceElement(sourceModule, offset, length);
  }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

    } else if (el instanceof IProjectFragment ) {
      for (IModelElement sub : ((IProjectFragment) el).getChildren()) {
        rawSearch(list, sub, name);
      }
    } else if (el instanceof ISourceModule){
      ISourceModule mod = (ISourceModule) el;
      for (IType t : mod.getAllTypes()) {
        if (t.getFullyQualifiedName(BACK_SLASH).equals(name)) {
         
          list.add(t);
        }
      }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

      SearchEngine.createSearchScope(modelElement.getScriptProject()),
      new SearchRequestor() {
        @Override
        public void acceptSearchMatch(final SearchMatch match) throws CoreException {
          if (match instanceof TypeReferenceMatch && match.getElement() instanceof IModelElement) {
            final ISourceModule module = (ISourceModule) ((IModelElement) match.getElement()).getAncestor(IModelElement.SOURCE_MODULE);
            if (module != null && RefactoringAvailabilityTester.isRenameAvailable(module)) {
              ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(module);
              if (moduleDeclaration != null) {
                try {
                  moduleDeclaration.traverse(new PHPASTVisitor() {
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

        SearchEngine.createSearchScope(modelElement.getScriptProject()),
        new SearchRequestor() {
          @Override
          public void acceptSearchMatch(final SearchMatch match) throws CoreException {
            if (match instanceof MethodReferenceMatch && ((MethodReferenceMatch) match).getNode() instanceof PHPCallExpression && match.getElement() instanceof IModelElement) {
              final ISourceModule module = (ISourceModule) ((IModelElement) match.getElement()).getAncestor(IModelElement.SOURCE_MODULE);
              if (module != null && RefactoringAvailabilityTester.isRenameAvailable(module)) {
                PHPCallExpression expression = (PHPCallExpression) ((MethodReferenceMatch) match).getNode();
                if (expression.getReceiver() == null) {
                  if (expression.getCallName() instanceof FullyQualifiedReference) {
                    int offset;
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

          return false;
        }
       
        project = element.getScriptProject().getProject();
      } else if (receiver instanceof ISourceModule) {
        ISourceModule source = (ISourceModule) receiver;
        project = source.getScriptProject().getProject();
      } else if (receiver instanceof IProject) {
        project = (IProject) receiver;
      } else if (receiver instanceof IAdaptable) {
        IAdaptable adaptable = (IAdaptable) receiver;
        project = ((IResource)adaptable.getAdapter(IResource.class)).getProject();
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceModule

      SearchEngine.createSearchScope(modelElement.getScriptProject()),
      new SearchRequestor() {
        @Override
        public void acceptSearchMatch(SearchMatch match) throws CoreException {
          if (match instanceof FieldReferenceMatch && match.getElement() instanceof IModelElement) {
            ISourceModule module = (ISourceModule) ((IModelElement) match.getElement()).getAncestor(IModelElement.SOURCE_MODULE);
            if (module != null && RefactoringAvailabilityTester.isRenameAvailable(module)) {
              ModuleDeclaration moduleDeclaration = SourceParserUtil.getModuleDeclaration(module);
              if (moduleDeclaration != null) {
                ReferenceFinder referenceFinder = createReferenceFinder(((FieldReferenceMatch) match).getNode(), module);
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.