This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 102174 - check TopComponent type - editor/view - outside the AWT thread
Summary: check TopComponent type - editor/view - outside the AWT thread
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks: 101797
  Show dependency tree
 
Reported: 2007-04-23 15:42 UTC by Stanislav Aubrecht
Modified: 2008-12-22 11:50 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
proposed implementation (10.29 KB, patch)
2007-04-23 15:45 UTC, Stanislav Aubrecht
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Aubrecht 2007-04-23 15:42:41 UTC
often it is needed to find out whether an active (or other) TopComponent is an
editor window or a view (e.g. project view, files view etc). quite often it is
also needed to make this check outside the AWT thread. however the windows api
allows access from AWT thread only which means that SwingUtilities.invokeAndWait
(or similar technique) must be used. but that is prone to deadlocks and other
thread synchronization issues.

i propose adding new method WindowManager.isOpenedEditorTopComponent(
TopComponent ) that would return true if the given TopComponent is opened and is
docked into an editor-type Mode. it is possible to implement this method in such
a way that it will be safe to call it from outside the AWT thread.
Comment 1 Stanislav Aubrecht 2007-04-23 15:45:34 UTC
Created attachment 41466 [details]
proposed implementation
Comment 2 Stanislav Aubrecht 2007-05-02 13:55:42 UTC
if there are no objections, i'll integrate the patch tomorrow
Comment 3 Stanislav Aubrecht 2007-05-03 10:38:30 UTC
integrated

Checking in openide/windows/apichanges.xml;
/cvs/openide/windows/apichanges.xml,v  <--  apichanges.xml
new revision: 1.17; previous revision: 1.16
done
Checking in openide/windows/manifest.mf;
/cvs/openide/windows/manifest.mf,v  <--  manifest.mf
new revision: 1.16; previous revision: 1.15
done
Checking in openide/windows/src/org/openide/windows/WindowManager.java;
/cvs/openide/windows/src/org/openide/windows/WindowManager.java,v  <-- 
WindowManager.java
new revision: 1.17; previous revision: 1.16
done
Checking in
core/windows/test/unit/src/org/netbeans/core/windows/TopComponentTypeTest.java;
/cvs/core/windows/test/unit/src/org/netbeans/core/windows/TopComponentTypeTest.java,v
 <--  TopComponentTypeTest.java
new revision: 1.5; previous revision: 1.4
done
Checking in core/windows/src/org/netbeans/core/windows/WindowManagerImpl.java;
/cvs/core/windows/src/org/netbeans/core/windows/WindowManagerImpl.java,v  <-- 
WindowManagerImpl.java
new revision: 1.63; previous revision: 1.62
done