Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » open eclipse perspective in eclipse from command line
open eclipse perspective in eclipse from command line [message #899078] Mon, 30 July 2012 13:42 Go to next message
becks m is currently offline becks mFriend
Messages: 59
Registered: June 2012
Member
I want to open eclipse application and pass perspective ID in it through command line.

so that eclipse opens and show the perspective

How can I do that ?
Re: open eclipse perspective in eclipse from command line [message #899098 is a reply to message #899078] Mon, 30 July 2012 14:35 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

The way to do this is through the eclipse.ini file using
   -perspective
     <description>

This would also work as a command line argument. Although, I have not tried this in e4 and in general would not recommend its use. The caveat is that the containing plugin must be installed and running. [1]

Why do you need to pass the perspective as a command line arg?

JD

[1] http://help.eclipse.org/juno/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html (under Others)
Re: open eclipse perspective in eclipse from command line [message #899299 is a reply to message #899098] Tue, 31 July 2012 12:10 Go to previous messageGo to next message
becks m is currently offline becks mFriend
Messages: 59
Registered: June 2012
Member
Thanks Joseph, It worked for me on Indigo.

I wanted to open my perspective in eclipse once it started. this was the reason
Re: open eclipse perspective in eclipse from command line [message #899361 is a reply to message #899299] Tue, 31 July 2012 14:36 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

What about supplying a default perspective in the WorkbenchAdvisor?
WorkbenchAdvisor.getInitialWindowPerspectiveId() {
    return "your.perspective.id";
}


If you are looking to restore the last perspective try:
WorkbenchAdvisor.initialize(IWorkbenchConfigurer configurer) {
    super.initialize(configurer);
    configurer.setSaveAndRestore(true);
}


These would be better and more generally accepted ways of loading your perspective.

JD
Re: open eclipse perspective in eclipse from command line [message #899951 is a reply to message #899361] Fri, 03 August 2012 07:43 Go to previous message
Libor Jelinek is currently offline Libor JelinekFriend
Messages: 143
Registered: January 2012
Location: Prague, Czech Rep.
Senior Member

Definitively agreed with Josehp. Make use of "-perspetive" place further
burden on you as you must manage eclipse(yourProduct).ini and product
definitions up-to-date with default perspective. Programmatic approach
also enables to have complex logic deciding about perspective to open.

Libor

On 07/31/2012 04:36 PM, Joseph Carroll wrote:
> What about supplying a default perspective in the WorkbenchAdvisor?
>
> WorkbenchAdvisor.getInitialWindowPerspectiveId() {
> return "your.perspective.id";
> }
>
>
> If you are looking to restore the last perspective try:
>
> WorkbenchAdvisor.initialize(IWorkbenchConfigurer configurer) {
> super.initialize(configurer);
> configurer.setSaveAndRestore(true);
> }
>
>
> These would be better and more generally accepted ways of loading your
> perspective.
>
> JD
Previous Topic:Cyclic dependency between plugins
Next Topic:Add the "Create Project" button
Goto Forum:
  


Current Time: Fri Apr 26 10:08:33 GMT 2024

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

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

Back to the top