org.chromium.sdk/src/org/chromium/sdk/internal/JsVariableImpl.java
author Eugene Ostroukhov <eugeneo@symbian.org>
Mon, 07 Jun 2010 16:51:19 -0700
changeset 355 8726e95bcbba
parent 276 f2f4a1259de8
permissions -rw-r--r--
Initial commit of updated Chrome Java SDK
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     1
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     2
// Use of this source code is governed by a BSD-style license that can be
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     3
// found in the LICENSE file.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     4
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     5
package org.chromium.sdk.internal;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     6
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     7
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     8
import org.chromium.sdk.JsVariable;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
     9
import org.chromium.sdk.JsValue.Type;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    10
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    11
/**
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    12
 * A generic implementation of the JsVariable interface.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    13
 */
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    14
public class JsVariableImpl implements JsVariable {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    15
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    16
  /**
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    17
   * The variable value data as reported by the JavaScript VM (is used to
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    18
   * construct the variable value.)
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    19
   */
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    20
  private final ValueMirror valueData;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    21
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    22
  /** The context this variable belongs in. */
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    23
  private final InternalContext context;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    24
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    25
  /** The fully qualified name of this variable. */
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    26
  private final String qualifiedName;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    27
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    28
  /** The lazily constructed value of this variable. */
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    29
  private final JsValueImpl value;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    30
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    31
  /** Variable name. */
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    32
  private final Object rawName;
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    33
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    34
  /** Variable name. */
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    35
  private final String decoratedName;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    36
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    37
  /**
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    38
   * Constructs a variable contained in the given context with the given
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    39
   * value mirror.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    40
   *
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    41
   * @param context that owns this variable
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    42
   * @param valueData value data for this variable
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    43
   */
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    44
  JsVariableImpl(InternalContext context, ValueMirror valueData, String name) {
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    45
    this(context, valueData, name, name, name);
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    46
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    47
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    48
  /**
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    49
   * Constructs a variable contained in the given context with the given
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    50
   * value mirror.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    51
   *
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    52
   * @param context that owns this variable
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    53
   * @param valueData for this variable
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    54
   * @param qualifiedName the fully qualified name of this variable
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    55
   */
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    56
  JsVariableImpl(InternalContext context, ValueMirror valueData, Object rawName,
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    57
      String decoratedName, String qualifiedName) {
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
    58
    this.context = context;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    59
    this.valueData = valueData;
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    60
    this.rawName = rawName;
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    61
    this.decoratedName = decoratedName;
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    62
    this.qualifiedName = qualifiedName;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    63
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    64
    Type type = this.valueData.getType();
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    65
    switch (type) {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    66
      case TYPE_FUNCTION:
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    67
        this.value = new JsFunctionImpl(context, this.qualifiedName, this.valueData);
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    68
        break;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    69
      case TYPE_ERROR:
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    70
      case TYPE_OBJECT:
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    71
        this.value = new JsObjectImpl(context, this.qualifiedName, this.valueData);
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    72
        break;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    73
      case TYPE_ARRAY:
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    74
        this.value = new JsArrayImpl(context, this.qualifiedName, this.valueData);
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    75
        break;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    76
      default:
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    77
        this.value = new JsValueImpl(this.valueData);
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    78
    }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    79
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    80
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    81
  /**
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    82
   * @return a [probably compound] JsValue corresponding to this variable.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    83
   *         {@code null} if there was an error lazy-loading the value data.
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    84
   */
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    85
  public JsValueImpl getValue() {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    86
    return value;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    87
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    88
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    89
  public String getName() {
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    90
    return decoratedName;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    91
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    92
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    93
  public String getRawName() {
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    94
    return this.rawName.toString();
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    95
  }
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    96
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
    97
  Object getRawNameAsObject() {
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    98
    return this.rawName;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
    99
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   100
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   101
  public boolean isMutable() {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   102
    return false; // TODO(apavlov): fix once V8 supports it
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   103
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   104
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   105
  public boolean isReadable() {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   106
    // TODO(apavlov): implement once the readability metadata are available
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   107
    return true;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   108
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   109
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   110
  public synchronized void setValue(String newValue, SetValueCallback callback) {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   111
    // TODO(apavlov): currently V8 does not support it
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   112
    if (!isMutable()) {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   113
      throw new UnsupportedOperationException();
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   114
    }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   115
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   116
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   117
  @Override
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   118
  public String toString() {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   119
    return new StringBuilder()
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   120
        .append("[JsVariable: name=")
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   121
        .append(getName())
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   122
        .append(",value=")
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   123
        .append(getValue())
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   124
        .append(']')
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   125
        .toString();
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   126
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   127
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   128
  /**
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
   129
   * Returns the context owning this variable.
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   130
   */
52
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
   131
  protected InternalContext getInternalContext() {
f577ea64429e Migrated to unmodified Chromium Development Tools version
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 2
diff changeset
   132
    return context;
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   133
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   134
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   135
  public ValueMirror getMirror() {
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   136
    return valueData;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   137
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   138
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   139
  public String getFullyQualifiedName() {
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   140
    return qualifiedName != null
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   141
        ? qualifiedName
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   142
        : getName();
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   143
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   144
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   145
  static class NameDecorator {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   146
    static String decorateVarName(Object rawName) {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   147
      if (rawName instanceof Number) {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   148
        return OPEN_BRACKET + rawName + CLOSE_BRACKET;
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   149
      } else {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   150
        return rawName.toString();
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   151
      }
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   152
    }
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   153
    static String buildAccessSuffix(Object rawName) {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   154
      if (rawName instanceof Number) {
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   155
        return OPEN_BRACKET + rawName + CLOSE_BRACKET;
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   156
      } else {
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   157
        return "." + rawName;
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   158
      }
276
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   159
    }
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   160
    private static final String OPEN_BRACKET = "[";
f2f4a1259de8 Bug 2065 - Pull updated Chrome Developer Tools into the workspace
Eugene Ostroukhov <eugeneo@symbian.org>
parents: 52
diff changeset
   161
    private static final String CLOSE_BRACKET = "]";
2
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   162
  }
e4420d2515f1 Initial version of WRT Debugger.
TasneemS@US-TASNEEMS
parents:
diff changeset
   163
}