Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof ComponentNode)
{
ComponentNode component = (ComponentNode) obj;
GenericOpenFileAction openAction = new GenericOpenFileAction(component.getFile());
openAction.run();
}
else if (obj instanceof FunctionNode)
{
FunctionNode fnode = (FunctionNode) obj;
insert(fnode.getInvokeSnippet());