Examples of ASTCssNode


Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    case STYLE_SHEET: {
      return true;
    }
    case GENERAL_BODY: {
      GeneralBody body = (GeneralBody) parent;
      ASTCssNode bodyParent = body.getParent();
      return bodyParent == null || bodyParent.getType() == ASTCssNodeType.MEDIA;
    }
    default:
      //nothing is needed
    }
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

   
    return ((ReusableStructure)owner).hasParameters();
  }
 
  public static void validateLessBodyCompatibility(ASTCssNode reference, List<ASTCssNode> members, ProblemsHandler problemsHandler) {
    ASTCssNode parent = reference.getParent();
    if (!isBody(parent)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }
   
    SupportedLessBodyMembers allowedBodyMembers = new SupportedLessBodyMembers();
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

  private List<PlaceholderScope> importIntoPlaceholder(PlaceholderScope placeholder) {
    Import encounteredImport = (Import) placeholder.getOwner();
    ReferencesSolver referencesSolver = new ReferencesSolver(problemsHandler, configuration);
    referencesSolver.solveReferences(encounteredImport, placeholder.getParent());

    ASTCssNode importedAst = importsSolver.importEncountered(encounteredImport, placeholder.getOwner().getSource());
    if (importedAst != null) {
      InitialScopeExtractor importedAstScopeBuilder = new InitialScopeExtractor();
      IScope addThisIntoScopeTree = importedAstScopeBuilder.extractScope(importedAst);
     
      placeholder.replaceSelf(addThisIntoScopeTree);
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

  public ASTCssNode findParentOfType(ASTCssNode node, ASTCssNodeType... type) {
    Set<ASTCssNodeType> allTypes = new HashSet<ASTCssNodeType>();
    Collections.addAll(allTypes, type);
   
    ASTCssNode candidate = node;
    while (candidate.getParent()!=null) {
      candidate=candidate.getParent();
      if (allTypes.contains(candidate.getType()))
        return candidate;
    }
    return candidate;
  }
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

 
  public void replace(ASTCssNode oldChild, ASTCssNode newChild) {
    if (oldChild == newChild)
      return;

    ASTCssNode parent = oldChild.getParent();
    PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(parent.getClass());
    for (PropertyDescriptor descriptor : propertyDescriptors)
      if (isAstProperty(descriptor)) {
        Class<?> propertyType = descriptor.getPropertyType();

        if (propertyType != null && propertyType.isInstance(newChild)) {
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    setPropertyValue(oldChild, null, "parent");
    setPropertyValue(parent, newChild, propertyDescriptor);
  }

  public void removeFromBody(ASTCssNode node) {
    ASTCssNode parent = node.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    pBody.removeMember(node);
    node.setParent(null);
  }

  public void replaceInBody(ASTCssNode oldNode, ASTCssNode newNode) {
    ASTCssNode parent = oldNode.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    Body pBody = (Body) parent;
    pBody.replaceMember(oldNode, newNode);
  }

  public void replaceInBody(ASTCssNode oldNode, List<ASTCssNode> newNodes) {
    ASTCssNode parent = oldNode.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    Body pBody = (Body) parent;
    pBody.replaceMember(oldNode, newNodes);
  }

  public void addIntoBody(ASTCssNode newNode, ASTCssNode afterNode) {
    ASTCssNode parent = afterNode.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.ASTCssNode

    pBody.addMemberAfter(newNode, afterNode);
    newNode.setParent(parent);
  }

  public void addIntoBody(List<? extends ASTCssNode> newNodes, ASTCssNode afterNode) {
    ASTCssNode parent = afterNode.getParent();
    if (!(parent instanceof Body)) {
      throw new BugHappened("Parent is not a body instance. " + parent, parent);
    }

    Body pBody = (Body) parent;
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.