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

Difference between revisions of "E4/EAS/Part Service"

< E4‎ | EAS
m (e4 (Java))
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{caution|This page has been superseded.|See [[Eclipse4/RCP/EAS/Workbench Services|Workbench Services]] for updated information.}}
 +
 
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".
 
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".
  
Line 29: Line 31:
  
 
*Since ids can be modified by the client, how should the part lookup algorithm look like? What will be returned by methods like findPart(String)?
 
*Since ids can be modified by the client, how should the part lookup algorithm look like? What will be returned by methods like findPart(String)?
 +
 +
===Show view===
 +
<source lang="java">
 +
// show the 'Project Explorer' view
 +
partService.showView(IPageLayout.PROJECT_EXPLORER);
 +
</source>
 +
 +
===Activate a part===
 +
<source lang="java">
 +
// activate the 'Project Explorer' part
 +
partService.activate(projectExplorerPart);
 +
</source>
 +
 +
===Bring a part to the top of its stack===
 +
<source lang="java">
 +
// bring the 'Project Explorer' part to the top of its stack
 +
partService.bringToTop(projectExplorerPart);

Latest revision as of 10:10, 12 April 2011

Stop.png
This page has been superseded.
See Workbench Services for updated information.


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".

Eclipse 3.x API

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.

Show view

// show the 'Project Explorer' view
workbenchPage.showView(IPageLayout.PROJECT_EXPLORER);

Activate a part

// activate the 'Project Explorer' part
workbenchPage.activate(projectExplorerPart);

Bring a part to the top of its stack

// bring the 'Project Explorer' part to the top of its stack
workbenchPage.bringToTop(projectExplorerPart);

e4 (Java)

In e4, the notion of a workbench page will not be present. The part service API will essentially be a merge of the existing 3.x IPartService and IWorkbenchPage interfaces.

Open questions

  • Should the API work with part ids or should they work with physical MPart model objects? There is no requirement at the moment that mandates that parts need an id. On the other hand, it is questionable how a client will get a hold of an MPart that is hidden and that they wish to show.
  • Since ids can be modified by the client, how should the part lookup algorithm look like? What will be returned by methods like findPart(String)?

Show view

// show the 'Project Explorer' view
partService.showView(IPageLayout.PROJECT_EXPLORER);

Activate a part

// activate the 'Project Explorer' part
partService.activate(projectExplorerPart);

Bring a part to the top of its stack

// bring the 'Project Explorer' part to the top of its stack
partService.bringToTop(projectExplorerPart);

Back to the top