Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Eclipse4/RCP/EAS/Workbench Services

< Eclipse4‎ | RCP‎ | EAS
Revision as of 10:07, 12 April 2011 by Remysuen.ca.ibm.com (Talk | contribs) (API Comparison)

Part Service

In order to allow clients to easily work with the modeled workbench, there needs to be some convenience APIs present for them to perform simple operations like "show part X", "activate part Y", or "bring part Z to the top of its stack".

API Comparison

In 3.x, there is IPartService and IWorkbenchPage, with IWorkbenchPage extending IPartService. Together, these two interfaces defines the general operations that clients often want to do.

In Eclipse 4, the notion of a workbench page is not present. The part service API is basically a merge of the existing 3.x IPartService and IWorkbenchPage interfaces.

Show a view

Eclipse 3.x Eclipse 4.x
// show the 'Project Explorer' view
workbenchPage.showView(IPageLayout.PROJECT_EXPLORER);
// show the 'Project Explorer' view
partService.showView(IPageLayout.PROJECT_EXPLORER);

Activate a part

Eclipse 3.x Eclipse 4.x
// activate the 'Project Explorer' view
workbenchPage.activate(projectExplorerPart);
// activate the 'Project Explorer' part
partService.activate(projectExplorerPart);

Bring a part to the top of its stack

Eclipse 3.x Eclipse 4.x
// bring the 'Project Explorer' view to the top of its stack
workbenchPage.bringToTop(projectExplorerPart);
// bring the 'Project Explorer' part to the top of its stack
partService.bringToTop(projectExplorerPart);

Back to the top