/* (non-Javadoc) * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento) */ public void init(IViewSite site, IMemento memento) throws PartInitException { super.init(site); Workbench workbench = (Workbench) site.getWorkbenchWindow().getWorkbench(); try { introPart = workbench.getWorkbenchIntroManager().createNewIntroPart(); // reset the part name of this view to be that of the intro title setPartName(introPart.getTitle()); introPart.addPropertyListener( new IPropertyListener() { public void propertyChanged(Object source, int propId) { firePropertyChange(propId); } }); introSite = new ViewIntroAdapterSite(site, workbench.getIntroDescriptor()); introPart.init(introSite, memento); } catch (CoreException e) { WorkbenchPlugin.log( IntroMessages.Intro_could_not_create_proxy, new Status( IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e)); } }
/* (non-Javadoc) * @see org.eclipse.ui.part.WorkbenchPart#getTitle() */ public String getTitle() { // this method is called eagerly before our init method is called (and // therefore before our intropart is created). By default return // the view title from the view declaration. We will fire a property // change to set the title to the proper value in the init method. return introPart == null ? super.getTitle() : introPart.getTitle(); }
/* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) */ public void createPartControl(Composite parent) { addPaneListener(); introPart.createPartControl(parent); }
/* (non-Javadoc) * @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento) */ public void saveState(IMemento memento) { introPart.saveState(memento); }
/* * (non-Javadoc) * * @see org.eclipse.ui.IWorkbenchPart#setFocus() */ public void setFocus() { introPart.setFocus(); }
/* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPart#getTitleImage() */ public Image getTitleImage() { return introPart.getTitleImage(); }
/* (non-Javadoc) * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { return introPart.getAdapter(adapter); }
/* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchPart#dispose() */ public void dispose() { setBarVisibility(true); super.dispose(); getSite().getWorkbenchWindow().getWorkbench().getIntroManager().closeIntro(introPart); introPart.dispose(); }