Do not assume getSelectedPage() returns IEditorPart

Add check that selected page is actually an IEditorPart to avoid classcast exception
Merge pull request #26 from maxandersen/patch-1

Do not assume getSelectedPage() returns IEditorPart