Package org.eclipse.dltk.core

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


              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

      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

      }
      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

   *
   * @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

            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

TOP

Related Classes of org.eclipse.dltk.core.ISourceReference

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.