Skip to main content



      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 09:42 Go to next message
Eclipse UserFriend
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 10:35 Go to previous messageGo to next message
Eclipse UserFriend
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 08:10 Go to previous messageGo to next message
Eclipse UserFriend
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 10:36 Go to previous messageGo to next message
Eclipse UserFriend
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 03:43 Go to previous message
Eclipse UserFriend
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: Thu Jul 24 00:02:54 EDT 2025

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

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

Back to the top