Package org.netbeans.api.debugger.jpda

Examples of org.netbeans.api.debugger.jpda.Variable


        if (d == null) return;
        JPDAThread t = d.getCurrentThread();
        if (t == null || !t.isSuspended()) return ;
        String toolTipText = null;
        try {
            Variable v = null;
            List<Operation> operations = t.getLastOperations();
            if (operations != null) {
                for (Operation operation: operations) {
                    if (!expression.endsWith(operation.getMethodName())) {
                        continue;
                    }
                    if (operation.getMethodStartPosition().getOffset() <= offset &&
                        offset <= operation.getMethodEndPosition().getOffset()) {
                        v = operation.getReturnValue();
                    }
                }
            }
            if (v == null) {
                v = d.evaluate (expression);
            }
            String type = v.getType ();
            if (v instanceof ObjectVariable)
                try {
                    String toString = null;
                    try {
                        java.lang.reflect.Method toStringMethod =
                                v.getClass().getMethod("getToStringValue"// NOI18N
                                                       new Class[] { Integer.TYPE });
                        toStringMethod.setAccessible(true);
                        toString = (String) toStringMethod.invoke(v, TO_STRING_LENGTH_LIMIT);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                    if (toString == null) {
                        toString = ((ObjectVariable) v).getToStringValue();
                    }
                    toolTipText = expression + " = " +
                        (type.length () == 0 ?
                            "" :
                            "(" + type + ") ") +
                        toString;
                } catch (InvalidExpressionException ex) {
                    toolTipText = expression + " = " +
                        (type.length () == 0 ?
                            "" :
                            "(" + type + ") ") +
                        v.getValue ();
                }
            else
                toolTipText = expression + " = " +
                    (type.length () == 0 ?
                        "" :
                        "(" + type + ") ") +
                    v.getValue ();
        } catch (InvalidExpressionException e) {
            toolTipText = expression + " = >" + e.getMessage () + "<";
        }
        firePropertyChange (PROP_SHORT_DESCRIPTION, null, toolTipText);
    }
View Full Code Here


               
                if (reqAttributes == null) return false;
               
                boolean ret = false;
                try {
                    Variable hasMoreElements = reqAttributes.invokeMethod(
                            "hasMoreElements",
                            "()Z",
                            new Variable[0]
                    );
                    ret = (hasMoreElements != null && "true".equals(hasMoreElements.getValue()));
                }
                catch (InvalidExpressionException e) {
                }
                catch (NoSuchMethodException e) {
                }
View Full Code Here

            public Object next() {

                Object nextElement = null;
                try {
                    Variable attributeName = reqAttributes.invokeMethod(
                            "nextElement",
                            "()Ljava/lang/Object;",
                            new Variable[0]
                    );
                    // object collected or vm disconnected if null
                    if (attributeName != null) {
                        Variable attributeValue = owner.invokeMethod(
                                "getAttribute",
                                "(Ljava/lang/String;)Ljava/lang/Object;",
                                new Variable[] { attributeName }
                        );
                        nextElement = new AttributeMap.Attribute(
View Full Code Here

                tltAttributes = "TLT_APPLICATION_ATTRIBUTES";
           
            sd = NbBundle.getMessage(ClojureVariablesFilter.class, "TLT_REQUEST_ATTRIBUTES");
        }
        else if (node instanceof AttributeMap.Attribute) {
            Variable attributeValue = ((AttributeMap.Attribute)node).getValue();
            String type = attributeValue.getType ();
            try {
                String stringValue = attributeValue.getValue();
                if (attributeValue instanceof ObjectVariable)
                    stringValue = ((ObjectVariable)attributeValue).getToStringValue();
                sd = "(" + type + ") " + stringValue;
            } catch (InvalidExpressionException iee) {
                sd = iee.getLocalizedMessage();
View Full Code Here

        if (node instanceof ImplicitLocals)
            il = false;
        else if (node instanceof AttributeMap)
            il = false;
        else if (node instanceof AttributeMap.Attribute) {
            Variable attributeValue = ((AttributeMap.Attribute)node).getValue();
            if (isLeafType(attributeValue.getType()))
                il = true;
            else
                il = original.isLeaf(attributeValue);
        }
        else
View Full Code Here

TOP

Related Classes of org.netbeans.api.debugger.jpda.Variable

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.