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
(API Comparison)
(API Comparison)
Line 10: Line 10:
  
 
<!-- ===================================================================== -->
 
<!-- ===================================================================== -->
 +
<tr>
 
<td colspan=2>
 
<td colspan=2>
 
<h3>Show a view</h3>
 
<h3>Show a view</h3>
 
</td>
 
</td>
 +
</tr>
 
<tr>
 
<tr>
 
     <td style="background:#ebd3d2;">Eclipse 3.x</td>
 
     <td style="background:#ebd3d2;">Eclipse 3.x</td>

Revision as of 10:07, 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