Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Open View in separate Window/Shell
Open View in separate Window/Shell [message #661205] Wed, 23 March 2011 15:14 Go to next message
budili Missing name is currently offline budili Missing name
Messages: 64
Registered: May 2010
Member
Hello,

it is possible to open a Eclipse View in a separate Shell?
My Problem:

I have integrate a console view in my RCP application.
At the moment i open it as an internal view.

final MessageConsole systemConsole = new MessageConsole(CONSOLE_NAME, null);
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
            final IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
            view.display(systemConsole);


But i want to open the Console View in a separate Window.
It is possible? Can someone help me?

THX
Budi

P.S. it is possible to replace the workbench window through an external window/shell?

[Updated on: Tue, 12 April 2011 08:35]

Report message to a moderator

Re: Open View in separate Window/Shell [message #661783 is a reply to message #661205] Sun, 27 March 2011 20:05 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 279
Registered: July 2009
Senior Member

Hi Budili,

Views can be detached manually. Once detached they stay detached when the
state is restored on the next run. You can also start a new workbench window
(window/new window) in which you can host this view separate from your other
workbench window.

I have used a nasty trick to detach a view programmatically in the views
setFocus() method. As you can see it uses an interal so I advise you not to
use this.

Regards,

Wim

@Override
public void setFocus() {
if (!once) {
once = true;
IViewReference ref = getSite().getPage().findViewReference(
"org.eclipse.ecf.salvo.ui.internal.views.postNewArticleView", "1");
if (PreferenceModel.instance.getUseDetachedView()) {
((WorkbenchPage)
getSite().getPage()).getActivePerspective().getPresentation( )
detachPart(ref);
getViewSite().getShell().setSize(600, 450);
getViewSite().getShell().setLocation(location.x + 100, location.y + 100);
} else
((WorkbenchPage)
getSite().getPage()).getActivePerspective().getPresentation( )
attachPart(ref);

}
subjectText.setFocus();
}


> Hello,
>
> it is possible to open a Eclipse View in a separate Shell?
> My Problem:
>
> I have integrate a console view in my RCP application.
> At the moment i open it as an internal view.
>
>
> final IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
> final IConsoleView view = (IConsoleView)
page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
> view.display(systemConsole);
>
>
> But i want to open the Console View in a separate Window.
> It is possible? Can someone help me?
>
> THX
> Budi
Re: Open View in separate Window/Shell [message #661898 is a reply to message #661205] Mon, 28 March 2011 13:18 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Your best bet is probably the second one that Wim mentions. Open a new
workbench window with a different perspective that only contains the
view in question.

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/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:Anyway to specify new KeyEvent.keyLocation in plugin.xml?
Next Topic:Product configuration (features included)
Goto Forum:
  


Current Time: Tue Oct 21 00:40:53 GMT 2014

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

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