Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Tile Editor horizontal/vertical programmatically(Tile Editor horizontal/vertical programmatically)
Tile Editor horizontal/vertical programmatically [message #871014] Thu, 10 May 2012 10:29 Go to next message
Omer Gillani is currently offline Omer Gillani
Messages: 22
Registered: May 2012
Junior Member

Hi,

Is there any way around to tile editor horizontal/vertical programmatically?

When we open new editor, it opens new tab for it. We can drag to set it vertically/horizontally. I want to arrage my editors horizontally/vertically programmatically.

Thanks,

-Omer Gillani
Re: Tile Editor horizontal/vertical programmatically [message #871026 is a reply to message #871014] Thu, 10 May 2012 10:47 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

In 3.x there's no programmatic access to splitting the editor area.

In 4.2 you could probably do it by manipulating the model, but you'd have to provide all of the correct layout/attributes.

PW


Re: Tile Editor horizontal/vertical programmatically [message #871186 is a reply to message #871026] Fri, 11 May 2012 06:37 Go to previous messageGo to next message
Omer Gillani is currently offline Omer Gillani
Messages: 22
Registered: May 2012
Junior Member

Thanks Paul.

We have 3.x and we are shifting it to 4.2. But model is not available to us so far. There are some important workflows that requires to layout editor area programmatically. Can you please guide me to do it anyway even by extending RCP API?
Re: Tile Editor horizontal/vertical programmatically [message #886594 is a reply to message #871186] Fri, 15 June 2012 04:45 Go to previous message
Alexander Haag is currently offline Alexander Haag
Messages: 114
Registered: July 2009
Senior Member
Hi Omar,

i did very much the same thing once in 3.2. Basicly i needed to place a subeditor below my main editor.

I am forcing a DnD-Event to do this (see code below). I copied some sources to do quick patch(see derivedSources.7z). This isn't quite a clean API-way to deal with, but it worked for over 4 years now.

Hope this will help you
Greets Alex


IEditorReference[] editorRefs = GuiHelper.getActivePage().getEditorReferences();
int idx = 0;
// get the editor instance by given id (pEditorId)
for (int i = 0; i < editorRefs.length; i++)
{
   IEditorReference editRef = editorRefs[i];
   if (editRef.getId().equals(pEditorId) && editRef.getEditor(false).equals(result))
   {
      idx = i;
      break;
   }
}
// create drag-and drop-source of editor
EditorDragSource editorDragSource = new EditorDragSource(idx, false);
EditorAreaDropTarget dropLocation = new EditorAreaDropTarget(editorDragSource, SWT.BOTTOM);
// force dnd of editor
editorDragSource.drag(dropLocation);
Previous Topic:Different splash screens
Next Topic:JFace TreeViewer Connected with PropertiesView
Goto Forum:
  


Current Time: Mon Apr 21 11:42:43 EDT 2014

Powered by FUDForum. Page generated in 0.01974 seconds