ISelection stackSelection = getSite().getPage().getSelection(IDebugUIConstants.ID_DEBUG_VIEW);
if (stackSelection instanceof IStructuredSelection) {
Object stack = ((IStructuredSelection) stackSelection).getFirstElement();
if (stack instanceof IJavaStackFrame) {
try {
IJavaObject stackObj = ((IJavaStackFrame) stack).getThis();
if (current.equals(stackObj)) {
return;
}
} catch (Throwable t) {
// do nothing
}
}
}
}
if (current == null && frame == null && variable == null) {
return;
}
if (current != null) {
try {
if ((frame != null && current.equals(frame.getThis()))
|| (variable != null && current.equals(variable.getValue()))) {
return;
}
} catch (Throwable t) {
// do nothing
}
}
if (current != null) {
fLastState = getViewerState();
fSelectionStates.put(current, fLastState);
}
if (frame != null) {
setDebugModel(frame.getModelIdentifier());
} else if (variable != null) {
setDebugModel(variable.getModelIdentifier());
}
showViewer();
Object input = null;
if (frame != null) {
try {
IJavaObject stackObj = frame.getThis();
if ((stackObj != null)
&& (stackObj.getJavaType() != null)
&& ("org.drools.reteoo.WorkingMemoryImpl".equals(
stackObj.getJavaType().getName()))) {
input = stackObj;
}
} catch (Throwable t) {
DroolsIDEPlugin.log(t);
}