Search in sources :

Example 1 with Session

use of flash.tools.debugger.Session in project intellij-plugins by JetBrains.

the class ExpressionCache method appendVariableValue.

/**
	 * Given any arbitrary constant value, such as a Double, a String, etc.,
	 * format its value appropriately. For example, strings will be quoted.
	 *
	 * @param sb
	 *            a StringBuilder to which the formatted value will be appended.
	 * @param o
	 *            the value to format.
	 */
public static void appendVariableValue(StringBuilder sb, final Object o) {
    Value v;
    if (o instanceof Value) {
        v = (Value) o;
    } else {
        v = new Value() {

            public int getAttributes() {
                return 0;
            }

            public String[] getClassHierarchy(boolean allLevels) {
                return new String[0];
            }

            public String getClassName() {
                //$NON-NLS-1$
                return "";
            }

            public long getId() {
                return UNKNOWN_ID;
            }

            public int getMemberCount(Session s) throws NotSuspendedException, NoResponseException, NotConnectedException {
                return 0;
            }

            public Variable getMemberNamed(Session s, String name) throws NotSuspendedException, NoResponseException, NotConnectedException {
                return null;
            }

            public Variable[] getMembers(Session s) throws NotSuspendedException, NoResponseException, NotConnectedException {
                return new Variable[0];
            }

            public int getType() {
                if (o instanceof Number)
                    return VariableType.NUMBER;
                else if (o instanceof Boolean)
                    return VariableType.BOOLEAN;
                else if (o instanceof String)
                    return VariableType.STRING;
                else if (o == Value.UNDEFINED)
                    return VariableType.UNDEFINED;
                else if (o == null)
                    return VariableType.NULL;
                assert false;
                return VariableType.UNKNOWN;
            }

            public String getTypeName() {
                //$NON-NLS-1$
                return "";
            }

            public Object getValueAsObject() {
                return o;
            }

            public String getValueAsString() {
                return DValue.getValueAsString(o);
            }

            public boolean isAttributeSet(int variableAttribute) {
                return false;
            }

            public Variable[] getPrivateInheritedMembers() {
                return new Variable[0];
            }

            public Variable[] getPrivateInheritedMemberNamed(String name) {
                return new Variable[0];
            }
        };
    }
    appendVariableValue(sb, v);
}
Also used : Variable(flash.tools.debugger.Variable) NotConnectedException(flash.tools.debugger.NotConnectedException) Value(flash.tools.debugger.Value) DValue(flash.tools.debugger.concrete.DValue) NotSuspendedException(flash.tools.debugger.NotSuspendedException) NoResponseException(flash.tools.debugger.NoResponseException) Session(flash.tools.debugger.Session)

Example 2 with Session

use of flash.tools.debugger.Session in project intellij-plugins by JetBrains.

the class ExpressionCache method setSessionProperty.

/**
	 * Allow the session to receive property updates
	 */
void setSessionProperty(String s, int value) {
    Session sess = getSession();
    if (sess != null)
        sess.setPreference(s, value);
    Bootstrap.sessionManager().setPreference(s, value);
}
Also used : Session(flash.tools.debugger.Session)

Aggregations

Session (flash.tools.debugger.Session)2 NoResponseException (flash.tools.debugger.NoResponseException)1 NotConnectedException (flash.tools.debugger.NotConnectedException)1 NotSuspendedException (flash.tools.debugger.NotSuspendedException)1 Value (flash.tools.debugger.Value)1 Variable (flash.tools.debugger.Variable)1 DValue (flash.tools.debugger.concrete.DValue)1