Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Open multiple files with an editor plug-in
Open multiple files with an editor plug-in [message #289563] Mon, 08 August 2005 07:33 Go to next message
Eclipse UserFriend
Originally posted by: annagaspar.gmail.com

Hello,
I'd like to make an editor that could open multiple files at the same time.
I don't know how to make that, because an editor is associated with only
one IEditorInput, so one editor only can modify one file.

Thanks,
Ana
Re: Open multiple files with an editor plug-in [message #289574 is a reply to message #289563] Mon, 08 August 2005 09:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ana Gaspar" <annagaspar@gmail.com> wrote in message
news:dd7fur$9d8$1@news.eclipse.org...
> Hello,
> I'd like to make an editor that could open multiple files at the same
> time.
> I don't know how to make that, because an editor is associated with only
> one IEditorInput, so one editor only can modify one file.
>
> Thanks,
> Ana

org.eclipse.ui.part.MultiEditor
---
Sunil
Re: Open multiple files with an editor plug-in [message #289599 is a reply to message #289574] Mon, 08 August 2005 12:46 Go to previous messageGo to next message
Eclipse UserFriend
Sunil Kamath wrote:
> "Ana Gaspar" <annagaspar@gmail.com> wrote in message
> news:dd7fur$9d8$1@news.eclipse.org...
>
>>Hello,
>>I'd like to make an editor that could open multiple files at the same
>>time.
>>I don't know how to make that, because an editor is associated with only
>>one IEditorInput, so one editor only can modify one file.
>>
>>Thanks,
>>Ana
>
>
> org.eclipse.ui.part.MultiEditor
> ---
> Sunil
>
>

Better to use org.eclipse.ui.part.MultiPageEditorPart ... if you create
a new plugin project and use the multi-editor template, you'll even get
an example.

Later,
PW
Re: Open multiple files with an editor plug-in [message #289607 is a reply to message #289599] Mon, 08 August 2005 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Paul Webster" <pwebster@ca.ibm.com> wrote in message
news:dd829b$3mt$1@news.eclipse.org...
> Sunil Kamath wrote:
>> "Ana Gaspar" <annagaspar@gmail.com> wrote in message
>> news:dd7fur$9d8$1@news.eclipse.org...
>>
>>>Hello,
>>>I'd like to make an editor that could open multiple files at the same
>>>time.
>>>I don't know how to make that, because an editor is associated with only
>>>one IEditorInput, so one editor only can modify one file.
>>>
>>>Thanks,
>>>Ana
>>
>>
>> org.eclipse.ui.part.MultiEditor
>> ---
>> Sunil
>
> Better to use org.eclipse.ui.part.MultiPageEditorPart ... if you create a
> new plugin project and use the multi-editor template, you'll even get an
> example.
>
AFAIK, the MultiPageEditorPart is for editing one file in multiple pages.
MultiEditor, OTOH, is for editing multiple files, each on a single page.
MultiEditorInput contains arrays of editor ids and editor inputs.
---
Sunil
Re: Open multiple files with an editor plug-in [message #289614 is a reply to message #289607] Tue, 09 August 2005 03:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: annagaspar.gmail.com

Sunil Kamath wrote:
> "Paul Webster" <pwebster@ca.ibm.com> wrote in message
> news:dd829b$3mt$1@news.eclipse.org...
>
>>Sunil Kamath wrote:
>>
>>>"Ana Gaspar" <annagaspar@gmail.com> wrote in message
>>>news:dd7fur$9d8$1@news.eclipse.org...
>>>
>>>
>>>>Hello,
>>>>I'd like to make an editor that could open multiple files at the same
>>>>time.
>>>>I don't know how to make that, because an editor is associated with only
>>>>one IEditorInput, so one editor only can modify one file.
>>>>
>>>>Thanks,
>>>>Ana
>>>
>>>
>>>org.eclipse.ui.part.MultiEditor
>>>---
>>>Sunil
>>
>>Better to use org.eclipse.ui.part.MultiPageEditorPart ... if you create a
>>new plugin project and use the multi-editor template, you'll even get an
>>example.
>>
>
> AFAIK, the MultiPageEditorPart is for editing one file in multiple pages.
> MultiEditor, OTOH, is for editing multiple files, each on a single page.
> MultiEditorInput contains arrays of editor ids and editor inputs.
> ---
> Sunil
>
>
Well thanks to all, i wish have an example of MultiEditor plug-in, any
know where can I get one?
Re: Open multiple files with an editor plug-in [message #289623 is a reply to message #289614] Tue, 09 August 2005 07:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ana Gaspar" <annagaspar@gmail.com> wrote in message
news:dd9k9v$qf6$1@news.eclipse.org...
[snip]
>>
> Well thanks to all, i wish have an example of MultiEditor plug-in, any
> know where can I get one?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=42641
The bad news is that when the editor lifecycle was reworked for 3.1, they
broke MultiEditor.
So you have to wait until 3.1.1 or 3.2 before it gets fixed.
---
Sunil
Re: Open multiple files with an editor plug-in [message #289629 is a reply to message #289623] Tue, 09 August 2005 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: annagaspar.gmail.com

Sunil Kamath wrote:
> "Ana Gaspar" <annagaspar@gmail.com> wrote in message
> news:dd9k9v$qf6$1@news.eclipse.org...
> [snip]
>
>>Well thanks to all, i wish have an example of MultiEditor plug-in, any
>>know where can I get one?
>
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=42641
> The bad news is that when the editor lifecycle was reworked for 3.1, they
> broke MultiEditor.
> So you have to wait until 3.1.1 or 3.2 before it gets fixed.
> ---
> Sunil
>
>
Then, is impossible to make an plugin application to manage differents
files?
I'm trying to make an editor plugin whose funcionality is similar to
XMLSpy, where you can open different files at time.

Ana
Re: Open multiple files with an editor plug-in [message #289631 is a reply to message #289607] Tue, 09 August 2005 09:22 Go to previous messageGo to next message
Eclipse UserFriend
Sunil Kamath wrote:
> "Paul Webster" <pwebster@ca.ibm.com> wrote in message
> news:dd829b$3mt$1@news.eclipse.org...
>
>>Better to use org.eclipse.ui.part.MultiPageEditorPart ... if you create a
>>new plugin project and use the multi-editor template, you'll even get an
>>example.
>>
>
> AFAIK, the MultiPageEditorPart is for editing one file in multiple pages.
> MultiEditor, OTOH, is for editing multiple files, each on a single page.
> MultiEditorInput contains arrays of editor ids and editor inputs.
> ---
> Sunil

I think for the most part you need to use a specific action to open a
MultiEditor ... I don't see why that wouldn't work with handing a
MultiEditorInput to a MultiPageEditorPart.

Then your createPages() could get your EditorInput, check to see if it's
a MultiEditorInput, and extract the inner editor IDs and editor inputs,
and then use MultiPageEditorPart#addPage(IEditorPart editor,
IEditorInput input).

You would have to instantiate the EditorParts yourself, but there must
be a way to get from the ID to the IEditorPart ... maybe using
executable extensions?

MultiEditor is much better if you want to show 2 editors side by side,
like the TiledEditor example from the bug report you mentioned.
MultiPageEditorPart can open the multiple editors, but in a CTabFolder.


Later,
PW
Re: Open multiple files with an editor plug-in [message #289632 is a reply to message #289629] Tue, 09 August 2005 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"Ana Gaspar" <annagaspar@gmail.com> wrote in message
news:dda98b$l3c$1@news.eclipse.org...
> Sunil Kamath wrote:
>> "Ana Gaspar" <annagaspar@gmail.com> wrote in message
>> news:dd9k9v$qf6$1@news.eclipse.org...
>> [snip]
>>
>>>Well thanks to all, i wish have an example of MultiEditor plug-in, any
>>>know where can I get one?
>>
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=42641
>> The bad news is that when the editor lifecycle was reworked for 3.1, they
>> broke MultiEditor.
>> So you have to wait until 3.1.1 or 3.2 before it gets fixed.
>> ---
>> Sunil
> Then, is impossible to make an plugin application to manage differents
> files?
> I'm trying to make an editor plugin whose funcionality is similar to
> XMLSpy, where you can open different files at time.
>
You could probably try faking it with MultiPageEditor.
Create a custom action to open the MultiPageEditor:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().openEditor(editorInput,editorId);

However, instead of the regular IFileEditorInput, create a MultiEditorInput
instead.
Then, within your editor setInput, when you create the pages, take the array
of editor inputs from the MultiEditorInput and use that to create each page.
---
Sunil
Re: Open multiple files with an editor plug-in [message #289721 is a reply to message #289631] Wed, 10 August 2005 05:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: annagaspar.gmail.com

Paul Webster wrote:
> Sunil Kamath wrote:
>
>> "Paul Webster" <pwebster@ca.ibm.com> wrote in message
>> news:dd829b$3mt$1@news.eclipse.org...
>>
>>> Better to use org.eclipse.ui.part.MultiPageEditorPart ... if you
>>> create a new plugin project and use the multi-editor template, you'll
>>> even get an example.
>>>
>>
>> AFAIK, the MultiPageEditorPart is for editing one file in multiple pages.
>> MultiEditor, OTOH, is for editing multiple files, each on a single page.
>> MultiEditorInput contains arrays of editor ids and editor inputs.
>> ---
>> Sunil
>
>
> I think for the most part you need to use a specific action to open a
> MultiEditor ... I don't see why that wouldn't work with handing a
> MultiEditorInput to a MultiPageEditorPart.
>
> Then your createPages() could get your EditorInput, check to see if it's
> a MultiEditorInput, and extract the inner editor IDs and editor inputs,
> and then use MultiPageEditorPart#addPage(IEditorPart editor,
> IEditorInput input).
>
> You would have to instantiate the EditorParts yourself, but there must
> be a way to get from the ID to the IEditorPart ... maybe using
> executable extensions?
>
> MultiEditor is much better if you want to show 2 editors side by side,
> like the TiledEditor example from the bug report you mentioned.
> MultiPageEditorPart can open the multiple editors, but in a CTabFolder.
>
>
> Later,
> PW

Ok, I create each page with different IEditorInput and IEditorPart,but
now my problem is how to obtain the differents IEditorInput to create
the MultiEditorInput?
Re: Open multiple files with an editor plug-in [message #289727 is a reply to message #289631] Wed, 10 August 2005 07:41 Go to previous message
Eclipse UserFriend
Ana Gaspar wrote:
>
> Ok, I create each page with different IEditorInput and IEditorPart,but
> now my problem is how to obtain the differents IEditorInput to create
> the MultiEditorInput?

You need to create your own action delegate. Check out the bug that
Sunil suggested earlier ... the tiled editor example has an
OpenActionDelegate that can create a MultiEditorInput for the files
selected in the package explorer.

Later,
PW
Previous Topic:Looking for better search
Next Topic:How to add a menu item
Goto Forum:
  


Current Time: Wed Nov 05 16:32:12 EST 2025

Powered by FUDForum. Page generated in 0.04893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top