Home » Eclipse Projects » Eclipse Platform » Workbench save and restore dilama
Workbench save and restore dilama [message #482827] |
Fri, 28 August 2009 09:08 |
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 #483087 is a reply to message #482990] |
Mon, 31 August 2009 04:53 |
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 |
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 |
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
|
|
| |
Goto Forum:
Current Time: Mon Sep 23 22:16:30 GMT 2024
Powered by FUDForum. Page generated in 0.03601 seconds
|