How detect if a TopComponent is currently undocked

View: New views
3 Messages — Rating Filter:   Alert me  

How detect if a TopComponent is currently undocked

by Nelson Soares :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I develop an application with Netbeans RCP and I can't know how I can do to detect if a TopComponent is currently undocked ?

Please help me .

Thanks

Nelson

Re: How detect if a TopComponent is currently undocked

by bruehlicke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There was a discussion back in June

"
WindowManagerImpl.getInstance().isDocked(topcmponent);

this requires my package to be a friend of core.windows. I want to get
rid of the friend dependency. Is the state of a Mode available somehow
(joined, separated) or is there another way?
"

and

WindowManagerImpl.getInstance().isDocked(getTopComponentAt(tabIndex));

is more or less equal to

SwingUtilities.getWindowAncestor( getTopComponentAt(tabIndex) ) ==
WindowManager.getDefault().getMainWindow()


Maybe you can use this.

B-)


On Thu, Oct 22, 2009 at 11:23 AM, Nelson Soares <soares@...> wrote:

> Hi,
>
> I develop an application with Netbeans RCP and I can't know how I can do to detect if a TopComponent is currently undocked ?
>
> Please help me .
>
> Thanks
>
> Nelson
>

Re: How detect if a TopComponent is currently undocked

by Tim Boudreau :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

bruehlicke wrote:
SwingUtilities.getWindowAncestor( getTopComponentAt(tabIndex) ) ==
WindowManager.getDefault().getMainWindow()
Slightly less verbose (assuming this instanceof TopComponent):
getTopLevelAncestor() == WindowManager.getDefault().getMainWindow()

Remember that you can only call WindowManager.getDefault().getMainWindow() from the AWT event thread.

-Tim