How to get an instance of a part of a view in an Eclipse e4 application?

I am trying to get an instance of a part of a view in an Eclipse e4 application, but I cannot find the PlatformUI class. Is the name changed from Eclipse 3 or is it located in a different package?

+3
source share
2 answers

When viewing the Eclipse e4 Parts :

e4 parts

Mistakes such as 371405 can be instructive:

org.eclipse.ui.presentations

This API no longer works in 4.2, and we never intend to make it work.
This is not compatible with the plugin version of rendering in 4.2. Decisions that could be made using the extensions for the presentation, now refer to the renderer.

API, :

  • API: org.eclipse.ui.presentations
  • : org.eclipse.ui.presentationFactories
    org.eclipse.ui.IWorkbenchPreferenceConstants#PRESENTATION_FACTORY_ID
    org.eclipse.ui.IWorkbenchWindowConfigurer#getPresentationFactory
    org.eclipse.ui.IWorkbenchWindowConfigurer#setPresentationFactory

, "" ( )


OP August Karlstrom :

:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("‌​some view");

, PlatformUI, e4 Context. . .


( IBM Eclipse Platform):

Eclipse4 org.eclipse.e4.ui.workbench.modeling.EPartService.findPart(String) MPart .
MPart .

Workbench_Services :

e4 .
API- 3.x IPartService WorkbenchPage,


, , 372488 ( ):

An MPart MPartDescriptor EPartService.createPart(descriptor_id), descriptor_id MPartDescriptor.
EPartService.findPart(descriptor_id) - , .

, MPart MPartDescriptor.
: .

MPart MPartDescriptor, .
EPartService.findPart(descriptor_id) MPart, MPartDescriptor, .
, MPartDescriptor :

  • EPartService.findPart(id) , MPart.
  • MParts .
  • API- MPart "" "".

EPartService.getParts(), , , MPart s, , MPartDescriptor.
, MPart MPartDescriptor, "".

- , MPart MPartDescriptor "" "".

+8

. :

MPart mPart = epartService.findPart("MyPart");

MyPart myPart = (MyPart)mPart.getObject();

.

+2

All Articles