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);
}
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);
}
Aggregations