Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Eclipse4/RCP/EAS/Workbench Services"

< Eclipse4‎ | RCP‎ | EAS
(New page: ==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 ...)
 
(API Comparison)
Line 39: Line 39:
 
<td style="background:#ebd3d2;">
 
<td style="background:#ebd3d2;">
 
<source lang="java">
 
<source lang="java">
// activate the 'Project Explorer' part
+
// activate the 'Project Explorer' view
 
workbenchPage.activate(projectExplorerPart);
 
workbenchPage.activate(projectExplorerPart);
 
</source>
 
</source>
Line 59: Line 59:
 
<td style="background:#ebd3d2;">
 
<td style="background:#ebd3d2;">
 
<source lang="java">
 
<source lang="java">
// bring the 'Project Explorer' part to the top of its stack
+
// bring the 'Project Explorer' view to the top of its stack
 
workbenchPage.bringToTop(projectExplorerPart);
 
workbenchPage.bringToTop(projectExplorerPart);
 
</source>
 
</source>

Revision as of 10:06, 12 April 2011

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

// 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

// 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