Examples of IVariable


Examples of org.eclipse.debug.core.model.IVariable

                    List variables = new ArrayList();
                    variables.add(new VariableWrapper("ruleName", (IJavaValue) DebugUtil.getValueByExpression("return getRule().getName();", activation)));
                    String activationId = null;
                    IVariable[] activationVarArray = activation.getVariables();
                    for (int j = 0; j < activationVarArray.length; j++) {
                        IVariable activationVar = activationVarArray[j];
                        if ("activationNumber".equals(activationVar.getName())) {
                            activationId = activationVar.getValue().getValueString();
                            break;
                        }
                    }
                    if (activationId != null) {
                        IValue objects = DebugUtil.getValueByExpression("return getActivationParameters(" + activationId + ");", workingMemoryImpl);
                        if (objects instanceof IJavaArray) {
                            IJavaArray array = (IJavaArray) objects;
                            IJavaValue[] javaVals = array.getValues();
                            for ( int k = 0; k < javaVals.length; k++ ) {
                                IJavaValue mapEntry = javaVals[k];
                                String key = null;
                                IJavaValue value = null;

                                IVariable[] vars = mapEntry.getVariables();
                                for ( int j = 0; j < vars.length; j++ ) {
                                    IVariable var = vars[j];
                                    if ("key".equals(var.getName())) {
                                        key = var.getValue().getValueString();
                                    } else if ("value".equals(var.getName())) {
                                        value = (IJavaValue) var.getValue();
                                    }
                                }
                                variables.add(new VariableWrapper(key, value));
                            }
                        }
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

            for ( int i = 0; i < javaVals.length; i++ ) {
                IJavaValue processInstance = javaVals[i];
                String id = null;
                IVariable[] vars = processInstance.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("id".equals(var.getName())) {
                        id = var.getValue().getValueString();
                    }
                }
                result.add(new VariableWrapper("[" + id + "]", processInstance));
            }
            return result.toArray(new IVariable[result.size()]);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

                String key = null;
                IJavaValue value = null;
               
                IVariable[] vars = mapEntry.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("key".equals(var.getName())) {
                        key = var.getValue().getValueString();
                    } else if ("value".equals(var.getName())) {
                        value = (IJavaValue) var.getValue();
                    }
                }
                result.add(new VariableWrapper(key, value));
            }
            return (IVariable[]) result.toArray(new IVariable[result.size()]);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

    protected void setViewerInput(Object context) {
        Object input = null;

        // if a working memory has been explicitly selected as variable, use this
        if (context instanceof IVariable) {
            IVariable variable = (IVariable) context;
            try {
                IValue value = ((IVariable) context).getValue();
                if (value != null && value instanceof IJavaObject) {
                    if ("org.drools.core.common.AbstartWorkingMemory".equals(variable.getValue().getReferenceTypeName()) ||
                      "org.drools.core.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName()) ||
                        // for backwards compatibility
                        "org.drools.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName())) {
                        input = value;
                    } else if ("org.drools.core.impl.StatefulKnowledgeSessionImpl".equals(variable.getValue().getReferenceTypeName())
                        || "org.drools.impl.StatefulKnowledgeSessionImpl".equals(variable.getValue().getReferenceTypeName())) {
                        IJavaFieldVariable sessionVar = ((IJavaObject) value).getField("session", false);
                        if (sessionVar != null) {
                            input = sessionVar.getValue();
                        }
                    }
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

            presentation.removeListener(listener);
        }

        public Color getForeground(Object element) {
            if (element instanceof IVariable) {
                IVariable variable = (IVariable) element;
                try {
                    if (variable.hasValueChanged()) {
                        return JFaceResources.getColorRegistry()
                            .get(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR);
                    }
                } catch (DebugException e) {
                    DroolsEclipsePlugin.log(e);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

                String key = null;
                IJavaValue value = null;
               
                IVariable[] vars = mapEntry.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("key".equals(var.getName())) {
                        key = var.getValue().getValueString();
                    } else if ("value".equals(var.getName())) {
                        value = (IJavaValue) var.getValue();
                    }
                }
                result.add(new VariableWrapper(key, value));
            }
            return result.toArray(new IVariable[result.size()]);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

            for ( int i = 0; i < javaVals.length; i++ ) {
                IJavaValue processInstance = javaVals[i];
                String id = null;
                IVariable[] vars = processInstance.getVariables();
                for ( int j = 0; j < vars.length; j++ ) {
                    IVariable var = vars[j];
                    if ("id".equals(var.getName())) {
                        id = var.getValue().getValueString();
                    }
                }
                result.add(new VariableWrapper("[" + id + "]", processInstance));
            }
            return result.toArray(new IVariable[result.size()]);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

    protected void setViewerInput(Object context) {
        Object input = null;

        // if a working memory has been explicitly selected as variable, use this
        if (context instanceof IVariable) {
            IVariable variable = (IVariable) context;
            try {
                IValue value = ((IVariable) context).getValue();
                if (value != null && value instanceof IJavaObject) {
                    if ("org.drools.core.common.AbstartWorkingMemory".equals(variable.getValue().getReferenceTypeName()) ||
                      "org.drools.core.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName()) ||
                        // for backwards compatibility
                        "org.drools.reteoo.ReteooStatefulSession".equals(variable.getValue().getReferenceTypeName())) {
                        input = value;
                    } else if ("org.drools.core.impl.StatefulKnowledgeSessionImpl".equals(variable.getValue().getReferenceTypeName())
                        || "org.drools.impl.StatefulKnowledgeSessionImpl".equals(variable.getValue().getReferenceTypeName())) {
                        IJavaFieldVariable sessionVar = ((IJavaObject) value).getField("session", false);
                        if (sessionVar != null) {
                            input = sessionVar.getValue();
                        } else {
                          input = variable.getValue();
                        }
                    }
                }
            } catch (Throwable t) {
                DroolsEclipsePlugin.log(t);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

            presentation.removeListener(listener);
        }

        public Color getForeground(Object element) {
            if (element instanceof IVariable) {
                IVariable variable = (IVariable) element;
                try {
                    if (variable.hasValueChanged()) {
                        return JFaceResources.getColorRegistry()
                            .get(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR);
                    }
                } catch (DebugException e) {
                    DroolsEclipsePlugin.log(e);
View Full Code Here

Examples of org.eclipse.debug.core.model.IVariable

        IJavaValue[] javaValues = ruleParameters.getValues();
        for ( int j = 0; j < javaValues.length; j++ ) {
            IJavaValue declaration = javaValues[j];
            IVariable[] vars = declaration.getVariables();
            for ( int k = 0; k < vars.length; k++ ) {
                IVariable declarationVar = vars[k];
                if ("identifier".equals(declarationVar.getName())) {
                    String paramName = declarationVar.getValue().getValueString();
                    IJavaValue varValue = (IJavaValue) DebugUtil.getValueByExpression("return getRule().getDeclaration(\"" + paramName + "\").getValue(((org.drools.core.common.InternalFactHandle) getTuple().get(getRule().getDeclaration(\"" + paramName + "\"))).getObject());", value);
                    if (varValue != null) {
                        variables.add(new VariableWrapper(paramName, varValue));
                    }
                    break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.