return filtered.toArray();
}
});
// create the dialog that allows the user to select the new
// position in the device hierarchy.
NodeSelectionDialog dialog = new NodeSelectionDialog(
displayArea.getShell(),
SELECT_DEVICE_MESSAGE,
context.getDeviceRepositoryAccessorManager().
getDeviceHierarchyDocument().getRootElement(),
filteringContentProvider,
new DeviceHierarchyLabelProvider());
// set the title for the dialog
dialog.setTitle(SELECT_DEVICE_TITLE);
// display the dialog
dialog.open();
// retrieve the selected device
Object[] result = dialog.getResult();
// if the result is null then the user pressed the cancel
// button. However, if it is non null then a selection will
// have been made and the result array should contain 1
// ODOMElement - the device that was selected.
if (result != null) {