Examples of CssToken


Examples of com.google.collide.codemirror2.CssToken

      return ExplicitAction.DEFAULT;
    }
    JsonArray<Token> tokens = parseResult.getTokens();
    Preconditions.checkNotNull(tokens);
    Preconditions.checkState(tokens.size() > 0);
    CssToken lastToken = (CssToken) tokens.peek();
    if ("{".equals(lastToken.getContext())) {
      return ExplicitAction.DEFAULT;
    }

    // 2) Check we will enter block.
    parseResult = parser.getState(CssState.class, selectionModel.getCursorPosition(), "{");
    if (parseResult == null) {
      return ExplicitAction.DEFAULT;
    }
    tokens = parseResult.getTokens();
    Preconditions.checkNotNull(tokens);
    Preconditions.checkState(tokens.size() > 0);
    lastToken = (CssToken) tokens.peek();
    String context = lastToken.getContext();
    boolean inBlock = context != null && context.endsWith("{");
    if (inBlock && NULL == lastToken.getType()) {
      return new ExplicitAction(
          new DefaultAutocompleteResult(CLASS_SEPARATOR, "", CLASS_JUMPLENGTH));
    }
    return ExplicitAction.DEFAULT;
  }
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.