/** * Sets the part site. * <p> * Subclasses must invoke this method from <code>IEditorPart.init</code> * and <code>IViewPart.init</code>. * * @param site the workbench part site */ protected void setSite(IWorkbenchPartSite site) { checkSite(site); this.partSite = site; }
@Override protected final void checkSite(IWorkbenchPartSite site) { super.checkSite(site); Assert.isTrue(site instanceof IViewSite, "The site for a view must be an IViewSite"); //$NON-NLS-1$ } }
/** * Checks that the given site is valid for this type of part. * The site for an editor must be an <code>IEditorSite</code>. * * @param site the site to check * @since 3.1 */ @Override protected final void checkSite(IWorkbenchPartSite site) { super.checkSite(site); Assert.isTrue(site instanceof IEditorSite, "The site for an editor must be an IEditorSite"); //$NON-NLS-1$ }