Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to force editor to foreground?
How to force editor to foreground? [message #499103] Thu, 19 November 2009 15:45 Go to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

Hi,
In my app, when a user clicks a resource in the common nav, the resource
is opened in an editor. Normal stuff. But if the resource clicked is
already open in an editor, I would like that editor to pop on top of the
editor stack. How can I do that programmatically?
Thanks, y
Re: How to force editor to foreground? [message #499110 is a reply to message #499103] Thu, 19 November 2009 16:44 Go to previous messageGo to next message
Aurelien Pupier is currently offline Aurelien Pupier
Messages: 551
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

do you mean that you want if the editor come open with the tab at the top left?

You can set an IPartListener2 to listen when editor opened or is broughttotop and you will need to set the tab of your editor where you want in one of these methods but I don't know how.

Hope that it will show you the way ^^

regards,

Aurelien Pupier


Aurélien Pupier - BonitaSoft S.A.
My blog
My company Eclipse-related blog
Re: How to force editor to foreground? [message #499147 is a reply to message #499110] Fri, 20 November 2009 01:50 Go to previous messageGo to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

Thanks but not quite what I am looking for.
I would like to make an editor the active editor (ie, more than one
editor is currently open).
Thanks,y

Aurelien Pupier wrote:
> Hi,
>
> do you mean that you want if the editor come open with the tab at the
> top left?
>
> You can set an IPartListener2 to listen when editor opened or is
> broughttotop and you will need to set the tab of your editor where you
> want in one of these methods but I don't know how.
>
> Hope that it will show you the way ^^
>
> regards,
>
> Aurelien Pupier
Re: How to force editor to foreground? [message #499213 is a reply to message #499147] Fri, 20 November 2009 07:53 Go to previous messageGo to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

Found it:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().bringToTop(part);

Yodude wrote:
> Thanks but not quite what I am looking for.
> I would like to make an editor the active editor (ie, more than one
> editor is currently open).
> Thanks,y
>
> Aurelien Pupier wrote:
>> Hi,
>>
>> do you mean that you want if the editor come open with the tab at the
>> top left?
>>
>> You can set an IPartListener2 to listen when editor opened or is
>> broughttotop and you will need to set the tab of your editor where you
>> want in one of these methods but I don't know how.
>>
>> Hope that it will show you the way ^^
>>
>> regards,
>>
>> Aurelien Pupier
Re: How to force editor to foreground? [message #499307 is a reply to message #499103] Fri, 20 November 2009 13:08 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6850
Registered: July 2009
Location: Ottawa
Senior Member

Double-clicking on an editor and having it activated (instead of opened) is default behaviour. Are you saying that's not working for you?

org.eclipse.ui.ide.IDE.openEditor(IWorkbenchPage, IFile, boolean) will open an editor against an IFile (and activate the existing editor if already open against that IFile).

PW


Previous Topic:Remove view name from Eclipse menu Window -> Show View
Next Topic:Unable to contribute to editor menus using org.eclipse.ui.menus
Goto Forum:
  


Current Time: Sat Apr 19 00:44:52 EDT 2014

Powered by FUDForum. Page generated in 0.03157 seconds