if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// If a custom DataContent object has not been specified, get the default instance.
DataContent contentViewer = customContentViewer;
if (contentViewer == null) {
contentViewer = Lookup.getDefault().lookup(DataContent.class);
}
try {
if (contentViewer != null) {
Node[] selectedNodes = explorerManager.getSelectedNodes();
for (UpdateWrapper drv : viewers) {
drv.setSelectedNodes(selectedNodes);
}
// Passing null signals that either multiple nodes are selected, or no nodes are selected.
// This is important to the DataContent object, since the content mode (area) of the app is designed
// to show only the content underlying a single Node.
if (selectedNodes.length == 1) {
contentViewer.setNode(selectedNodes[0]);
}
else {
contentViewer.setNode(null);
}
}
} finally {
setCursor(null);
}