Skip to main content


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 20:45 Go to next message
Eclipse UserFriend
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 21:44 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
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 - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: How to force editor to foreground? [message #499147 is a reply to message #499110] Fri, 20 November 2009 06:50 Go to previous messageGo to next message
Eclipse UserFriend
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 12:53 Go to previous messageGo to next message
Eclipse UserFriend
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 18:08 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
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: Tue Mar 19 04:30:25 GMT 2024

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

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

Back to the top