ViewPart issue [message #82786] |
Mon, 14 April 2008 11:22 |
Eclipse User |
|
|
|
Originally posted by: dnise.hotmail.com
Hi all:
what about viewpart the dispose method? if I want to dispose the viewpart
in my application, I call dispose method,But it's doesn't work. maybe i
can call hide viewpart method.. can anyone tell me the difference of these
two methods?
an other problem, if I want to exit my application, how should close all the
started resource? I close all the perspectives now , But I don't know it's
right to release all the resource which include the
Eventlisteners,controls,images,font and so on.
Thanks in advance.
dnise
2008-04-14
|
|
|
Re: ViewPart issue [message #82845 is a reply to message #82786] |
Mon, 14 April 2008 14:02 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
I think IWorkbenchPage#hideView does what you are looking for, it
disposes of the viewpart if the reference count in all perspectives is
0. It can't do so if the viewpart is still open in another perspective.
Therefore it makes sense, that there's no direct 'close' functionality
using the dispose of a workbench part directly.
Here are two stacktrace excerpts that show how hideView works:
(1) this shows how the root widget of the part gets disposed of
at org.eclipse.swt.widgets.Widget.dispose(Widget.java:610)
at org.eclipse.ui.internal.PartPane.dispose(PartPane.java:163)
at org.eclipse.ui.internal.ViewPane.dispose(ViewPane.java:185)
at
org.eclipse.ui.internal.WorkbenchPartReference.dispose(Workb enchPartRefe
rence.java:652)
at
org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchP age.java:151
4)
at
org.eclipse.ui.internal.WorkbenchPage.partRemoved(WorkbenchP age.java:150
6)
at org.eclipse.ui.internal.ViewFactory.releaseView(ViewFactory. java:243)
at org.eclipse.ui.internal.Perspective.hideView(Perspective.jav a:511)
at
org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage .java:2165)
(2) this shows how the part itself gets disposed of
at
org.eclipse.rap.demo.DemoTreeViewPart.dispose(DemoTreeViewPa rt.java:238)
at
org.eclipse.ui.internal.WorkbenchPartReference.doDisposePart (WorkbenchPa
rtReference.java:704)
at
org.eclipse.ui.internal.ViewReference.doDisposePart(ViewRefe rence.java:1
16)
at
org.eclipse.ui.internal.WorkbenchPartReference.dispose(Workb enchPartRefe
rence.java:655)
at
org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchP age.java:151
4)
at
org.eclipse.ui.internal.WorkbenchPage.partRemoved(WorkbenchP age.java:150
6)
at org.eclipse.ui.internal.ViewFactory.releaseView(ViewFactory. java:243)
at org.eclipse.ui.internal.Perspective.hideView(Perspective.jav a:511)
at
org.eclipse.ui.internal.WorkbenchPage.hideView(WorkbenchPage .java:2165)
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: dnise [mailto:dnise@hotmail.com]
Bereitgestellt: Montag, 14. April 2008 13:23
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: ViewPart issue
Betreff: ViewPart issue
Hi all:
what about viewpart the dispose method? if I want to dispose the
viewpart in my application, I call dispose method,But it's doesn't
work. maybe i can call hide viewpart method.. can anyone tell me the
difference of these
two methods?
an other problem, if I want to exit my application, how should close all
the started resource? I close all the perspectives now , But I don't
know it's right to release all the resource which include the
Eventlisteners,controls,images,font and so on.
Thanks in advance.
dnise
2008-04-14
|
|
|
Powered by
FUDForum. Page generated in 0.03017 seconds