Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Can I open a view in detached mode programmatically?
icon5.gif  Can I open a view in detached mode programmatically? [message #640175] Fri, 19 November 2010 13:12 Go to next message
Alexandra Niculai is currently offline Alexandra Niculai
Messages: 84
Registered: July 2009
Member
Hello everyone

I know how to open a view from my code. But is it possible to open that view directly in detached mode from my code? Thank you!

Greetings
Alexandra.
Re: Can I open a view in detached mode programmatically? [message #640188 is a reply to message #640175] Fri, 19 November 2010 13:34 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Alexandra Niculai wrote:
> Hello everyone
>
> I know how to open a view from my code. But is it possible to open that
> view directly in detached mode from my code? Thank you!

I think no. If there was, there would be a way to mark a view as
detached when creating a presentation.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Can I open a view in detached mode programmatically? [message #640192 is a reply to message #640188] Fri, 19 November 2010 14:18 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra Niculai
Messages: 84
Registered: July 2009
Member
Thank you for answering!
Well, then I think I'll just have to put the viewer in a dialog.

Alexandra.
Re: Can I open a view in detached mode programmatically? [message #643047 is a reply to message #640175] Fri, 03 December 2010 17:51 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Alexandra,

Yes, this is possible.

This is what you use in the setfocus method of the view:

@Override
public void setFocus() {
if (!once) {
once = true;
IViewReference ref = getSite().getPage().findViewReference(
"org.eclipse.ecf.salvo.ui.internal.views.postNewArticleView", "1");

((WorkbenchPage)
getSite().getPage()).getActivePerspective().getPresentation( )
detachPart(ref);
getViewSite().getShell().setSize(600, 450);
getViewSite().getShell().setLocation(location.x + 100, location.y + 100);

}
subjectText.setFocus();
}

see:
https://github.com/ECF/Newsreader/blob/master/bundles/org.ec lipse.ecf.salvo.ui/src/org/eclipse/ecf/salvo/ui/internal/vie ws/PostNewArticleView.java

--

Best Regards,
Wim Jongman

-- The net knows all!
Jeff McAffer - EclipseSource

> Hello everyone
>
> I know how to open a view from my code. But is it possible to open that
view directly in detached mode from my code? Thank you!
>
> Greetings
> Alexandra.
Re: Can I open a view in detached mode programmatically? [message #643053 is a reply to message #640175] Fri, 03 December 2010 18:23 Go to previous messageGo to next message
Alexandra Niculai is currently offline Alexandra Niculai
Messages: 84
Registered: July 2009
Member
Well, this is great! Thank you, Wim!

Greetings,
Alexandra.
Re: Can I open a view in detached mode programmatically? [message #643300 is a reply to message #643053] Mon, 06 December 2010 12:52 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Alexandra Niculai wrote:
> Well, this is great! Thank you, Wim!

Keep in mind that's internal code, and won't work in Eclipse 4.x
PW



--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:Sharing state between different commands
Next Topic:Update Site does not work for core features
Goto Forum:
  


Current Time: Mon Sep 22 08:28:49 GMT 2014

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

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