Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Workbench save and restore dilama
Workbench save and restore dilama [message #482827] Fri, 28 August 2009 09:08 Go to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
Hi,

i have an rcp application in which there is a perspective,

In createInitialLayout i have added
partlisteners,windowlistener,workbenchlistenere for varies resons,

when i run the application with setSaveAndRestore true,
on restore the createInitialLayout method is not called...

am i adding the listeners in the wrong place...
or is there a workaround for the same....

Also what if i dont want to save and restore my perpective,views(the
application contains many perspectives which need save and restore)

To achieve the above on preshutdown i tryed to close my views which were
opened,but here the problem is it only returns the active perspective
parts...
(i.e if the user in some other perspective on shutdown the views returned
will be of the specific perpective not my perspective)

pls help


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Workbench save and restore dilama [message #482990 is a reply to message #482827] Fri, 28 August 2009 22:15 Go to previous messageGo to next message
Will Horn is currently offline Will Horn
Messages: 265
Registered: July 2009
Senior Member
"vijay " <vijay.rajonline@gmail.com> wrote in message
news:3e1edb236197a8b08d4dd7b0f7ba2a40$1@www.eclipse.org...
> In createInitialLayout i have added
> partlisteners,windowlistener,workbenchlistenere for varies resons,
>
> when i run the application with setSaveAndRestore true,
> on restore the createInitialLayout method is not called...
When you set save and restore to true, you are telling the workbench to
restore its previous state and *not* reset your perspective the the intial
layout. createInitialLayout is called when there is no saved state (or when
you choose the "Reset Perspective" action).

> am i adding the listeners in the wrong place...
> or is there a workaround for the same....
You should consider adding listeners during one of the WorkbenchAdvisor or
WorkbenchWindowAdvisor callbacks.

> Also what if i dont want to save and restore my perpective,views(the
> application contains many perspectives which need save and restore)
Good question - I do not know how to selectively save some perspectives and
not others.

> To achieve the above on preshutdown i tryed to close my views which were
> opened,but here the problem is it only returns the active perspective
> parts...
> (i.e if the user in some other perspective on shutdown the views returned
> will be of the specific perpective not my perspective)
Re: Workbench save and restore dilama [message #483087 is a reply to message #482990] Mon, 31 August 2009 04:53 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
I think in createInitialLayout java doc should contain this info,
> When you set save and restore to true, you are telling the workbench to
> restore its previous state and *not* reset your perspective the the intial
> layout. createInitialLayout is called when there is no saved state (or when
> you choose the "Reset Perspective" action).

ya this is obvious but still it should be....

> You should consider adding listeners during one of the WorkbenchAdvisor or
> WorkbenchWindowAdvisor callbacks.
I do not have access to these classes,since my application startup code is
in a framework which is used as a target platform hence unmodifiable....
what would be the best place to add these listeners so that i do not
accidentally load my plugins on startup and also can moniter perspective
change window states etc...

i know all this is a design issue, but still can you pls suggest a proper
place for adding all the listeners....

Thanks




Will Horn wrote:

> "vijay " <vijay.rajonline@gmail.com> wrote in message
> news:3e1edb236197a8b08d4dd7b0f7ba2a40$1@www.eclipse.org...
>> In createInitialLayout i have added
>> partlisteners,windowlistener,workbenchlistenere for varies resons,
>>
>> when i run the application with setSaveAndRestore true,
>> on restore the createInitialLayout method is not called...
> When you set save and restore to true, you are telling the workbench to
> restore its previous state and *not* reset your perspective the the intial
> layout. createInitialLayout is called when there is no saved state (or when
> you choose the "Reset Perspective" action).

>> am i adding the listeners in the wrong place...
>> or is there a workaround for the same....
> You should consider adding listeners during one of the WorkbenchAdvisor or
> WorkbenchWindowAdvisor callbacks.

>> Also what if i dont want to save and restore my perpective,views(the
>> application contains many perspectives which need save and restore)
> Good question - I do not know how to selectively save some perspectives and
> not others.

>> To achieve the above on preshutdown i tryed to close my views which were
>> opened,but here the problem is it only returns the active perspective
>> parts...
>> (i.e if the user in some other perspective on shutdown the views returned
>> will be of the specific perpective not my perspective)


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Workbench save and restore dilama [message #483458 is a reply to message #483087] Tue, 01 September 2009 16:35 Go to previous messageGo to next message
Will Horn is currently offline Will Horn
Messages: 265
Registered: July 2009
Senior Member
You can put startup code in your BundleActivator. You could look into the
"org.eclipse.ui.startup" extension point.
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/reference/extension-points/org_eclipse_ui_ startup.html

Will
"vijay " <vijay.rajonline@gmail.com> wrote in message
news:56c588e55982b8bf020eccd3c73ec0f0$1@www.eclipse.org...
>I think in createInitialLayout java doc should contain this info,
>> When you set save and restore to true, you are telling the workbench to
>> restore its previous state and *not* reset your perspective the the
>> intial layout. createInitialLayout is called when there is no saved
>> state (or when you choose the "Reset Perspective" action).
>
> ya this is obvious but still it should be....
>
>> You should consider adding listeners during one of the WorkbenchAdvisor
>> or WorkbenchWindowAdvisor callbacks.
> I do not have access to these classes,since my application startup code is
> in a framework which is used as a target platform hence unmodifiable....
> what would be the best place to add these listeners so that i do not
> accidentally load my plugins on startup and also can moniter perspective
> change window states etc...
>
> i know all this is a design issue, but still can you pls suggest a proper
> place for adding all the listeners....
>
> Thanks
>
>
>
>
> Will Horn wrote:
>
>> "vijay " <vijay.rajonline@gmail.com> wrote in message
>> news:3e1edb236197a8b08d4dd7b0f7ba2a40$1@www.eclipse.org...
>>> In createInitialLayout i have added
>>> partlisteners,windowlistener,workbenchlistenere for varies resons,
>>>
>>> when i run the application with setSaveAndRestore true,
>>> on restore the createInitialLayout method is not called...
>> When you set save and restore to true, you are telling the workbench to
>> restore its previous state and *not* reset your perspective the the
>> intial layout. createInitialLayout is called when there is no saved
>> state (or when you choose the "Reset Perspective" action).
>
>>> am i adding the listeners in the wrong place...
>>> or is there a workaround for the same....
>> You should consider adding listeners during one of the WorkbenchAdvisor
>> or WorkbenchWindowAdvisor callbacks.
>
>>> Also what if i dont want to save and restore my perpective,views(the
>>> application contains many perspectives which need save and restore)
>> Good question - I do not know how to selectively save some perspectives
>> and not others.
>
>>> To achieve the above on preshutdown i tryed to close my views which were
>>> opened,but here the problem is it only returns the active perspective
>>> parts...
>>> (i.e if the user in some other perspective on shutdown the views
>>> returned will be of the specific perpective not my perspective)
>
>
Re: Workbench save and restore dilama [message #483566 is a reply to message #483458] Wed, 02 September 2009 06:28 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
I did exactly that only,but using uijod because startup is a non ui
thread..

after doing all that,now there is a new problem....

my application has language change option,on language change and restart
the views are restored but with titles with old language...
on focus of the view only, the titles get updated...

is this a bug or it should be like this?????

Will Horn wrote:

> You can put startup code in your BundleActivator. You could look into the
> "org.eclipse.ui.startup" extension point.
>
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/reference/extension-points/org_eclipse_ui_ startup.html

> Will
> "vijay " <vijay.rajonline@gmail.com> wrote in message
> news:56c588e55982b8bf020eccd3c73ec0f0$1@www.eclipse.org...
>>I think in createInitialLayout java doc should contain this info,
>>> When you set save and restore to true, you are telling the workbench to
>>> restore its previous state and *not* reset your perspective the the
>>> intial layout. createInitialLayout is called when there is no saved
>>> state (or when you choose the "Reset Perspective" action).
>>
>> ya this is obvious but still it should be....
>>
>>> You should consider adding listeners during one of the WorkbenchAdvisor
>>> or WorkbenchWindowAdvisor callbacks.
>> I do not have access to these classes,since my application startup code is
>> in a framework which is used as a target platform hence unmodifiable....
>> what would be the best place to add these listeners so that i do not
>> accidentally load my plugins on startup and also can moniter perspective
>> change window states etc...
>>
>> i know all this is a design issue, but still can you pls suggest a proper
>> place for adding all the listeners....
>>
>> Thanks
>>
>>
>>
>>
>> Will Horn wrote:
>>
>>> "vijay " <vijay.rajonline@gmail.com> wrote in message
>>> news:3e1edb236197a8b08d4dd7b0f7ba2a40$1@www.eclipse.org...
>>>> In createInitialLayout i have added
>>>> partlisteners,windowlistener,workbenchlistenere for varies resons,
>>>>
>>>> when i run the application with setSaveAndRestore true,
>>>> on restore the createInitialLayout method is not called...
>>> When you set save and restore to true, you are telling the workbench to
>>> restore its previous state and *not* reset your perspective the the
>>> intial layout. createInitialLayout is called when there is no saved
>>> state (or when you choose the "Reset Perspective" action).
>>
>>>> am i adding the listeners in the wrong place...
>>>> or is there a workaround for the same....
>>> You should consider adding listeners during one of the WorkbenchAdvisor
>>> or WorkbenchWindowAdvisor callbacks.
>>
>>>> Also what if i dont want to save and restore my perpective,views(the
>>>> application contains many perspectives which need save and restore)
>>> Good question - I do not know how to selectively save some perspectives
>>> and not others.
>>
>>>> To achieve the above on preshutdown i tryed to close my views which were
>>>> opened,but here the problem is it only returns the active perspective
>>>> parts...
>>>> (i.e if the user in some other perspective on shutdown the views
>>>> returned will be of the specific perpective not my perspective)
>>
>>


---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Workbench save and restore dilama [message #483738 is a reply to message #483566] Wed, 02 September 2009 18:44 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

vijay wrote on Wed, 02 September 2009 02:28


my application has language change option,on language change and restart
the views are restored but with titles with old language...
on focus of the view only, the titles get updated...

is this a bug or it should be like this?????



A bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=202172

PW


Previous Topic:Programmatically associate views to categories
Next Topic:Can I use a command parameter in its handler's enabledWhen?
Goto Forum:
  


Current Time: Thu Oct 02 06:29:20 GMT 2014

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

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