Task #1669

RCP: SWT, add a function to programmatically split an editor area

Added by Sebastien Jacquot almost 4 years ago. Updated 7 months ago.

Status:Resolved Start date:02/11/2016
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:UI / Editor Spent time: -
Target version:TXM 0.7.8

Description

Add a function to programmatically split an editor area, dedicated for example to:
  • open an edition below a concordance editor on double clicking on a table row
  • open a concordance below a progression on double clicking on a chart point
  • etc.

It's not possible to do that in Eclipse 3.x without simulate a fake drag and drop event.
It's possible to do that in 4.x using MPart but not EditorPart.

Solution 1

Simulate a fake drag and drop event and give it to org.eclipse.ui.internal.SplitHandler.

Solution 2

Use MPart, MPartStack, etc.
It's possible to get a MPart 4.x from an EditorPart 3.x using compatibility layer like this:

MPart part = (MPart) editor.getSite().getService(MPart.class);

Related issues

related to Feature #1708: RCP: X.X, split concordance editor when calling back to t... New 03/02/2016

History

#1 Updated by Sebastien Jacquot almost 4 years ago

  • Status changed from New to Resolved
  • % Done changed from 50 to 80

Solution 2 has been implemented.
It is used by the functionalities that synchronize Progression chart and Concordance and editor.
See: /org.txm.rcp/src/main/java/org/txm/rcpapplication/utils/SWTEditorsUtils.java

#2 Updated by Sebastien Jacquot 7 months ago

New location: /org.txm.rcp/src/main/java/org/txm/rcp/utils/SWTEditorsUtils.java

Also available in: Atom PDF