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.
current the window system API does not offer any easy way to find out whether a TopComponent is an 'editor' (i.e. opens in the 'editor' area of the main window) or a plain view (e.g. output window or navigator). therefore i suggest adding method isEditorTopComponent(TopComponent tc) to the WindowManager that returns true if there is a Mode that the TopComponent will be/is docked to and the Mode is of 'editor' kind (i.e. holds editor windows).
Created attachment 38818 [details] proposed implementation
shouldn't it be other wasy needed; i.e Mode should have that ability; Mode.isEditorMode(); then we can also check whether a topcomponent is editorTC or not as below: tc.getMode().isEditorMode();
the issue 83024 requires such API
santhosh, your proposal would require to find TopComponent's Mode first, check it for null value and then check the Mode type. my proposal is a bit easier on developers but i don't have any strong preferences either way.
I agree with you in ease of use; but there might be usecases, where programmer might want to know whether a given mode is editor mode or not; may be u can provide both; the api in topcomponent can simply check for NULL and use mode.isEditorMode() as return value;
Created attachment 38857 [details] an extended patch with Mode.isEditorMode
y01 I do not like adding new methods into interfaces - e.g. I'd like to see other solution than just adding new method into Mode interface - maybe boolean WindowManager.isEditorMode(Mode) would also be acceptable?
Created attachment 38919 [details] WindowManager.isEditorMode( Mode )
if there are no more comments, i'll integrate the latest version of the patch tomorrow
merged into trunk: Checking in openide/windows/apichanges.xml; /cvs/openide/windows/apichanges.xml,v <-- apichanges.xml new revision: 1.11; previous revision: 1.10 done Checking in openide/windows/manifest.mf; /cvs/openide/windows/manifest.mf,v <-- manifest.mf new revision: 1.13; previous revision: 1.12 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.57; previous revision: 1.56 done RCS file: /cvs/core/windows/test/unit/src/org/netbeans/core/windows/TopComponentTypeTest.java,v 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 initial revision: 1.1 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.15; previous revision: 1.14 done