Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Detaching a View Programatically


I came across the need to have a view detached by default. Some investigation lead me to this code which allows me to detach the view. I am running this code when the tool that requires the view makes the view visible (if it's not currently visible).

IViewReference ref = page.findViewReference(VIEW_ID);
((WorkbenchPage)page).detachView(ref);

However there are couple issues with this:
1) This line "((WorkbenchPage)page).detachView(ref);" results in the following warning: Discouraged access: The type WorkbenchPage is not accessible due to the restriction on required library org.eclipse.ui.workbench_3.3.2.M20080207-0800.jar

Can anyone point out to me the implications of this message?

2) If you close the view and re-open it again the view slowly moves down & to the right. As well there seems to be a lot of flickering in the screen. This is not a big problem; just rather annoying.

I'm curious to know if anyone has a better way to automatically detach views.

Emily


Back to the top