Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Prevent a view from releasing
Prevent a view from releasing [message #661129] Wed, 23 March 2011 10:11 Go to next message
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 64
Registered: July 2010
Member
How could I customize the release view operation (currently put under
perspective.viewfactory.releaseview()) such that do NOT release a
particular view even there is no more reference?

Thanks
Re: Prevent a view from releasing [message #661917 is a reply to message #661129] Mon, 28 March 2011 14:13 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/23/2011 06:11 AM, Leung Wang Hei wrote:
> How could I customize the release view operation (currently put under
> perspective.viewfactory.releaseview()) such that do NOT release a
> particular view even there is no more reference?

you can't change that, when there are no more references the view will
be destroyed. The best you can do is save some state in your plugin
somewhere so that if the user re-creates the view you can get back to a
"good" state.

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


Re: Prevent a view from releasing [message #662538 is a reply to message #661917] Thu, 31 March 2011 02:52 Go to previous messageGo to next message
Leung Wang Hei is currently offline Leung Wang HeiFriend
Messages: 64
Registered: July 2010
Member
Already did. My goal is to shorten the view-recreation time.

As long as the view is not disposed (e.g. opened in another
perspective), opening it is instant.

It the view is hidden from all perspective (and disposed), opening shows
a noticable lag-time (no measurement, I should say 0.5~1s).

Any help?

Hei


On 28/3/2011 22:13, Paul Webster wrote:
> On 03/23/2011 06:11 AM, Leung Wang Hei wrote:
>> How could I customize the release view operation (currently put under
>> perspective.viewfactory.releaseview()) such that do NOT release a
>> particular view even there is no more reference?
>
> you can't change that, when there are no more references the view will
> be destroyed. The best you can do is save some state in your plugin
> somewhere so that if the user re-creates the view you can get back to a
> "good" state.
>
> PW
>
>
Re: Prevent a view from releasing [message #662640 is a reply to message #662538] Thu, 31 March 2011 11:32 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

On 03/30/2011 10:52 PM, Leung Wang Hei wrote:
> Already did. My goal is to shorten the view-recreation time.
>
> As long as the view is not disposed (e.g. opened in another
> perspective), opening it is instant.
>
> It the view is hidden from all perspective (and disposed), opening shows
> a noticable lag-time (no measurement, I should say 0.5~1s).

The framework won't help you with that. 2 suggestions:

1) save as much data as you can so you can re-create quickly and 2)
don't do things like re-connect or complex loading in the UI thread i.e.
createPartControl(*).

If re-creating your data is going to take a long time, create your
SWT/JFace controls in createPartControl(*) and start a
org.eclipse.core.runtime.jobs.Job to recreate your data ... when the Job
is ready, update your view.

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:How can I use IProject.getName() in plugin.xml or plugin.properties file
Next Topic:Problem with RCP on HPUX(PA-RISC)
Goto Forum:
  


Current Time: Thu Sep 26 09:13:00 GMT 2024

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

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

Back to the top