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.
Difference between revisions of "Eclipse4/RCP/EAS/Workbench Services"
(→API Comparison) |
(→API Comparison) |
||
Line 35: | Line 35: | ||
<!-- ===================================================================== --> | <!-- ===================================================================== --> | ||
+ | <tr> | ||
<td colspan=2> | <td colspan=2> | ||
<h3>Activate a part</h3> | <h3>Activate a part</h3> | ||
</td> | </td> | ||
+ | </tr> | ||
+ | <tr> | ||
+ | <td style="background:#ebd3d2;">Eclipse 3.x</td> | ||
+ | <td style="background:#dbf1d2;">Eclipse 4.x</td> | ||
+ | </tr> | ||
<tr> | <tr> | ||
<td style="background:#ebd3d2;"> | <td style="background:#ebd3d2;"> | ||
Line 54: | Line 60: | ||
<!-- ===================================================================== --> | <!-- ===================================================================== --> | ||
+ | <tr> | ||
<td colspan=2> | <td colspan=2> | ||
<h3>Bring a part to the top of its stack</h3> | <h3>Bring a part to the top of its stack</h3> | ||
</td> | </td> | ||
− | + | </tr> | |
+ | <tr> | ||
+ | <td style="background:#ebd3d2;">Eclipse 3.x</td> | ||
+ | <td style="background:#dbf1d2;">Eclipse 4.x</td> | ||
+ | </tr> | ||
<tr> | <tr> | ||
<td style="background:#ebd3d2;"> | <td style="background:#ebd3d2;"> |
Revision as of 10:07, 12 April 2011
Contents
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); |