@Override protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); IFile file = (IFile) input.getAdapter(IFile.class); if (file != null) new ToggleNatureAction().addToBuildSpec((IProject) file.getProject()); }