Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.IBinding


      ExpressionStatement statement = (ExpressionStatement) program
          .statements().get(0);
      Include include = (Include) statement.getExpression();

      IBinding sourceBinding = include.resolveBinding();

      Assert.assertTrue(sourceBinding.getName().equals("myFile.php") == true);
      Assert.assertTrue(sourceBinding.getPHPElement().getElementType() == IModelElement.SOURCE_MODULE);
      Assert.assertTrue(sourceBinding.getKind() == IBinding.INCLUDE);

    } finally {
      myFile.delete(true, new NullProgressMonitor());
    }
  }
View Full Code Here


          SharedASTProvider.WAIT_NO, null);
      if (ast != null) {
        ASTNode selectedNode = NodeFinder.perform(ast, offset, length);
        if (selectedNode != null
            && selectedNode.getType() == ASTNode.IDENTIFIER) {
          IBinding binding = ((Identifier) selectedNode)
              .resolveBinding();
          if (binding != null) {
            element = binding.getPHPElement();
          }
        }
      }
    } catch (Exception e) {
      // Logger.logException(e);
View Full Code Here

          SharedASTProvider.WAIT_NO, null);
      if (ast != null) {
        ASTNode selectedNode = NodeFinder.perform(ast, offset, length);
        if (selectedNode != null
            && selectedNode.getType() == ASTNode.IDENTIFIER) {
          IBinding binding = ((Identifier) selectedNode)
              .resolveBinding();
          if (binding != null) {
            element = binding.getPHPElement();
          }
        }
      }
    } catch (Exception e) {
      // Logger.logException(e);
View Full Code Here

    if (fViewerElement == viewerElement)
      return;
   
    fViewerElement= viewerElement;
    fException= null;
    IBinding trayBinding= fParent.getBinding();
    StringBuffer buf= new StringBuffer(getName());
    if (viewerElement != null) {
      IBinding viewerBinding= viewerElement.getBinding();
      try {
        String queryResult= executeQuery(viewerBinding, trayBinding);
        buf.append(queryResult);
      } catch (RuntimeException e) {
        fException= e;
        buf.append(e.getClass().getName());
        buf.append(" for \""); //$NON-NLS-1$
        if (viewerBinding == null)
          buf.append("null"); //$NON-NLS-1$
        else
          buf.append('"').append(viewerBinding.getKey());
        buf.append("\" and "); //$NON-NLS-1$
        buf.append(trayBinding.getKey()).append('"');
      }
    } else {
      buf.append(N_A);
View Full Code Here

   * {@link IMethodBinding#getDefaultValue()}.
   */
  public static ASTAttribute createValueAttribute(ASTAttribute parent, String name, Object value) {
    ASTAttribute res;
    if (value instanceof IBinding) {
      IBinding binding= (IBinding) value;
      res= new Binding(parent, name + ": " + getBindingLabel(binding), binding, true);
     
    } else if (value instanceof String) {
      res= new GeneralAttribute(parent, name, "\"" + (String) value + "\"");
     
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.IBinding

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.