// Get the selection
IStructuredSelection selection = (IStructuredSelection) view
.getViewer().getSelection();
if (selection != null && selection instanceof IStructuredSelection) {
Collection obj = (Collection) selection.getFirstElement();
// If we had a selection lets open the editor
if (obj != null) {
CollectionEditorInput input = new CollectionEditorInput(obj);
try {
page.openEditor(input, CollectionEditor.ID);