Package org.chromium.debug.ui.DialogUtils

Examples of org.chromium.debug.ui.DialogUtils.Message


     * Builds PreviewContext from what was passed from the action. Takes into account
     * various problems that are returned as error value of {@link Optional}.
     */
    static Optional<PreviewContext> build(Value uiValue) {
      if (uiValue == null) {
        return createErrorOptional(new Message(Messages.LogicImpl_VALUE_IS_NOT_AVAILABLE,
                MessagePriority.BLOCKING_PROBLEM));
      }
      JsValue jsValue = uiValue.getJsValue();
      JsObject jsObject = jsValue.asObject();
      if (jsObject == null) {
        return createErrorOptional(
            new Message(Messages.LogicImpl_NOT_FOR_PRIMITIVE, MessagePriority.BLOCKING_PROBLEM));
      }

      DebugContext debugContext = uiValue.getSuspendedState().getDebugContext();
      // Unsafe asynchronous check.
      if (uiValue.getSuspendedState().isDismissed()) {
        return createErrorOptional(
            new Message(Messages.LogicImpl_CONTEXT_DISMISSED, MessagePriority.BLOCKING_PROBLEM));
      }
      JsEvaluateContext globalEvaluateContext = debugContext.getGlobalEvaluateContext();

      return createOptional(new PreviewContext(globalEvaluateContext, jsObject));
    }
View Full Code Here


   * It may be not very accurate working as JavaScript lexer.
   */
  private static class DotSeparatedExpression extends DialogLogic.Expression {
    static Optional<DialogLogic.Expression> parse(String string) {
      if (string.length() == 0) {
        return createErrorOptional(new Message(Messages.LogicImpl_ENTER_EXPRESSION,
            MessagePriority.BLOCKING_PROBLEM));
      }

      List<String> parts = new ArrayList<String>();
      int pos = 0;
      while (true) {
        if (pos >= string.length() || string.charAt(pos) != '.') {
          return createErrorOptional(new Message(Messages.LogicImpl_DOT_EXPECTED,
              MessagePriority.BLOCKING_PROBLEM));
        }
        pos++;
        int partStartPos = pos;
        if (pos >= string.length()) {
          return createErrorOptional(
              new Message(Messages.LogicImpl_ENTER_AFTER_DOT, MessagePriority.BLOCKING_INFO));
        }
        if (!Character.isJavaIdentifierStart(string.codePointAt(pos))) {
          return createErrorOptional(new Message(Messages.LogicImpl_INVALID_COMPONENT_START,
              MessagePriority.BLOCKING_PROBLEM));
        }
        pos = string.offsetByCodePoints(pos, 1);
        while (pos < string.length() && string.charAt(pos) != '.') {
          if (!Character.isJavaIdentifierPart(string.codePointAt(pos))) {
            return createErrorOptional(new Message(Messages.LogicImpl_INVALID_COMPONENT_CHAR,
                MessagePriority.BLOCKING_PROBLEM));
          }
          pos = string.offsetByCodePoints(pos, 1);
        }
        parts.add(string.substring(partStartPos, pos));
View Full Code Here

TOP

Related Classes of org.chromium.debug.ui.DialogUtils.Message

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.