Examples of ISourceReference

Source reference elements may be working copies if they were created from a compilation unit that is a working copy.

@noimplement This interface is not intended to be implemented by clients.


Examples of org.eclipse.cdt.core.model.ISourceReference

                new NullProgressMonitor());
            for (IIndexMacro macro : macros) {
              ICElement element = IndexUI.getCElementForMacro(
                  src.getCProject(), index, macro);
              if (element != null) {
                ISourceReference ref = (ISourceReference)element;
                FileLocation location = new FileLocation(
                    ref.getTranslationUnit().getPath().toPortableString(),
                    ref.getSourceRange().getStartPos(),
                    ref.getSourceRange().getLength(),
                    ref.getSourceRange().getStartLine());
                names.add(new Name(location));
              }
            }
          }
        }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

              if (element != null && element.exists()) {

                final int kind = element.getElementType();
                if (kind == IModelElement.TYPE || kind == IModelElement.METHOD) {

                  final ISourceReference reference = (ISourceReference) element;
                  final ISourceRange range = reference.getSourceRange();

                  if (range != null) {
                    viewer.setSelectedRange(range.getOffset(), range.getLength());
                    viewer.doOperation(ISourceViewer.FORMAT);
                  }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

              if (element != null && element.exists()) {

                final int kind = element.getElementType();
                if (kind == IModelElement.TYPE || kind == IModelElement.METHOD) {

                  final ISourceReference reference = (ISourceReference) element;
                  final ISourceRange range = reference.getSourceRange();

                  if (range != null) {
                    viewer.setSelectedRange(range.getOffset(), range.getLength());
                    viewer.doOperation(ISourceViewer.FORMAT);
                  }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

      if (MODE_PHP == mode) {
        if (lastSelection instanceof IStructuredSelection
            && lastSelection instanceof TextSelection) {
          IEditorPart activeEditor = PHPUiPlugin.getActiveEditor();
          if (activeEditor instanceof PHPStructuredEditor) {
            ISourceReference computedSourceReference = ((PHPStructuredEditor) activeEditor)
                .computeHighlightRangeSourceReference();
            if (computedSourceReference != null) {
              Object parent = ((PHPOutlineContentProvider) contentProvider)
                  .getParent(computedSourceReference);
              for (Object element : ((PHPOutlineContentProvider) contentProvider)
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

      }
      Object[] array = children.toArray(new Object[children.size()]);
      return array;
      // handle all method references
    } else if (element instanceof ISourceReference) {
      ISourceReference source = ((ISourceReference) element);
      return super.getChildren(source);
    } else if (element instanceof ConstantNode) {
      return ((ConstantNode) element).getChildren();
    }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

   *
   * @param binding
   * @return
   */
  public ASTNode findDeclaringNode(IBinding binding) {
    ISourceReference phpElement = (ISourceReference) binding
        .getPHPElement();
    try {
      return getElementAt(phpElement.getSourceRange().getOffset());
    } catch (ModelException e) {
      PHPCorePlugin.log(e);
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.dltk.core.ISourceReference

            if (MODE_TWIG == mode) {
                if (selection instanceof IStructuredSelection
                        && selection instanceof TextSelection) {
                    IEditorPart activeEditor = PHPUiPlugin.getActiveEditor();
                    if (activeEditor instanceof PHPStructuredEditor) {
                        ISourceReference computedSourceReference = ((PHPStructuredEditor) activeEditor)
                                .computeHighlightRangeSourceReference();
                        if (computedSourceReference != null) {
                            return new StructuredSelection(
                                    computedSourceReference);
                        }
View Full Code Here

Examples of org.eclipse.jdt.core.ISourceReference

 
 
  private String computeSource() {
    StringBuffer result = new StringBuffer();
    try {
      ISourceReference ref = (ISourceReference) owner;
      ISourceRange range = ref.getSourceRange();
      int sourceOffset = range.getOffset();
      int sourceLen = range.getLength();
      int offset = position.getOffset();
      int len = position.getLength();

      offset -= sourceOffset;
      if (offset < 0) {
        offset = 0;
        result.append("Position precedes element!\n");
      }
      if (len > sourceLen) {
        len = sourceLen;
        result.append("Position extends past element!\n");
      }
      if (len < 0) {
        len = 0;
        result.append("Length was less than 0!\n");
      }
      result.append(ref.getSource().substring(offset, offset + len));

    }
    catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.eclipse.jdt.core.ISourceReference

   * @param elem
   * @return @throws
   *         JavaModelException
   */
  protected ISourceRange getNaturalRange(IJavaElement elem) throws JavaModelException {
    ISourceReference ref = (ISourceReference) elem;
    return ref.getSourceRange();
  }
View Full Code Here

Examples of org.eclipse.jdt.core.ISourceReference

   * @param result
   * @param positions
   * @throws BadLocationException
   */
  private void constructAnnotations(IJavaElement elem, Map result, Set positions) throws BadLocationException, JavaModelException {
    ISourceReference reference = (ISourceReference) elem;

    if (positions != null) {

      for (Iterator iter = positions.iterator(); iter.hasNext();) {
        EnhancedPosition aPosition = (EnhancedPosition) iter.next();
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.