protected void populateDetailPaneFromSelection(
IStructuredSelection selection) {
try {
getDetailDocument().set("");
if (!selection.isEmpty()) {
IValue val = null;
Object obj = selection.getFirstElement();
if (obj instanceof IVariable) {
val = ((IVariable) obj).getValue();
} else if (obj instanceof IExpression) {
val = ((IExpression) obj).getValue();
}
if (val == null) {
return;
}
if (fValueSelection != null && fValueSelection.equals(selection)) {
return;
}
setDebugModel(val.getModelIdentifier());
fValueSelection = selection;
fSelectionIterator = selection.iterator();
fSelectionIterator.next();
fLastValueDetail = val;
getModelPresentation().computeDetail(val, this);